Install VEKTOR, connect your agent, and make your first persistent memory call. No infrastructure, no cloud setup, no configuration hell.
# Verify Node version (must be 18+) node --version # Expected: v18.x.x or higher
npm install vektor-memory # Or with yarn: yarn add vektor-memory
VEKTOR_LICENSE in your environment. Get yours at vektormemory.com/#pricing.
createMemory() once at agent startup. Choose your LLM provider and set a unique agentId — this namespaces the memory so multiple agents can share one database without collision.import { createMemory } from 'vektor-memory'; const memory = await createMemory({ provider: 'gemini', // gemini | openai | groq | ollama apiKey: process.env.GEMINI_API_KEY, agentId: 'my-agent', // unique namespace per agent dbPath: './my-agent.db', // SQLite file location }); // memory is now initialised — MAGMA graph ready, AUDN active
| PROVIDER | ENV VAR | NOTES |
|---|---|---|
| gemini | GEMINI_API_KEY | Recommended. Up to 9 keys pooled automatically for rate limit avoidance. FREE TIER |
| openai | OPENAI_API_KEY | GPT-4o, o1, mini all supported. PAID |
| groq | GROQ_API_KEY | Fast inference, generous free tier. FREE TIER |
| ollama | — | Fully local, zero API cost. Air-gapped deployments. FREE |
remember() on every agent turn output. Call recall() at session start to inject context into your system prompt. The AUDN loop handles deduplication and contradiction detection automatically.// Store a memory — AUDN decides: ADD / UPDATE / DELETE / NO-OP await memory.remember("User prefers TypeScript over JavaScript"); await memory.remember("Project deadline is March 15th"); await memory.remember("User updated deadline to March 22nd"); // ↑ AUDN detects contradiction, archives old deadline, stores new one // Recall relevant context for a query const ctx = await memory.recall("coding preferences"); // → [{ id, content, summary, importance, score }, ...] // Inject into your system prompt const systemPrompt = `You are a helpful assistant. Relevant memory context: ${ctx.map(m => m.summary).join('\n')} `;
// Traverse the graph — find 2-hop connections from a concept const graph = await memory.graph("TypeScript", { hops: 2 }); // → nodes + edges 2 hops away from "TypeScript" concept // What changed in the last 7 days? const delta = await memory.delta("architecture decisions", 7); // → memories added, updated, or resolved in past 7 days // Morning briefing — what did the agent learn while idle? const brief = await memory.briefing(); // → human-readable summary of recent memory evolution
# Run manually node rem.js # Or schedule nightly via cron 0 3 * * * cd /your/agent && node rem.js >> logs/rem.log 2>&1
// Or trigger programmatically const stats = await memory.dream(); // → { nodes_archived, summaries_made, edges_added, duration_ms }