How-to guides
Search & ask your library
Turn your stored documents into answers — semantic search for passages, or cited answers across everything.
Storing documents is only half the value. The other half is pulling the right detail back out, exactly when your agent needs it — so it works from your real specs instead of guessing.
There are two retrieval tools, and they answer different questions.
search_documents — find the passages
Semantic search across your whole library. It returns the most relevant chunks with similarity scores, so the agent can read the source itself.
Search my LLMtoMD docs for how we handle webhook retries.
Use it when you want the agent to locate and read the source material — for example before writing code against a spec.
Scope it to narrow the search:
- One document: "Search the API spec for rate-limit headers."
- One project: "Search my 'Billing' project for the dunning flow."
You can ask for more results when a topic is spread out: "search my docs, top 15 passages."
(That maps to k, max 20.)
ask_documents — get a cited answer
Retrieval-augmented answering: it finds the relevant passages and returns a synthesized answer with its sources.
According to my stored spec, what status code should a duplicate upload return?
What does our design doc say about idempotency keys?
Use it when you want the answer, not the raw passages. Because it cites sources, you can verify where each claim came from.
Search vs. ask — which to use
| You want… | Use | Returns |
|---|---|---|
| To find and read the source | search_documents | Ranked passages + scores |
| A direct answer with citations | ask_documents | A synthesized, cited answer |
Why this matters for building software
Treat your stored requirements, specs, and API references as authoritative project memory. A good pattern when working with your agent:
Before you implement this, check my LLMtoMD docs for the exact requirements.
The agent runs ask_documents against your spec and builds to it — rather than relying on
its memory of an earlier turn, which may have been summarized away.
Related
- Organize with collections — scope retrieval to a project.
- Tools reference — all retrieval commands.