# docs-rag: Semantic Search Over Your Docs

> Local semantic search over your markdown docs and ADRs that never returns a superseded decision as current truth.

docs-rag: Semantic Search Over Your Docs is a free AI agent skill on Agensi by Andrea Selmi, in Technical Documentation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Andrea Selmi](https://www.agensi.io/creators/andrea-selmi)
- Category: [Technical Documentation](https://www.agensi.io/skills/technical-documentation)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-19
- Security: scan passed (2026-10-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/docs-rag-semantic-search-over-your-docs
- Tags: documentation, llm-ops, ai-agents, knowledge-base, markdown, adr, local-first, semantic-search

## About this skill

Your agent searches your markdown specs, ADRs and decision logs **by meaning**, fully on your machine, and stops treating dead decisions as current.

This skill pairs with the open-source MCP server [docs-rag-mcp](https://github.com/andreaselmi/docs-rag-mcp) (MIT, on npm) and teaches the agent to use it properly:

- **Setup, step by step.** Ollama + `bge-m3`, per-project scaffold, index, verify. No guessed env vars or config keys.
- **Superseded decisions stay dead.** Docs marked `status: superseded` drop out of default search. When the agent hits one, it follows `superseded_by` to the current doc instead of quoting history as fact.
- **"I don't know" beats a confident guess.** Below the score threshold the tool answers *No relevant results*. The skill makes the agent treat that as an answer: rephrase once, check the code or ask, never invent.
- **Results it can weigh.** Every hit says why it's there: `[semantic 0.71]`, `[both]` or `[exact match]`.
- **Decisions recorded properly.** When a decision changes, the agent writes the new doc, marks the old one superseded, repoints older references and re-indexes.
- **Docs written to be found.** Includes the authoring guide: how heading structure decides what retrieval can find.

### Requirements
- A **local** coding agent with MCP and a terminal: Claude Code, Cursor, GitHub Copilot / VS Code, Codex CLI, Gemini CLI, Windsurf, Cline…
- Node.js ≥ 22.5 and [Ollama](https://ollama.com) running locally.
- **Not for browser-only chat apps** (ChatGPT web, Claude.ai web): they can't run a local MCP server.

### Privacy
Embeddings run through your local Ollama. Nothing leaves your machine at index or query time.

### When you don't need it
For exact symbols in code, grep is faster. With a handful of docs, just read them. This is for long, layered docs where outdated decisions are mixed in with current ones.

## Requires

- Node.js
- Ollama (bge-m3 embedding model)
- docs-rag-mcp (npm, MIT)

## Known limitations

Does not index code symbols; use grep for that. Requires specific YAML frontmatter. Manual re-indexing needed after edits unless using specific hooks.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the docs-rag: Semantic Search Over Your Docs skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill stop my agent from citing outdated decisions?

Docs marked status: superseded or archived are hidden from default search. When one does surface (only on an explicit history search), it carries a [superseded → successor] label and the skill makes the agent follow it to the current doc instead of quoting history as fact. Drafts stay searchable but are labelled [draft], so the agent knows they aren't settled.

### Do I need to format my docs in a special way?

No. Any markdown works, and frontmatter is optional. Clear headings matter most, because search returns individual sections; the included authoring guide explains how. Add status and superseded_by only to docs whose decisions have been replaced.

### Which AI agents does it work with?

Any local coding agent with MCP and a terminal: Claude Code, Cursor, VS Code Copilot, Codex CLI, Gemini CLI, Windsurf, Cline. It does not work in browser-only chats like ChatGPT web or Claude.ai web, which can't run a local MCP server.

### Do my docs leave my machine?

No. Embeddings are computed by your local Ollama and the index is a SQLite file in your project. Nothing is sent anywhere at index time or at query time. The only network access is installing the npm package and pulling the embedding model once.

### What's included, and is it really free?

Yes, free. You get the skill (SKILL.md), a setup guide and the doc-authoring guide. The MCP server itself is the open-source docs-rag-mcp package (MIT, on npm), which the skill installs and teaches your agent to use.

### What happens when the docs don't contain the answer?

Below a similarity threshold the tool answers "No relevant results" instead of returning the closest noise. The skill teaches the agent to treat that as an answer: rephrase once, then check the code or ask you, never invent.

### Can it search my source code too?

It's built for markdown documentation: specs, ADRs, decision logs, notes. For function names, error codes or config keys in code, your agent's grep is faster and needs no index.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
