Expand description
Memvid-backed persistent memory for Rig.
See the crate-level README for a quick-start. The two main types are:
MemvidStore— implementsrig::vector_store::VectorStoreIndex. Wire it into an agent withagent.dynamic_context(n, store.clone()).MemvidPersistHook— implementsrig::agent::PromptHook. Attach withprompt.with_hook(hook)to record every turn into the same store.
Sharing a single MemvidStore between recall and persistence is the
intended pattern: writes through the hook are visible to subsequent
searches in the same process.
§Re-exports
memvid_core is re-exported so callers do not need to add it as a
direct dependency to construct memvid_core::PutOptions,
memvid_core::AclContext, or memvid_core::SearchRequest when
reaching for MemvidStore::search / MemvidStore::put_text.
§Platform support
The crate is cfg-gated off on wasm: memvid relies on synchronous
file I/O and a process-level file lock that have no analogue under
wasm32-unknown-unknown. On wasm targets the crate is intentionally
empty so that downstream crates can still depend on it transitively
without a build break.
Re-exports§
pub use inmem::InMemoryError;pub use memvid_core;
Modules§
- inmem
- Compatibility re-exports for the backend-agnostic in-memory reference store.
Structs§
- CardDoc
- Wire-format for a single card as projected into agent context.
- Follow
Result - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. Result fromfollow()traversal. - InMemory
Hit - A retrieval hit returned by
InMemoryStore::retrieve_similar. - InMemory
Store - Append-only in-memory episode store with deterministic lexical retrieval.
- Logic
Mesh Stats - Statistics about the logic mesh.
- Memory
Card - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. A structured memory unit extracted from conversation content. - Memory
Card Context - A
VectorStoreIndexthat returns formattedMemoryCards instead of frame text. Generic over anyMemoryGraphbackend; defaults toMemvidStoreso the common call siteMemoryCardContext::new(store, _)continues to work without naming the type parameter. - Memory
Config - Configuration for
MemvidPersistHook. - Memory
Config Builder - Fluent builder for
MemoryConfig. - Memvid
Filter - A filter clause supported by
MemvidStore. - Memvid
Persist Hook - Hook that records every user prompt and assistant response into a
MemvidStore. - Memvid
Store - A persistent, file-backed vector / lexical index over a memvid
.mv2archive. - Memvid
Store Builder - Builder for
MemvidStore. - Mesh
Edge - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. A directed edge in the logic mesh representing a relationship. - Mesh
Node - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. A node in the logic mesh representing an entity. - Search
HitEntity - Entity reference in search hit metadata.
Enums§
- Card
Selection - Strategy for choosing which memory cards to surface as context.
- Entity
Kind - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. Entity classification. - Memory
Kind - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. The kind of memory being stored. - Memvid
Error - Errors produced by
rig-memvid. - Polarity
- Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. Polarity for preferences and boolean facts. - Version
Relation - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. How this card relates to prior versions of the same slot. - Write
Failure - What the
MemvidPersistHookdoes when a frame fails to write. - Write
Failure Action - Decision returned by a
WriteFailure::Customcallback. - Write
Failure Phase - Which stage of frame persistence raised the error.
- Write
Policy - Strategy for what to write into the memvid archive on each turn.
Traits§
- Episode
- User-defined episode payload with a searchable natural-language summary.
- Memory
Graph - Read-side abstraction over a structured-memory store.
Type Aliases§
- Memory
Card Id - Re-exports of the memvid-core memory-card surface that
MemvidStorereturns fromMemvidStore::entity_memoriesand friends. Re-exported here so callers do not need a directmemvid-coredependency just to name the structured-memory types. Unique identifier for a memory card within an MV2 file. - Write
Transform - A function that decides what (if anything) to persist for a single
message. Returning
Noneskips the message.