devsper-memory
Memory system for the devsper runtime. Provides key-value storage, optional embedding-based semantic search, and a routing layer that picks the right retrieval strategy per query.
Components
| Struct | Role |
|---|---|
LocalMemoryStore |
In-process HashMap-backed store; implements MemoryStore |
MemoryEntry |
Stored value with timestamp and namespace |
EmbeddingIndex |
Cosine-similarity index over stored entries (regex-based for zero-dep local use) |
MemoryRouter |
Picks Exact, Semantic, or Hybrid retrieval strategy |
RetrievalStrategy |
Enum controlling how MemoryRouter.retrieve() searches |
Usage
[]
= "0.1"
use ;
use MemoryStore;
use json;
// Basic key-value
let store = new;
store.store.await?;
let val = store.retrieve.await?;
// Semantic search
let hits = store.search.await?;
for hit in hits
// Router with strategy selection
let router = new;
let results = router.retrieve.await?;
Platform memory (Postgres + pgvector)
When running inside the devsper platform stack, the memory layer is backed by Postgres via Vektori. The LocalMemoryStore is used in standalone / test scenarios.
License
GPL-3.0-or-later — see repository.