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.
Search Endpoints
Search Project
POST /api/v1/search/project
Description: Contextual search using hybrid vector + keyword search with RRF ranking.
Request Body
Search query (natural language or keywords)
Project ID to search in
Project path for auto-reindex if needed
Maximum number of results to return
Minimum relevance score (0-1)
Response format:
summary or fullAutomatically reindex if project is stale
Glob patterns to include (e.g.,
["*.ts", "*.tsx"])Glob patterns to exclude (e.g.,
["node_modules/**"])Include score explanations in response
Response
Indicates if the search was successful
Search results data
Search Code
Endpoint:POST /api/v1/search/code
Description: Semantic code search (alias for search/project).
Request Body
Code search query
Project ID to search in
Maximum results to return
Memory Endpoints
Store Memory
Endpoint:POST /api/v1/memory/store
Description: Store a new memory in the hierarchical memory system (local SQLite).
Request Body
Content to store in memory
Type of memory:
preference, conversation, code, decision, or patternUser identifier for scoping memory
Project identifier for scoping memory
Session identifier for scoping memory
Agent identifier for scoping memory
Tags for categorizing the memory
Importance score (0-1)
Output format:
json or toonResponse
Indicates if the memory was stored successfully
Stored memory details
Search Memories
Endpoint:POST /api/v1/memory/search
Description: Search stored memories using semantic search across sessions.
Request Body
Search query (what to remember)
Filter by user ID
Filter by project ID
Filter by session ID
Filter by agent ID
Filter by memory types (e.g.,
["preference", "decision"])Maximum results to return
Minimum importance score (0-1)
Include persistent memories
Output format:
json or toonList Memories
Endpoint:POST /api/v1/memory/list
Description: List stored memories with optional filters (no semantic search, ordered by creation date).
Request Body
Filter by memory type:
preference, conversation, code, decision, or patternMaximum number of memories to return
Offset for pagination
Minimum importance score (0-1)
Response
Indicates if the list operation was successful
List results
Project Endpoints
Index Project
Endpoint:POST /api/v1/project/index
Description: Start indexing a project directory in background. Returns a jobId immediately.
Request Body
Absolute path to the project directory to index
Unique identifier for the project (defaults to directory name)
Force reindexing even if project is already indexed
Pre-cache common queries after indexing completes
Custom queries to pre-cache (e.g.,
["authentication", "API routes"])Response
Indicates if the indexing job was started
Job information
Get Index Status
Endpoint:GET /api/v1/project/index/status/:jobId
Description: Get the status and progress of an async indexing job.
URL Parameters
Job ID returned by
POST /project/indexResponse
Indicates if the status check was successful
Job status details
List Projects
Endpoint:GET /api/v1/project/list
Description: List all indexed projects with document counts and metadata.
Response
Indicates if the list operation was successful
Projects list
Context Endpoints
Compress Context
Endpoint:POST /api/v1/context/compress
Description: Compress context using semantic compression (keeps structure, removes details).
Request Body
Content to compress
Compression strategy:
code_structure- Extract function signatures, types, exportsconversation_summary- Summarize conversation historysemantic_dedup- Remove semantically duplicate contenthierarchical- Multi-level compression
Target compression ratio (0-1). Lower = more aggressive compression
Programming language for code compression (e.g.,
typescript, python, javascript)Response
Indicates if compression was successful
Compression results
Get Optimized Context
Endpoint:POST /api/v1/context/optimized
Description: Retrieve and compress context with maximum token efficiency (search + compress in one call).
Request Body
Search query to find relevant context
Project ID for code context
Project path for auto-reindex if needed
Maximum tokens in returned context
Maximum search results to include before compression
Response
Indicates if context optimization was successful
Optimized context
Analytics Endpoints
Get Analytics
Endpoint:POST /api/v1/analytics
Description: Get search analytics and performance metrics.
Request Body
Type of analytics:
summary- Overall usage summaryproject- Project-specific statisticsquery- Query performance analysiscache- Cache hit rates and performancerecent- Recent search activity
Required when
type is projectRequired when
type is queryMaximum results for
recent typeResponse
Indicates if analytics retrieval was successful
Analytics data (structure varies by type)
System Endpoints
Health Check
Endpoint:GET /health
Description: Simple health check endpoint.
Response
System Information
Endpoint:GET /api/v1/system/info
Description: Get detailed system and environment information.
Response
API version
Service name
Node.js version
Operating system platform
CPU architecture
Process uptime in seconds
Memory usage statistics
Data directory path
Database sizes and total storage
System Status
Endpoint:GET /api/v1/system/status
Description: Check health status of all services.
Response
System Metrics
Endpoint:GET /api/v1/system/metrics
Description: Get aggregated metrics and performance data.
Local-First Health Check
Endpoint:GET /api/v1/system/health/local
Description: Comprehensive health check of all local services (Ollama, SQLite databases, data directory).
Response
Overall health status:
healthy, degraded, or unhealthyIndividual service health checks
Actionable recommendations for any detected issues
Ollama Status
Endpoint:GET /api/v1/system/ollama
Description: Check Ollama availability, list installed models, and verify embedding model configuration.
Response
Ollama service status:
healthy or unavailableList of installed embedding models
Currently configured embedding model
Ollama base URL
Response latency in milliseconds
Error Responses
All endpoints return errors in a consistent format:Common Errors
Project Not Indexed
Project Not Indexed
Error:
Project 'xyz' not found. Please index it first.Solution: Index the project using POST /api/v1/project/index before searching.Ollama Not Available
Ollama Not Available
Error:
Ollama service is not availableSolution: Ensure Ollama is running (ollama serve) and the embedding model is installed.Invalid Parameters
Invalid Parameters
Error:
Validation error: [field] is requiredSolution: Check that all required parameters are provided in the request body.Database Error
Database Error
Error:
Database operation failedSolution: Check that the data directory exists and has proper permissions.Rate Limiting & Quotas
No rate limiting or quotas are enforced in the default local-first deployment. Configure limits via middleware for production use.
WebSocket Support
WebSocket support for real-time indexing progress is planned for a future release. Use polling with
GET /project/index/status/:jobId for now.Next Steps
REST API Overview
Learn about authentication and response formats
MCP Tools
Use th0th via Model Context Protocol
Integration Guides
Integrate with OpenCode, VSCode, or Docker
Configuration
Configure embedding providers and advanced settings