KotaDB
A custom database for distributed human-AI cognition, built entirely by LLM agents.
๐ Quick Start - Choose Your Language
Python
TypeScript/JavaScript
Rust
Go (Coming Soon)
๐ง Work in Progress - Go client is currently under development. See #114 for progress.
# Will be available soon at:
# go get github.com/jayminwest/kota-db/clients/go
โก 60-Second Quick Start
Get from zero to first query in under 60 seconds:
Option 1: Docker (Easiest)
# One command to start everything
# Run Python demo (shows all features)
Option 2: Shell Script (Local Install)
# One-liner installation and demo
|
Option 3: Manual Setup
# Start server
# Install client and try it
๐ That's it! You're now running KotaDB with type-safe client libraries.
KotaDB combines document storage, graph relationships, and semantic search
into a unified system designed for the way humans and AI think together.
Performance
Real-world benchmarks on Apple Silicon:
| Operation | Latency | Throughput |
|---|---|---|
| B+ Tree Search | 489 ยตs | 2,000 queries/sec |
| Trigram Search | <10 ms | 100+ queries/sec |
| Document Insert | 277 ยตs | 3,600 ops/sec |
| Bulk Operations | 20 ms | 50,000 ops/sec |
10,000 document dataset, Apple Silicon M-series
๐ฏ Complete Examples
Production-ready applications demonstrating real-world usage:
๐ Flask Web App
Complete web application with REST API and UI
&& &&
# Visit http://localhost:5000
๐ Note-Taking App
Advanced document management with folders and tags
&& &&
# Visit http://localhost:5001
๐ง RAG Pipeline
AI-powered question answering with document retrieval
&& &&
# Requires OPENAI_API_KEY for best results
โก Quick Examples
# Python type-safe usage
)
)
)
)
)
)
)
# Advanced search with filters
)
)
)
๐ฆ Rust (Full Feature Access)
# Clone and build
&&
# Start server
# CLI operations
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Query Interface โ
โ Natural Language + Structured โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Query Router โ
โ Automatic index selection based on query โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโค
โ Primary โ Full-Text โ Graph โ Semantic โ
โ B+ Tree โ Trigram โ (Planned) โ HNSW โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโค
โ Storage Engine โ
โ Pages + WAL + Compression + Memory Map โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Core Features
Storage
- Native Format: Markdown files with YAML frontmatter
- Git Compatible: Human-readable, diff-friendly
- Crash-Safe: WAL ensures data durability
- Zero Database Dependencies: No external database required
Indexing
- B+ Tree: O(log n) path-based lookups
- Trigram: Fuzzy-tolerant full-text search
- Graph: Relationship traversal (MCP tools only, not fully implemented)
- Vector: Semantic similarity with HNSW
Safety
- Systematic Testing: 6-stage risk reduction methodology
- Type Safety: Validated types (Rust compile-time, Python/TypeScript runtime)
- Observability: Distributed tracing on every operation (Rust only)
- Resilience: Automatic retries with exponential backoff (all client libraries)
Code Examples
Rust (Full Feature Access)
use ;
async
Python (Client Library)
# Connect to KotaDB server
=
# Type-safe document construction (runtime validation)
=
# Query with builder pattern
=
TypeScript (Client Library)
import { KotaDB, DocumentBuilder, QueryBuilder, ValidatedPath } from 'kotadb-client';
// Connect to KotaDB server
const db = new KotaDB({ url: 'http://localhost:8080' });
// Type-safe document construction (runtime validation)
const docId = await db.insertWithBuilder(
new DocumentBuilder()
.path("/knowledge/typescript-patterns.md")
.title("TypeScript Design Patterns")
.content("# TypeScript Patterns\n\n...")
.addTag("typescript")
.addTag("patterns")
);
// Query with builder pattern and full IntelliSense support
const results = await db.queryWithBuilder(
new QueryBuilder()
.text("design patterns")
.limit(10)
.tagFilter("typescript")
);
Query Language
Natural, intuitive queries designed for human-AI interaction:
// Natural language
"meetings about rust programming last week"
// Structured precision
// Graph traversal
GRAPH
Project Status
Complete
- Storage engine with WAL and compression
- B+ tree primary index with persistence
- Trigram full-text search with ranking
- Intelligent query routing
- CLI interface
- Performance benchmarks
In Progress
- Model Context Protocol (MCP) server
- Python/TypeScript client libraries
- Semantic vector search
- Graph relationship queries
Documentation
Architecture โข API Reference โข Development Guide โข Agent Guide
Installation
Client Libraries
Python
TypeScript/JavaScript
# or
Go (Coming Soon)
# Go client is currently under development
# See https://github.com/jayminwest/kota-db/issues/114
# Will be available at: github.com/jayminwest/kota-db/clients/go
Server Installation
As a CLI Tool
# or from source:
As a Rust Library
[]
= "0.3.0"
# or from git:
= { = "https://github.com/jayminwest/kota-db" }
Docker
# Using pre-built image (recommended)
# Or build from source
Language Support Matrix
| Feature | Rust | Python | TypeScript | Go |
|---|---|---|---|---|
| Basic Operations | ||||
| Document CRUD | โ | โ | โ | โ |
| Text Search | โ | โ | โ | โ |
| Semantic Search | โ | โ | โ | โ |
| Hybrid Search | โ | โ | โ | โ |
| Type Safety | ||||
| Validated Types | โ | โ | โ | โ |
| Builder Patterns | โ | โ | โ | โ |
| Advanced Features | ||||
| Query Routing | โ | โ* | โ* | โ* |
| Graph Queries | ๐ง | โ | โ | โ |
| Direct Storage Access | โ | โ | โ | โ |
| Observability/Tracing | โ | โ | โ | โ |
| Development | ||||
| Connection Pooling | โ | โ | โ | โ |
| Retry Logic | โ | โ | โ | โ |
| Error Handling | โ | โ | โ | โ |
Legend: โ Complete โข ๐ง In Progress โข โ Not Available
*Query routing happens automatically on the server for client libraries
Benchmarks Detail
| Operation | Size | Latency | Throughput |
|---|---|---|---|
| BTree Insert | 100 | 15.8 ยตs | 63,300 ops/sec |
| BTree Insert | 1,000 | 325 ยตs | 3,080 ops/sec |
| BTree Insert | 10,000 | 4.77 ms | 210 ops/sec |
| BTree Search | 100 | 2.08 ยตs | 482,000 queries/sec |
| BTree Search | 1,000 | 33.2 ยตs | 30,100 queries/sec |
| BTree Search | 10,000 | 546 ยตs | 1,830 queries/sec |
| Bulk Operations | 1,000 | 25.4 ms | 39,400 ops/sec |
| Bulk Operations | 5,000 | 23.7 ms | 211,000 ops/sec |
Contributing
This project is developed entirely by LLM agents. Human contributions follow the same process:
- Open an issue describing the change
- Agents will review and implement
- Changes are validated through comprehensive testing
- Documentation is automatically updated
See AGENT.md for the agent collaboration protocol.
License
MIT - See LICENSE for details.
Built for KOTA โข Inspired by LevelDB, Tantivy, and FAISS
The best database is the one designed specifically for your problem.