AI Knowledge Base MCP Server
# AI Knowledge Base
Keep coding agents current with local **hybrid RAG** + **MCP**.
Public demo uses synthetic fixtures; the architecture is the product.

### The problem
AI techniques move weekly. Coding agents that only “know” last quarter’s defaults fall behind. Teams need a **local, citable** knowledge path — retrieve what matters, cite sources, and expose tools agents can call — without shipping a private corpus to the public internet.
### How it works
```mermaid
flowchart LR
F[Fixtures / sources] --> I[Ingest + embed]
I --> D[(LanceDB)]
Q[Query] --> S[Hybrid search]
D --> S
S --> M[CLI / MCP tools]
M --> A[Coding agents]
```
1. Ingest documents (committed fixtures for the public demo).
2. Embed locally (Ollama `nomic-embed-text`).
3. Retrieve with **vector + keyword fusion**, optional cross-encoder.
4. Serve results via CLI and **read-only MCP** tools (`search`, `discover`, `get_context`, `get_status`).
### Key engineering decisions
1. **Hybrid fusion before cross-encoder** — the retrieval spine stays useful if the reranker degrades or is disabled.
2. **Public fixtures / private corpus split** — strangers get a working demo; personal tip libraries stay off this repo.
3. **MCP read-only by default** — mutations stay behind an explicit private profile flag.
### Try it
```bash
uv sync
ollama pull nomic-embed-text
uv run python -m src.ingest --fixtures
uv run python -m src.search "reciprocal rank fusion RRF" --hybrid --db data/lancedb
uv run python -m src.eval
```
MCP wiring, discovery commands, and optional BYO YouTube overlay: [`GETTING_STARTED.md`](GETTING_STARTED.md).
### Stack
| Component | Tool |
|-----------|------|
| Vector + FTS | LanceDB |
| Embeddings | Ollama · `nomic-embed-text` @ 768 |
| Rerank (optional) | MiniLM cross-encoder (degrades to fusion) |
| Agent surface | MCP (public profile = read-only) |
### Deeper docs
- [`docs/PORTFOLIO_VISION.md`](docs/PORTFOLIO_VISION.md) — packaging intent
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — contracts / how
- [`GETTING_STARTED.md`](GETTING_STARTED.md) — operator path
- [`FAQ.md`](FAQ.md) — Technical FAQ
- [`docs/2026-07-12_ce_keep_note.md`](docs/2026-07-12_ce_keep_note.md) — cross-encoder keep note
- [`LICENSE`](LICENSE) — PolyForm Noncommercial 1.0.0 (source-available / non-commercial)
Building agent knowledge systems? Reach me on [LinkedIn](https://www.linkedin.com/in/tchacko1/).
TDQS
Scored across 4 tools
Each tool has a distinct purpose: discover for exploration, search for query-based retrieval, get_context for comprehensive context, and get_status for system health. However, get_context and search may cause slight confusion as both involve retrieval.
Tool names are verbs but mix single-word (discover, search) and verb_noun patterns (get_context, get_status). This inconsistency could be improved by normalizing to a single pattern.
Four tools is a minimal but reasonable set for a knowledge base query interface. It covers core functions without bloat, though it could be expanded slightly for more granularity.
The toolset focuses on reading and exploration but lacks write operations (e.g., add, update, delete content). This may hinder agents needing to modify the knowledge base.