docs.rs failed to build mr-ability-0.6.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
mr-ability
Core ability library for MemRec - provides memory storage, semantic search, project isolation, and other foundational services.
Overview
mr-ability is the heart of the MemRec ecosystem, implementing the core capabilities that enable AI memory persistence across sessions. It provides:
- Multi-layer Storage: RocksDB-based persistent storage with vector, graph, and full-text capabilities
- Semantic Search: Hybrid search combining vector similarity, BM25, and graph traversal
- Memory Compression: Automatic consolidation of old memories through Dream processing
- Project Isolation: Workspace-based memory separation via
.mr_pidfiles - Embedding Generation: Text-to-vector conversion for semantic search
Architecture
mr-ability/
├── storage/ # Multi-layer storage (RocksDB + Tantivy + Vector)
├── search/ # Search algorithms (MMR, scoring)
├── embedding/ # Text embedding generation
├── dream/ # Memory consolidation
├── project/ # Project detection and isolation
├── tiered/ # Tiered search system
├── importance/ # Memory importance evaluation
├── lifecycle/ # Memory lifecycle management
├── facet/ # Faceted search
├── edge/ # Graph edge management
├── propagation/ # Memory propagation
├── archive/ # Memory archiving
└── rule/ # Rule engine
Core Components
Storage Layer
The storage layer provides three dimensions of data persistence:
| Store | Description | Backend |
|---|---|---|
MemoryStore |
Memory CRUD operations | RocksDB |
VectorStore |
Embedding storage & search | RocksDB |
EdgeStore |
Graph edges & traversal | RocksDB |
TantivyStore |
Full-text search | Tantivy |
HybridStore |
Combined vector + BM25 | Vector + Tantivy |
Search System
Supports multiple search strategies:
use ;
// MMR re-ranking for diversity
let hits = mmr_rerank;
Embedding Generation
use ;
let generator = create?;
let embedding = generator.embed?;
Dream Processing
use ;
// Check if Dream should run
let gate = new;
if gate.should_run?
Project Detection
use detect_project_id;
// Automatically detect project from current directory
let project_id = detect_project_id?;
Usage
Add to your Cargo.toml:
[]
= { = "../mr-ability" }
Basic example:
use ;
use Memory;
// Initialize storage
let store = open?;
let memory_store = new;
// Add memory
let memory = new;
let id = memory_store.add?;
// Search memories
let hits = memory_store.search?;
Storage Schema
The storage uses RocksDB column families to organize data:
| Column Family | Content |
|---|---|
memories |
Memory records (JSON) |
vectors |
Embedding vectors (f32 array) |
edges |
Graph edges (source → target) |
facets |
Metadata facets |
rules |
Automation rules |
config |
Configuration KV pairs |
Performance
- Vector Search: ~10ms for 100K vectors (HNSW-like performance)
- Hybrid Search: ~50ms combining vector + BM25 + graph
- Memory Add: ~5ms including embedding generation
- Dream: ~2s for consolidating 10 memories (LLM-dependent)
Dependencies
- RocksDB: Persistent key-value storage
- Tantivy: Full-text search engine
- FastEmbed: ONNX-based embedding inference
- SQLite: Metadata indexing
- Tokio: Async runtime
License
Apache-2.0