Architecture
GNO is a local knowledge indexing and search system built on SQLite.
System Overview
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â User â
â (developer, researcher, writer) â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âââââââââââââââââââŧââââââââââââââââââ
â â â
âŧ âŧ âŧ
ââââââââââââ ââââââââââââââââ âââââââââââââ
â CLI â â MCP Server â â AI Agent â
â (gno) â â (gno mcp) â â (Claude) â
ââââââââââââ ââââââââââââââââ âââââââââââââ
â â â
âââââââââââââââââââŧââââââââââââââââââ
â
âŧ
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â GNO Core â
â ââââââââââââââââ ââââââââââââââ ââââââââââââââââââââââââââ â
â â Ingestion â â Pipeline â â LLM Layer â â
â â (walker, â â (search, â â (embed, rerank, gen) â â
â â chunker) â â fusion) â â (node-llama-cpp) â â
â ââââââââââââââââ ââââââââââââââ ââââââââââââââââââââââââââ â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŧ
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Storage Layer â
â ââââââââââââââââ ââââââââââââââââ ââââââââââââââââââââââââ â
â â SQLite â â FTS5 â â sqlite-vec â â
â â (documents, â â (BM25) â â (vector KNN) â â
â â chunks) â â â â (optional) â â
â ââââââââââââââââ ââââââââââââââââ ââââââââââââââââââââââââ â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŧ
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â File System â
â ~/notes ~/work/docs ~/papers â
â (collections configured by user) â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Data Flow
Ingestion Pipeline
File on disk
â
âŧ Walker (glob patterns, exclude lists)
â
âŧ Hash source content (SHA-256 â sourceHash)
â
ââ[ sourceHash unchanged ]ââē Skip (file not modified)
â
âŧ Converter (MIME detection â Markdown)
â
âŧ Canonicalize (NFC, normalize whitespace)
â
âŧ Hash canonical markdown (â mirrorHash)
â
ââ[ mirrorHash exists ]ââē Reuse content (deduplication)
â
âŧ Chunker (~800 tokens, 15% overlap)
â
âŧ Store (SQLite: documents, content, chunks, FTS)
â
âŧ [Optional] Embed chunks (llama.cpp â vectors)
Search Pipeline
User query
â
âŧ Detect query language (franc, 30+ languages)
â
ââ[ BM25-only mode ]ââē searchBm25 only
â
âŧ BM25 Search (FTS5 full-text)
â
âŧ Embed query (llama.cpp)
â
âŧ Vector Search (sqlite-vec KNN)
â
âŧ [Optional] Query expansion (LLM variants)
â
âŧ RRF Fusion (reciprocal rank, k=60)
â
âŧ [Optional] Rerank (cross-encoder)
â
âŧ Results (sorted by blended score)
Key Components
Storage
| Table | Purpose |
|---|---|
| documents | Source file tracking (path, hash, docid) |
| content | Canonical markdown by mirrorHash |
| content_chunks | Chunked text (800 tokens each) |
| content_fts | FTS5 virtual table for BM25 |
| content_vectors | Embeddings (optional) |
Content Addressing
GNO uses content-addressed storage:
sourceHash= SHA-256 of original file contentmirrorHash= SHA-256 of canonical markdown
Multiple source files with identical canonical content share the same chunks and vectors. This deduplicates storage and speeds up indexing.
LLM Models
All models run locally via node-llama-cpp:
| Model | Purpose | Default |
|---|---|---|
| Embed | Generate vector embeddings | bge-m3-Q4 (1024 dims) |
| Rerank | Cross-encoder scoring | bge-reranker-v2-m3-Q4 |
| Gen | Answer generation | Qwen3-1.7B-Q4 |
Models are GGUF-quantized for efficiency. First use triggers automatic download.
Search Modes
| Mode | Description |
|---|---|
| BM25 | Keyword matching via FTS5 |
| Vector | Semantic similarity via embeddings |
| Hybrid | BM25 + vector with RRF fusion |
| Reranked | Hybrid + cross-encoder reordering |
Graceful Degradation
GNO works with reduced capabilities when components are missing:
| Component | If Missing | Behavior |
|---|---|---|
| sqlite-vec | Extension not loaded | BM25 search only |
| Embed model | Not downloaded | Vector search disabled |
| Rerank model | Not downloaded | Skip reranking |
| Gen model | Not downloaded | --answer disabled |
Run gno doctor to check component status.
File Locations
Linux (XDG standard):
| Location | Purpose |
|âââ-|âââ|
| ~/.config/gno/index.yml | Configuration |
| ~/.local/share/gno/index-default.sqlite | Database |
| ~/.cache/gno/models/ | Model cache |
macOS:
| Location | Purpose |
|âââ-|âââ|
| ~/Library/Application Support/gno/config/index.yml | Configuration |
| ~/Library/Application Support/gno/data/index-default.sqlite | Database |
| ~/Library/Caches/gno/models/ | Model cache |
Run gno doctor to see resolved paths.
Technical Notes
For implementation details, see:
- docs/NOTES.md - Internal architecture notes
- spec/cli.md - CLI specification
- spec/mcp.md - MCP specification