Route ambiguous requests and create the Material List before any research begins.
Read First
references/schemas.md
Cold Start
Before routing, check whether the vault is configured.
If <vault-root>/.loom/config.yaml does not exist, run a one-time setup interview:
- Vault location — Where should the vault live? Suggest
~/loom-vault. Create the directory if needed. - Working language —
zh,en, orauto(detect per query). - Interest areas — What topics is the user currently working on? (e.g. "AI Agent, Software Architecture"). These become the initial Category directories under
02_Topic_Notes/. - Default research depth —
quick(Source Brief only),standard(through Synthesis Pack), ordeep(full pipeline through Topic Note + Index).
Write .loom/config.yaml to the vault root:
vault_path: <absolute-path>
language: <zh|en|auto>
categories:
- <Category>
output_depth: <quick|standard|deep>
created: YYYY-MM-DD
If config already exists, read it. Use stored preferences as defaults — user can override per query.
To change settings later, the user can say "reconfigure" or edit .loom/config.yaml directly.
Routing
When the user's intent is clear, route directly:
- Research materials (URLs, PDFs, text → synthesis pack): use
loom-research. - Write or draft (from synthesis or notes → article → topic → index): use
loom-write. - Vault maintenance (validate, migrate, evolve, connect, index rebuild): use
loom-maintain.
When intent is ambiguous, ask one question: "Research, write, or maintain?"
- Research AND write (e.g. "Research these three URLs and write an article"): execute the full pipeline directly — do not route (see Full Pipeline below).
Intake
Topic query
When the user provides a topic without sources (e.g. "agent memory implementation principles"):
- If
<vault-root>/.loom/config.yamldoes not exist: guide the user. "Loom works best with source materials. Do you have URLs, PDFs, or text to share? If you just want a quick overview, a chat frontend may be faster." - If config exists: run source discovery.
- Web-search the topic, find 3-5 high-quality sources. Prioritize official docs, technical articles, papers. Avoid social media, marketing content, content farms.
- Present the source list to the user for quick approval.
- If search results are low-quality, tell the user what was found and ask whether to proceed anyway or provide better sources.
- Create Material List. Mark sources with a note that they were web-searched.
- Proceed to intake.
Standard intake
Before routing to loom-research or loom-write, create a Material List:
- Classify task type: single-source deep dive, multi-source synthesis, theme research, or draft rewrite.
- For each source, record: ID (S1, S2…), Title, Author, Date, Type, Source Tier, Relevance, Citation Usability, Risk Level, Raw Path, Capture Status.
- Every source row must include a
raw_path. If no local capture exists, use the original URL/path orpasted-local-textand mark capture status as pending. - Record source tier, relevance, citation usability, and risk level conservatively.
- Suggest next step:
loom-researchorloom-write.
Full Pipeline
When the user asks to research AND write, execute all stages in sequence:
- Intake → Material List (including topic query source discovery if needed)
- Capture → Raw Captures + inbox Daily Notes
- Read → Source Brief per source (following loom-research stages)
- Synthesize → Synthesis Pack (conclusions only; reasoning is internal)
- Draft → article from Synthesis Pack + Source Briefs (see loom-write source grounding)
- Topic Note → durable knowledge from Synthesis Pack
- Index → update TOPIC_INDEX and TIMELINE_INDEX
At completion, report: article path, Synthesis Pack path, new Topic Notes, vault location.
If the user asks to research only (no write), run stages 1-4. If the user asks to capture only, read only, or synthesize only, follow P3 stage selection.
Rules
- Do not deep-read, synthesize, or draft in this stage.
- Do not let Draft or Final wording overwrite Raw Capture, Daily Note, Source Brief, Synthesis Pack, or Topic Note content.
- Detect user query language. All generated artifacts (Source Brief, Synthesis Pack, Draft, Topic Note) use the user's language. Raw Captures always preserve source language.