Skip to main content

Crate mentisdb

Crate mentisdb 

Source
Expand description

Semantic, hash-chained memory for long-running agents.

mentisdb provides an append-only, adapter-backed memory log for durable, queryable cognitive state. Thoughts are timestamped, hash-chained, typed, optionally connected to prior thoughts, and exportable as prompts or Markdown memory snapshots. The current default backend is binary, but the chain model is intentionally independent from any single storage format.

Modules§

cli
Shared CLI helpers for mentisdbd setup and wizard subcommands.
integrations
Host-agent integration models for MentisDB setup, detection, and writes.
paths
Cross-platform path resolution helpers for MentisDB and host integrations.
search
Search-specific derived state and ranking helpers.
server
HTTP servers for exposing MentisDB as MCP and REST services.

Structs§

AgentPublicKey
Public verification key associated with an agent identity.
AgentRecord
Registry entry describing one durable agent identity.
AgentRegistry
Per-chain registry of the agents that have written thoughts.
BinaryStorageAdapter
Append-only binary storage adapter for MentisDb.
JsonlStorageAdapter
Append-only JSONL storage adapter for MentisDb.
MentisDb
Append-only, hash-chained semantic memory store.
MentisDbMigrationReport
Summary of a successful chain migration.
MentisDbRegistration
Metadata describing one registered thought chain.
MentisDbRegistry
Registry of all known thought chains in one storage directory.
RankedSearchGraph
Graph-expansion configuration for ranked search.
RankedSearchHit
One ranked-search hit.
RankedSearchQuery
Request for ranked retrieval over committed thoughts.
RankedSearchResult
Ranked-search response over committed thoughts.
RankedSearchScore
Score breakdown for one ranked-search hit.
SkillDocument
Structured representation of a parsed skill file.
SkillEntry
One skill entry containing immutable uploaded versions plus lifecycle status.
SkillQuery
Query parameters for SkillRegistry::search_skills.
SkillRegistry
Durable, append-only skill registry backed by a versioned binary storage file.
SkillRegistryManifest
Machine-readable description of the skill-registry schema and searchable fields.
SkillRegistryMigrationReport
Report produced by a skill registry migration pass.
SkillSection
One heading-delimited section of a structured skill document.
SkillSummary
Lightweight searchable summary of one stored skill.
SkillUpload
Upload request for one new immutable skill version.
SkillVersion
One immutable uploaded skill version.
SkillVersionSummary
Lightweight summary of one immutable skill version.
Thought
A single durable thought record.
ThoughtInput
Builder-like input struct used to append rich thoughts.
ThoughtQuery
Retrieval filter for semantic memory queries.
ThoughtRelation
Typed edge in the thought graph.
ThoughtTimeWindow
Numeric time window used to derive inclusive since/until bounds.
ThoughtTraversalCursor
Stable cursor for continuing append-order traversal.
ThoughtTraversalPage
One page of append-order traversal results.
ThoughtTraversalRequest
Request for append-order traversal over committed thoughts.
VectorSearchHit
One vector-search hit.
VectorSearchQuery
Request for vector similarity retrieval over committed thoughts.
VectorSearchResult
Vector-search response over committed thoughts.

Enums§

AgentStatus
Current status of an agent record in the registry.
MentisDbMigrationEvent
Progress notifications emitted during migration.
PublicKeyAlgorithm
Supported public-key algorithms for agent identity records.
RankedSearchBackend
Ranking backend used to order ranked-search results.
SkillFormat
Supported import and export formats for skill documents.
SkillStatus
Lifecycle state of a stored skill entry.
SkillVersionContent
The stored content form for a single skill version.
StorageAdapterKind
Supported durable storage formats for MentisDb.
ThoughtRelationKind
Why a thought points to another thought.
ThoughtRole
Operational role of a thought inside the system.
ThoughtTraversalAnchor
Stable locator for one committed thought.
ThoughtTraversalDirection
Direction for append-order thought traversal.
ThoughtType
Semantic category describing what changed in the agent’s internal model.
TimeWindowUnit
Unit for numeric time-window traversal filters.
VectorSearchError
Failure while rebuilding or querying a vector sidecar.

Constants§

FLUSH_THRESHOLD
Number of deferred appends before the write buffer is flushed to disk.
MENTISDB_CURRENT_VERSION
Alias for the latest supported MentisDb storage schema version.
MENTISDB_SCHEMA_V0
Legacy MentisDb storage schema version.
MENTISDB_SCHEMA_V1
First registry-backed MentisDb storage schema version.
MENTISDB_SCHEMA_V2
Schema version 2: adds ThoughtType::Reframe, ThoughtRelationKind::Supersedes, and optional cross-chain ThoughtRelation::chain_key.
MENTISDB_SKILL_CURRENT_SCHEMA_VERSION
Alias for the current structured skill schema version.
MENTISDB_SKILL_REGISTRY_CURRENT_VERSION
Alias for the current persisted skill registry file version.
MENTISDB_SKILL_REGISTRY_V1
First supported version of the persisted skill registry file.
MENTISDB_SKILL_REGISTRY_V2
Second version of the persisted skill registry file — introduces delta/diff content storage and optional signing.

Traits§

StorageAdapter
Persistence interface for MentisDb storage backends.

Functions§

chain_filename
Stable filename derived from a chain key rather than mutable agent profile data.
chain_key_from_storage_filename
Recover the stable chain key portion from a MentisDb storage filename.
chain_storage_filename
Stable filename derived from a chain key and storage adapter kind.
deregister_chain
Remove a chain from the registry and delete its storage file from disk.
export_skill
Export a structured SkillDocument through the requested adapter.
import_skill
Import a skill file through the requested adapter into the structured SkillDocument model.
load_registered_chains
Load the registry of all known thought chains for a storage directory.
migrate_registered_chains
Migrate all legacy v0 chain files in a storage directory to the current format.
migrate_registered_chains_with_adapter
Migrate all legacy v0 chain files in a storage directory to the current format and target storage adapter.
migrate_skill_registry
Migrates the skill registry file at chain_dir from V1 to the current V2 format, if needed.
refresh_registered_chain_counts
Refresh stale thought_count and agent_count values in the on-disk registry by opening each registered chain and reading live counts.
signable_thought_payload
Render the deterministic signable payload for a proposed thought append.