Skip to main content

Crate velesdb_memory

Crate velesdb_memory 

Source
Expand description

§VelesDB-memory

Local-first memory layer for AI agents, exposed through a single MCP server. This crate is the domain core: it maps five memory operations onto VelesDB’s in-core Agent Memory SDK.

OperationMeaning
rememberstore a fact (+ optional links to other memories)
recallsemantic retrieval of similar facts
relatecreate a typed edge between two memories
forgetdelete a memory
whyrecall + multi-hop graph traversal

§License boundary (non-negotiable)

This crate exposes memory semantics only (results), never raw database capabilities (query(velesql), create_collection, upsert(vectors), traverse(graph)). Exposing the raw engine would constitute a “Substantial Set” of the Software’s features and breach the VelesDB Core License 1.0 (§1, No Hosted or Managed Service). See VISION.md §5 and PLAN.md Phase 4A.

Re-exports§

pub use embedder::DynEmbedder;
pub use embedder::EmbedError;
pub use embedder::Embedder;
pub use embedder::HashEmbedder;
pub use error::ErrorCategory;
pub use error::MemoryError;
pub use extract::DynExtractor;
pub use extract::ExtractError;
pub use extract::ExtractedFact;
pub use extract::Extractor;
pub use mcp::McpServer;
pub use model::ColumnFilter;
pub use model::ColumnOp;
pub use model::Explanation;
pub use model::MemoryEdge;
pub use model::MemoryNode;
pub use model::Recollection;
pub use service::MemoryService;
pub use service::Metadata;

Modules§

embedder
Pluggable text → vector embedding.
error
Error type for the memory layer.
extract
Optional text → facts + entities extraction, the layer that makes the graph self-build.
limits
Resource caps (DoS limits) shared by every adapter — the single source of truth for fact size, recall limit, and why hop depth. Resource caps shared by every adapter (the MCP server and the language bindings).
mcp
The MCP server transport. Gated behind the default mcp feature so library consumers (e.g. the language bindings) can depend on the memory core without pulling the rmcp/tokio server stack. MCP transport: exposes the memory service as MCP tools over stdio.
model
The domain data model — the value types the memory layer exchanges (Link, Recollection, ColumnFilter, Explanation, …), separate from the service that computes them. Domain data model: the request/response value types of the memory layer.
service
The memory service: five operations over the in-core Agent Memory SDK.

Constants§

DEFAULT_DIMENSION
Default embedding dimension — the single source of truth, taken from the SDK’s own default so the server, library, and tests never restate the value.