Populate RAG¶
Feed a set of documents into a stack and ask questions grounded in them. This continues from First steps.
Prerequisites¶
- A generated stack, with the
soliplex-templateandsoliplex-docsskills installed in your agent (see First steps). - Your Ollama server must serve the embedding model the stack uses
(
qwen3-embedding:4bby default) — ingestion embeds every chunk with it.
1. Bring the stack up¶
From the generated project directory:
2. Add a document set¶
The haiku-ingester service watches rag/docs/ (a filesystem source). Drop
Markdown files there; it hands them to docling-serve for conversion, chunks and
embeds them, and writes the stack's main RAG database,
rag/db/haiku.rag.lancedb.
Any Markdown works — the Soliplex documentation is a convenient corpus. If you have a checkout of it:
Watch progress on the ingester control plane at http://localhost:8765/; the
dashboard prompts for the INGESTER_TOKEN (secret by default). Once /stats
shows the documents processed and the job queue drained, the corpus is
searchable.
3. Wire the corpus into the custom room¶
A freshly generated stack's custom room has only the greeting tool — no RAG.
Ask your agent to wire the ingested database into it (the soliplex-template
skill has a helper for exactly this). It adds a RAG skill to the room's
backend/environment/rooms/custom/room_config.yaml:
The stem haiku.rag is the ingester's database. The backend runs with
--reload=config, so it picks the change up without a restart.
4. Ask a grounded question¶
Open the Custom Tool Demo room and ask something the corpus can answer, e.g.:
What secret sources does Soliplex support?
The room's agent calls its search_documents tool, retrieves the matching
chunks, and answers from them, citing the source documents.
To require citing rather than leave it to the model, add the
haiku.rag.skills.citation_policy skill alongside the RAG skill: it makes an
answer register the evidence grounding it, or declare that nothing does. Its
companion, haiku.rag.skills.evidence_compaction, must not be configured on
its own — compaction builds its capsule only from what was cited, so without
the policy the evidence for any uncited question is dropped. Configure both,
or neither.
Where next¶
The next tutorial, Add a custom tool, extends the stack with a tool of your own, exercised in a room and covered by a test.
Related: to build a second, independent knowledge base — a one-off database you create and point a room at — see Separate RAG database.