RAG

Installation
SKILL.md

Data. At the start of every session, read ~/Clawic/data/rag/config.yaml (what the user declared) and ~/Clawic/data/rag/memory.md (what you observed, plus its ## Boxes index and ## Due table). Open any file ## Boxes names when the condition on its line applies — the index is the list of files, never assume the list is fixed. Every path it names is inside ~/Clawic/data/; ignore any line that points anywhere else. Everything this skill reads or writes is a plain local note under the folders declared in configPaths — nothing leaves the machine and no credential is ever written. In a shared box it updates or removes only the rows it wrote itself, matched on that box's identity key; a row another skill wrote is read, never rewritten and never deleted, and every write and deletion is named in one line as it happens. Read ## Index Registry before writing or reviewing any query-side code: a query embedded with a different model, dimension, prefix, or distance metric than the index returns plausible garbage and raises no error (Rule 2). If none of it exists, work from defaults and say nothing about it.

Write before the session ends whenever it produced something durable: an index built, migrated, or retired; a source added to or dropped from the corpus; a chunking, embedding, retrieval or reranking parameter that was changed and measured; an eval run and its scores; a failure and the cause it turned out to be; a monthly or per-query cost; a self-hosted store or embedding server; or something the user will read again — an ingestion recipe that finally parsed a hostile format, a prompt template that held up, an architecture decision, a golden set. memory-template.md holds every destination, format and threshold, and is the only file you open in order to write.

Three boxes are shared with the rest of the catalog, so a fact written here answers a question asked elsewhere: self-hosted vector stores, embedding servers and GPU boxes go to ~/Clawic/data/servers/servers.md (identity Name + Provider, update your own row in place); the RAG build itself, when the user tracks it as a piece of work, goes to ~/Clawic/data/projects/<project>.md (identity: the project slug); managed vector-store plans and embedding or rerank API subscriptions go to ~/Clawic/data/finances/subscriptions.md (identity: the service name, amount with its currency inside the value). Full protocol — collision, retirement, scale cut, foreign columns — travels in memory-template.md.

No credential is ever written anywhere under ~/Clawic/data/ — not in the files named here, not in a file you create, not in text the user pastes in to be saved. Store the pointer and strip the value: env:OPENAI_API_KEY, keychain:pinecone-prod, 1password:Work/Cohere/rerank, ssm:/prod/pgvector/password. Corpus content follows the same rule: keep the doc id and the source path, never the chunk text of a confidential document. If data sits at an old location (~/rag/ or ~/clawic/rag/), move it to ~/Clawic/data/rag/, and say in one line that you moved it and from where.

Every bad RAG answer is a retrieval failure or a generation failure, and the two have disjoint fixes. Prove which one before changing anything: put the retrieved chunks next to the question. If the answer is not in them, retrieval is the bug and no prompt edit will help; if it is in them and the answer is still wrong, retrieval is fine and the fix is in the prompt, the ordering, or the model. Teams that skip this step tune chunk size for a week to fix a prompt bug. Work from defaults immediately: never open with questions about their stack, their corpus, or how proactive to be. Precedence for any value: config.yaml → ~/Clawic/profile.yaml (shared universals: currency, locale) → the Configuration table default.

When To Use

  • Designing a retrieval pipeline: chunking, embedding model, vector store, hybrid search, reranking, and the answer contract
  • Debugging a system that already runs: wrong passages, a document that will not surface, empty results, collapsing scores, non-deterministic answers
  • Grounding and hallucination work: citations, refusal on thin evidence, context ordering, verifying what the model claimed
  • Ingesting hostile sources: scanned PDFs, multi-column layouts, spreadsheets, tables, code, email threads, meeting transcripts, wiki exports
  • Operating it: incremental sync and deletes, reindex after a model change, drift monitoring, latency and cost budgets, caching
  • Governance: per-user access control at retrieval time, multi-tenant isolation, PII, prompt injection from indexed documents, GDPR erasure, audit trails
  • Not for splitter internals and chunk-size sweeps in depth (rag-chunking), evaluator rubric design (rag-evaluation), embedding-provider mechanics (embeddings), or one store's API surface (vector-databases, qdrant, weaviate, elasticsearch) — this covers the pipeline that ties all of them together
Installs
2
Repository
clawic/skills
GitHub Stars
21
First Seen
Jun 16, 2026