Documentation Index
Fetch the complete documentation index at: https://mintlify.com/S1LV4/th0th/llms.txt
Use this file to discover all available pages before exploring further.
What is th0th?
th0th is an infrastructure tool that brings semantic code search and intelligent context compression to AI assistants. Named after the ancient Egyptian god of knowledge, th0th helps AI systems understand and navigate codebases with unprecedented efficiency.th0th achieves 98% token reduction through semantic compression while preserving code structure and meaning.
Why th0th?
Modern AI assistants face a critical challenge: context window limitations. When working with large codebases, you need to provide relevant context without overwhelming the AI with excessive tokens. th0th solves this through:Semantic Search
Hybrid vector + keyword search with RRF ranking finds the exact code you need
Smart Compression
Rule-based compression keeps code structure while removing unnecessary details
Persistent Memory
SQLite-based storage remembers important context across sessions
Zero Cost
100% offline operation with Ollama - no API costs
Key Features
Hybrid Search Engine
th0th combines semantic understanding with traditional keyword search:- Vector embeddings for semantic similarity
- Keyword search for exact matches
- RRF (Reciprocal Rank Fusion) ranking for optimal results
- Multi-level caching for instant responses
Context Compression
Reduce tokens by 70-98% without losing critical information:- Code structure extraction - preserves signatures, removes implementation
- Semantic deduplication - removes redundant content
- Hierarchical compression - keeps important details, summarizes the rest
Persistent Memory System
Store and recall information across AI sessions:- Hierarchical organization by user, project, session, and agent
- Semantic search through memories
- Importance scoring for prioritization
- Type-based filtering (preferences, decisions, patterns, code)
Architecture Overview
th0th is built as a monorepo with three main components:Component Breakdown
How It Works
Use Cases
Code Discovery
Find relevant code across large codebases using natural language:- “Where is authentication handled?”
- “Show me database migration logic”
- “Find API route handlers”
Context Optimization
Provide AI assistants with precise context while minimizing tokens:- Compress large files to their essential structure
- Filter search results to specific patterns
- Combine search + compression in one call
Session Continuity
Maintain context across multiple AI sessions:- Remember user preferences and coding style
- Recall architectural decisions
- Track important patterns and conventions
Embedding Providers
th0th supports multiple embedding providers to fit your needs:| Provider | Model | Cost | Quality |
|---|---|---|---|
| Ollama (default) | nomic-embed-text, bge-m3 | Free | Good |
| Mistral | mistral-embed, codestral-embed | $$ | Great |
| OpenAI | text-embedding-3-small | $$ | Great |
The default Ollama setup is 100% offline with zero API costs.
Available Tools
th0th exposes 8 core tools through the MCP interface:| Tool | Description |
|---|---|
th0th_index | Index a project directory for semantic search |
th0th_index_status | Check background indexing job progress |
th0th_search | Semantic + keyword search with filters |
th0th_remember | Store important information in persistent memory |
th0th_recall | Search stored memories from previous sessions |
th0th_compress | Compress context (keeps structure, removes details) |
th0th_optimized_context | Search + compress in one call (max efficiency) |
th0th_analytics | Usage patterns, cache performance, metrics |
Next Steps
Quickstart
Get th0th running in under 5 minutes
Installation
Detailed installation instructions for all platforms
OpenCode Integration
Connect th0th to your AI assistant
REST API
Explore the HTTP API endpoints