RAG Knowledge Base Setup
rag-knowledge-base-setup · v1.0.0
ivyx
Use when someone wants a knowledge base (bilgi tabanı), RAG or document search over files in the project (docs, notes, manuals) so an assistant can answer questions from them; builds, checks and queries it.
Who is asked
Risk medium: you are asked when it loads, and that yes covers reading its files in the same chat.
Tools it may call
While this skill is active, a call to any other tool is refused. These still meet every policy rule; the list narrows, it approves nothing.
knowledge.base.listknowledge.base.upsertknowledge.base.ingestknowledge.queryknowledge.chunk.comparevectors.embedder.statusWhat it tells the agent
The published SKILL.md, as written.
--- name: rag-knowledge-base-setup description: Use when someone wants a knowledge base (bilgi tabanı), RAG or document search over files in the project (docs, notes, manuals) so an assistant can answer questions from them; builds, checks and queries it. allowed-tools: knowledge.base.list knowledge.base.upsert knowledge.base.ingest knowledge.query knowledge.chunk.compare vectors.embedder.status metadata: risk: medium ---
Building a knowledge base
The point is an assistant that answers from the base. So you do not read
the documents yourself to answer: every answer you give comes from
knowledge.query, and you build the base before you query it.
1. Look at what exists
knowledge.base.list: the bases already defined and what their indexes hold. Extend an existing base rather than defining a second one over the same files.vectors.embedder.status: which embedder builds the index. Whensourceishash, tell the person, in your own words, what itsnextStepsays: this embedder matches shared words, not meaning, and how to switch to a local model. Then go on; the base still works for words the question and the documents share.
2. Define the base
knowledge.base.upsert with:
id: lower-case letters, digits and dashes (company-docs);include: globs, not a list of files (docs/**/*.md);**crosses folders and*does not;excludefor what should stay out;description: what the files are, read from their names and folders. Never name a topic you have not seen in a path.
When the documents are long or have many headings, call
knowledge.chunk.compare with one representative file and pass the
strategy whose chunks keep a heading with its text as strategy.
3. Check, then build
knowledge.base.ingestwith the base anddryRun: true. It lists the paths the globs resolve to. If a file the person meant is missing, or one they did not mean is there, fixincludeorexcludefirst.knowledge.base.ingestwith the base. Readfilesandchunksfrom the answer and say them.
4. Ask it
knowledge.query with the base and the person's question, in their words.
- Answer only from
hits, and name each hit'spath. - When no hit holds the answer, say the base does not answer it and which files you expected to; do not answer from memory.
- Report the
modethe answer came back in, and with the hash embedder say that a reworded question can miss.
End with the base id, its files and chunks, the embedder, and the answer with its source.