How tapiruslab/tapirusdb works
TapirusDB is an embedded multi-model database and AI memory engine. Its main workflow is an application using the Rust API to execute database operations and receive results; SQL operations pass through query processing to execution and persistent page storage, while graph, vector, document, and memory capabilities provide distinct data and retrieval stages. The README documents MCP and remote page streaming; source excerpts were limited, so their internal wiring is not inferred.
Main entry points: lib.rs Rust API · sql/mod.rs SQL Engine · pager/mod.rs Page Storage · executor.rs SQL Executor
Components 19
Application Interfaces
- Rust API
src/lib.rs - CLI and MCP
src/bin/tapirus.rs
SQL Engine
- SQL Lexer
src/sql/lexer.rs - SQL Parser
src/sql/parser.rs - SQL Planner
src/sql/planner.rs - SQL Executor
src/sql/executor.rs - SQL Engine
src/sql/mod.rs
Data Models
- JSON Documents
src/document/mod.rs - Vector Search
src/vector/mod.rs - Property Graph
src/graph/mod.rs - GraphRAG
src/graph/rag.rs - Agent Memory
src/memory/mod.rs - Change Events
src/realtime/mod.rs
Storage and Security
- B+Tree
src/btree/engine.rs - Page Storage
src/pager/mod.rs - Write-Ahead Log
src/pager/wal.rs - Remote Pages
src/pager/remote.rs - Page Encryption
src/crypto/mod.rs
Other components
- Application
Connections 18
- Application → Rust API: calls
- Application → CLI and MCP: invokes
- Rust API → SQL Engine: executes SQL
- SQL Engine → SQL Lexer: tokenizes
- SQL Engine → SQL Parser: parses
- SQL Engine → SQL Planner: plans
- SQL Engine → SQL Executor: executes
- SQL Executor → Page Storage: reads and writes
- Page Storage → B+Tree: stores records
- Page Storage → Write-Ahead Log: appends frames
- Page Storage → Page Encryption: encrypts pages
- Page Storage → Remote Pages: streams ranges
- Rust API → Property Graph: manages graph
- Rust API → Agent Memory: manages memories
- Rust API → Change Events: publishes changes
- JSON Documents → Rust API: uses connection
- Agent Memory → Vector Search: scores vectors
- GraphRAG → Property Graph: traverses graph