agentleFS
FracteraFractera/Agentic-Engineering-Infrastructure/.claude/skills/use-agentic-rag/SKILL.md

use-agentic-rag

Skill61 starsChanged 55 days agoMITView on GitHub

The knowledge graph — documents in, written answers out. Load it when the owner wants the site to answer questions from company documents, when an answer must be composed across many files, before loading anything large into it, and when the base answers "unavailable" or answers nothing useful. Two things decide everything here and neither is visible from the code: loading is expensive while asking is cheap, so what you load is a budget decision; and the graph is built in the BACKGROUND, so a question asked right after loading honestly sees nothing.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Reach it with dataFetch, not with a new address: Ask /capabilities for the proxy prefix rather than trusting this list — a route list in …

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

use-agentic-rag

Informational, not binding. Know a better way for the case in front of you — do it your way and say so. You are trusted with the creative work on this project.

The door and the credential are in use-data; the choice between this and passage search is in use-vector-memory §2.


1. It is already written — use it

lib/fractera/knowledge.ts: ask, learn, knowledgeDocuments, knowledgeReady.

They go through /service/rag/* — the data service forwards to the engine on the server's loopback. The engine is not published to the internet and its key is injected by the proxy: you never hold it, and a project cloned onto a laptop reaches the same base with no second address and no second port.

2. 🔒 Loading is expensive, asking is cheap — and that is the whole planning problem

learn makes the model read every chunk of the document to extract entities and relations. Once per document, and it is the dominant cost of the whole feature. ask walks the graph that already exists.

Therefore: load what will actually be asked about. Loading "everything we have, just in case" is how this feature becomes expensive without becoming useful. When the owner asks for the whole archive, that is the moment to say the cost out loud — before the run, not in the invoice.

3. 🔒 The graph is built in the background

learn returns as soon as the document is ACCEPTED. Ask a question a second later and the honest answer is "nothing found" — the graph is still being built.

So: never chain "load → ask" in one request and treat the empty answer as a defect. If the product needs to show progress, the engine has a pipeline status of its own (/service/rag/documents/pipeline_status through dataFetch), and knowledgeDocuments lists what it holds.

4. Modes of ask

modeLeans onTake it when
hybrid (default)named things and themesyou do not have a reason to choose another — this is the right default
localspecific entitiesthe question names a thing: a product, a person, a document
globalthemes across the corpusthe question is about the whole: "what do our policies say about…"
naiveplain retrieval, no graphyou want to compare against a baseline, or the graph is empty

The engine also accepts mix and bypass, and many knobs (top_k, rerank, references, streaming) — dataFetch("/service/rag/query", …) reaches them all. Take that path only when the four above are not enough, and say why.

5. The engine is bigger than the helper

Behind /service/rag/* sits a full API — around forty routes: documents (text, texts, upload, scan, paginated listing, status counts, delete, reprocess), the graph itself (labels, entities, relations, create / edit / merge), streaming query, and an ollama-compatible chat surface.

Reach it with dataFetch, not with a new address. Ask /capabilities for the proxy prefix rather than trusting this list — a route list in a document is stale the moment the engine is upgraded.

🔒 Deletion is ASYNCHRONOUS, and 200 is not proof of it. The engine answers deletion_started and does the work in the background: the document is still in the list a moment later, and that is not a failure. Verify by asking for the list again and finding it gone — never by the status code.

🔒 Delete by the document's ID, not by its name. A name is what a person typed; the id is what the engine indexed. Deleting by name looks like it worked — it returns the same cheerful deletion_started and removes nothing. Both facts were bought on 2026-08-23, in a run that reported success twice.

6. "Unavailable" is a normal state, not a failure

ask returns { available: false } when the base is switched off, and that is correct for a project that does not use it. Show the product's own empty state — never invent an answer, and never hide the fact with a cheerful fallback. knowledgeReady answers the question directly when you need it before rendering.

The same applies to an empty graph: a base that was never loaded answers nothing, and that is not a bug to work around.

7. Before you call it done

  1. You chose the graph over vectors for a stated reason (use-vector-memory §2).
  2. What you loaded is what will be asked about — and the owner knows the cost if it is large.
  3. You did not measure the base immediately after loading; you waited for the background build.
  4. The "unavailable" and "found nothing" paths are visible in the product, in the user's language, and are not disguised as an answer.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.