Fully embedded
Runs inside your Node, Bun, or browser process. No sidecar server, no HTTP hop per memory call.
No Python. No servers. Just npm install.
Many agent-memory setups rely on a separate service, a Python server, hosted platform, or self-managed vector DB. For TypeScript apps that means another process, extra infra, and an HTTP hop on every memory call. turbomem runs entirely in-process as a library you npm install.
| turbomem (embedded) | Server-based memory | |
|---|---|---|
| Runtime | TypeScript, in-process | Separate server / hosted API |
| Deployment | npm install | Run or host a service |
| Network hop | None (local) | HTTP per call |
| Storage | PGlite (disk or IndexedDB) | External vector store |
| Best for | TS apps, browser, edge, in-product embed | Multi-language or managed infra |
If you need a cross-language managed platform, a dedicated memory service may fit better. If you're shipping a TypeScript app and want memory as a library, that's turbomem.
messages → Extractor (LLM) → facts → Embeddings → vectors → PGlite
query → Embeddings → vector search (scoped) → ranked resultsadd(messages, scope): extracts discrete facts from conversation, embeds them, and stores each fact with its vector and scope.addFacts(facts, scope): store explicit fact strings directly, skipping LLM extraction.search(query, scope): embeds the query and returns the closest matching facts, filtered by scope.getAll(scope): list every memory in a scope (newest first). The CLI exposes this as turbomem list.delete(id) / deleteAll(scope): remove one memory or wipe a scope.userId, agentId, and sessionId for multi-tenant isolation.See Architecture for the pipeline and API reference for the full method list.
@turbomem/mastra or @turbomem/vercel-ai when you already use those stacksimport { TurboMemory } from "turbomem";
const memory = new TurboMemory({
embeddings: "openai",
storage: "pglite",
extraction: { provider: "openai", model: "gpt-4.1-mini" },
openai: { apiKey: process.env.OPENAI_API_KEY },
});
await memory.init();
await memory.add(
[{ role: "user", content: "I love hiking and I'm training for a half marathon this fall." }],
{ userId: "user_123" },
);
const results = await memory.search("What outdoor activities is the user into?", {
userId: "user_123",
limit: 5,
});
console.log(results.map((r) => r.memory.content));
await memory.close();Questions, feedback, or want to report an issue? See the Contact page or email arneesh@turbomem.dev.