# Knowledge Graph & RAG OX indexes your vault into a searchable knowledge graph with hybrid retrieval — BM25 full-text search combined with vector similarity — so both exact terms and semantic meaning rank together. ## Hybrid search - **BM25 full-text** via Bleve for precise keyword matching. - **Vector similarity** via Ollama embeddings (default model: `nomic-embed-text`) for semantic recall. - Results from both are merged and ranked. ``` $ ox index Indexing vault at ~/ox/o/o/... Parsed 847 notes, 2,341 links, 892 tags Generated 847 embeddings (nomic-embed-text) Graph: 1,739 nodes, 3,233 edges Index time: 12.4s (incremental: 0.8s) $ ox search "auth migration decision" 0.94 o/when/days/2026.March.16.Monday.md "discussed auth migration with Alice..." 0.87 o/what/orgs/COM/iwl/maxre/auth-decisions.md "JWT refresh token rotation strategy..." 0.81 x/code/.../crm-api/CLAUDE.md "Auth middleware uses Supabase JWT..." Results: 3 (0.04s) ``` ## The graph A SQLite knowledge graph stores **nodes** (notes, tags) and **edges** (`LINKS_TO`, `HAS_TAG`). Wikilinks between notes and tags become traversable relationships, so you can ask not just "what matches" but "what's related." ## Pluggable backends OX is built around clean interfaces — `GraphStore`, `VectorStore`, `TextSearchStore`, and `Embedder` — so the storage and retrieval stack is swappable. - **Default stack:** SQLite + Bleve + Ollama (zero cloud dependencies, runs fully local). - **Planned backends:** Neo4j, Qdrant, Pinecone, and OpenAI embeddings. ## Incremental & safe - **Incremental indexing** with SHA-256 change detection — only re-index what changed (`ox index` re-runs in well under a second on an unchanged vault; use `--full` to force). - **Read-only search mode** — no file-lock conflicts with your editor. - **No embeddings needed?** `ox index --no-embed` skips Ollama and runs text-only. ## Next steps - [Code Indexing](https://iamox.ai/docs/code-indexing.md) — index repos alongside notes - [MCP Server](https://iamox.ai/docs/mcp-server.md) — expose search to AI agents - [CLI Reference](https://iamox.ai/docs/cli.md#ox-index)