In-Memory Store
Ephemeral memory store for development and testing.
Usage
import { InMemoryMemoryStore } from '@ahzan-agentforge/core';
const store = new InMemoryMemoryStore();
// or with options:
const store = new InMemoryMemoryStore({ maxEntries: 1000 });InMemoryMemoryStoreOptions
interface InMemoryMemoryStoreOptions {
maxEntries?: number; // Max stored memories (oldest evicted)
}Direct Store Operations
// Store a memory
await store.add({
content: 'Customer prefers email',
metadata: { type: 'preference' },
namespace: 'customer_123',
});
// Search memories
const results = await store.search({
query: 'communication preference',
namespace: 'customer_123',
limit: 5,
});
// results: MemorySearchResult[]Limitations
- Memories are lost on process restart
- Search is basic text matching (no vector similarity)
- Not suitable for production with large memory sets
Use PgVector for production memory with semantic search.