The private memory database for AI agents.
Local-first · Temporal · Encrypted · Agent-scoped · Hybrid recall
Repository · Documentation · Security · crates.io · PyPI
BaseMyAI is an embedded Agent Memory Database for AI agents that need memory they can actually trust.
It stores agent memory inside a local encrypted .bmai database and gives agents persistent recall with vector search, temporal validity, memory layers, graph context, adaptive forgetting, and hybrid retrieval.
BaseMyAI is not another hosted vector database.
It is built for private assistants, coding agents, internal copilots, local-first tools, and products that cannot leak user memory to a cloud memory store.
basemyai setup --fetch
export BASEMYAI_DB_KEY="change-me-use-a-real-secret-key"
basemyai init ./agent.bmai
basemyai remember ./agent.bmai \
--agent assistant-42 \
--layer semantic \
"User is on the Pro plan."
basemyai recall ./agent.bmai \
--agent assistant-42 \
"current billing plan" \
--hybrid| Principle | Description |
|---|---|
| Local-first by default | Memory stays on the user's machine. No hosted memory backend by default. |
Encrypted .bmai files |
Agent memory lives in a local encrypted BaseMyAI container. |
| Temporal memory | Facts can expire or be invalidated, so stale memories do not silently win recall. |
| Agent-scoped isolation | Each memory operation is scoped by agent_id to prevent cross-agent leakage. |
| Multi-layer memory | Short-term, episodic, procedural, and semantic memories are treated differently. |
| Hybrid recall | Vector search, BM25, graph context, and RRF fusion work together. |
| Inspectable memory | Developers can inspect, export, import, invalidate, and debug memory behavior. |
| Rust foundation | One engine powers Rust, Python, Node, CLI, MCP, and REST surfaces. |
AI agents usually fail memory in one of three ways:
- They forget everything between sessions.
- They send sensitive memory to a hosted vector database.
- They recall outdated facts as if they were still true.
BaseMyAI fixes that by giving agents a dedicated memory database that is local, encrypted, temporal, and purpose-built for agent workflows.
A vector database can store embeddings.
BaseMyAI stores agent memory.
BaseMyAI separates memory into four layers:
| Layer | Purpose | Typical lifetime |
|---|---|---|
| short_term | Active working context | Short TTL |
| episodic | Events, interactions, what happened and when | Time-bounded |
| procedural | Workflows, steps, habits, learned behaviors | Long-lived |
| semantic | Facts and knowledge | Valid until invalidated |
Every layer supports temporal validity through valid_from and valid_until.
That means an agent can remember that something used to be true without treating it as true forever.
BaseMyAI recall is multi-signal by design.
| Signal | Role |
|---|---|
| Vector search | Finds semantically similar memories. |
| BM25 full-text search | Catches exact terms, IDs, names, filenames, and rare keywords. |
| Graph context | Connects entities and relationships across memories. |
| Temporal filtering | Removes expired or invalidated facts from active recall. |
| RRF fusion | Merges ranking signals without brittle manual weights. |
This makes recall more reliable than cosine similarity alone.
BaseMyAI is built for developers who need memory they can control.
- encrypted local
.bmaifiles - no hosted memory backend by default
- no silent model downloads
- explicit setup for model provisioning
- per-agent memory isolation
- local-first operation
- key supplied by the application or environment
- designed for privacy-sensitive agents and internal tools
See the full security policy:
BaseMyAI is built in Rust and designed for cross-platform local deployment.
The main repository contains:
- Rust workspace
- memory engine
- CLI
- MCP server
- REST sidecar
- Python binding
- Node binding
- architecture decisions
- benchmarks
- security policy
- technical proofs
| Surface | Status | Use case |
|---|---|---|
| Rust crate | Available | Native Rust agents and embedded engines |
| Python SDK | Available | Python agent builders |
| Node SDK | In progress / verify package name | JavaScript and TypeScript agents |
| CLI | Available | Local inspection, scripting, automation |
| MCP server | Available | Claude Code and agent-tool integrations |
| REST sidecar | Available | Local HTTP integration for other languages |
BaseMyAI starts with a reliable libSQL-backed .bmai V1, then moves toward a native BaseMyAI engine while preserving the public memory database contract.
The long-term direction is full ownership over:
- storage
- indexing
- vector search
- graph traversal
- memory events
- future sync primitives
- query language possibilities
The public contract stays simple:
a private memory database for AI agents.
The internal engine can evolve without turning BaseMyAI into a wrapper around someone else's database.
BaseMyAI is being built as serious local AI memory infrastructure.
Useful places to start:
- explore the main repository
- read the architecture decisions
- run the CLI locally
- inspect the benchmark docs
- open issues or discussions
- test SDK and MCP workflows
