turbomem
Health Warn
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Fail
- exec() — Shell command execution in docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Embedded memory for TypeScript agents.
turbomem
· Documentation · Site
Embedded agent memory for TypeScript. Local-first by default — PGlite on disk or IndexedDB in the browser. Pluggable to edge and serverless with Upstash Vector or Pinecone. Runs in-process, no separate memory server, no Python sidecar.
Deployment
| Runtime | Storage |
|---|---|
| Node / Bun (local dev) | PGlite (default) or sqlite-vec |
| Browser | PGlite + IndexedDB via turbomem/browser |
| Vercel / serverless / edge | Upstash Vector or Pinecone |
See the Edge guide for serverless setup.
Features
- Embedded runtime: in-process memory with no HTTP hop per call
- Semantic search: LLM fact extraction plus vector embeddings (OpenAI, local WASM, Voyage AI, or Google Gemini)
- PGlite storage: WASM Postgres with pgvector; data stays on disk in your app (default)
- sqlite-vec storage: optional SQLite backend via
better-sqlite3+sqlite-vec - Upstash Vector storage: optional HTTP backend for edge runtimes (Cloudflare Workers, Vercel Edge)
- Pinecone storage: optional HTTP backend for edge runtimes (serverless vector index)
- Scoped by user, agent, or session: multi-tenant friendly out of the box
- Memory deduplication: merge, smart replace, or skip overlapping facts on write (enabled by default)
- Framework adapters: Mastra and Vercel AI SDK integrations ship as separate packages
Install
npm install turbomem
Set OPENAI_API_KEY for the default OpenAI embeddings and fact-extraction stack. PGlite is included, no extra database setup. For the optional sqlite-vec backend: npm install better-sqlite3 sqlite-vec. For edge: npm install @upstash/vector or npm install @pinecone-database/pinecone - see the Edge guide.
Prefer another provider? Embeddings support OpenAI, local (transformers), Voyage AI (VOYAGE_API_KEY), and Google Gemini (GEMINI_API_KEY); fact extraction supports OpenAI, Anthropic, and Google Gemini (plus any OpenAI-compatible endpoint via a custom baseURL). See the Providers reference.
Quick start
import { 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,
});
for (const { memory: m, score } of results) {
console.log(`[${score.toFixed(3)}] ${m.content}`);
}
await memory.close();
When similar facts are added again, turbomem deduplicates by default - merging with an LLM, smart-replacing when the new fact is more specific, or skipping duplicates. Configure via deduplication or disable with { enabled: false }. See Configuration.
Adapters
| Package | Use case |
|---|---|
turbomem |
Core library |
@turbomem/mastra |
Mastra memory provider (remember / recall) |
@turbomem/vercel-ai |
Vercel AI SDK tools for agent-driven memory |
@turbomem/okf |
Open Knowledge Format parser and turbomem bridge (Experimental) |
npm install @turbomem/mastra turbomem
# or
npm install @turbomem/vercel-ai turbomem ai
# or
npm install @turbomem/okf
Links
Full guides, configuration reference, and runnable examples:
Site: https://turbomem.dev
Docs: https://docs.turbomem.dev
Requirements
Node.js 20+ or Bun. TypeScript recommended.
License
Apache License 2.0 see LICENSE for details.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found