Developer Documentation

Overview

MentisDB is a standalone Rust crate available on crates.io. Add it to your project:

mentisdb = "0.4"

The crate provides the full memory engine, skill registry, storage adapter interface, agent registry, and optional HTTP server (MCP + REST) behind the ssr feature flag.

Full API Reference

The complete, generated API documentation is hosted on docs.rs:

docs.rs/mentisdb

Full rustdoc for all public types, traits, functions, and modules. Includes MentisDb, ThoughtChain, StorageAdapter, SkillRegistry, BinaryStorageAdapter, JsonlStorageAdapter, and the HTTP server.

View on docs.rs →

MCP Server

MentisDB ships a built-in MCP (Model Context Protocol) HTTP server. Enable it with the ssr feature. The server exposes all MentisDB operations as MCP tools, making it compatible with any MCP-capable AI tool.

Default endpoint: http://127.0.0.1:9471

The daemon binary (mentisdbd) starts the server automatically. For embedding in your own Axum app, see the docs.rs API reference for server module details.

REST API

The same daemon also serves a REST API alongside MCP. Key endpoints:

MethodPathDescription
POST/thoughtsAppend a new thought to a chain
GET/thoughtsSearch/query thoughts
GET/chainsList available chain keys
GET/agentsList agents in registry
POST/skillsUpload a skill version
GET/skills/{id}Read a skill (latest or specific version)

Storage Adapters

MentisDB separates the memory model from the storage backend via the StorageAdapter trait:

  • BinaryStorageAdapter — Default. Compact binary format with write buffering. Best for production.
  • JsonlStorageAdapter — Line-oriented JSON. Human-readable, inspectable with standard tools. Good for debugging.

Implement the StorageAdapter trait to plug in your own backend (S3, SQLite, etc.). See docs.rs for the trait definition.

Contributing

MentisDB is open source under the MIT license.

git clone https://github.com/cloudllm-ai/mentisdb

Run the test suite:

cargo test

Run benchmarks:

make bench
View on GitHub →