Composable building blocks for adding persistent memory to AI applications.
LLM-powered fact extraction, intelligent deduplication, vector search, and queryable structured memory β all in your existing database.
Note: This project is not actively maintained. I built the initial version as a proof of concept. Since then, I started working on a full product based on the structured memory approach. I'll come back to these packages soon.
pnpm add @youcraft/recall @youcraft/recall-adapter-sqlite \
@youcraft/recall-embeddings-openai @youcraft/recall-extractor-openaiimport { createMemory } from '@youcraft/recall'
import { sqliteAdapter } from '@youcraft/recall-adapter-sqlite'
import { openaiEmbeddings } from '@youcraft/recall-embeddings-openai'
import { openaiExtractor } from '@youcraft/recall-extractor-openai'
const memory = createMemory({
db: sqliteAdapter({ filename: 'memories.db' }),
embeddings: openaiEmbeddings({ apiKey: process.env.OPENAI_API_KEY! }),
extractor: openaiExtractor({ apiKey: process.env.OPENAI_API_KEY! }),
})
// Extract memories from a conversation
await memory.extract(
`User: I'm a software engineer working at Acme Corp.
Assistant: Nice! What kind of projects do you work on?
User: Mostly backend stuff in TypeScript.`,
{ userId: 'user_123' }
)
// Query relevant memories
const memories = await memory.query('What does the user do for work?', {
userId: 'user_123',
limit: 5,
})
// => [{ content: "User is a software engineer at Acme Corp", ... }]Most apps today already have their own infrastructure β background jobs, vector databases, workflow engines, and code to store and retrieve embeddings. Why deploy yet another service just for memory?
Recall takes a different approach: composable building blocks that fit into your existing stack.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Existing Infrastructure β
β βββββββββββββ βββββββββββββ βββββββββββββββββββ β
β β Backgroundβ β Vector β β Database β β
β β Jobs β β Search β β (Postgres/etc) β β
β βββββββ¬ββββββ βββββββ¬ββββββ ββββββββββ¬βββββββββ β
β β β β β
β ββββββββββββββββΌββββββββββββββββββ β
β β β
β βββββββββΌββββββββ β
β β Recall β β just a library β
β βββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Recall is a library you import, not a service you deploy. Pick the pieces you need:
- Choose your database β SQLite for local dev, Postgres for production, MySQL if that's what you have
- Choose your embeddings β OpenAI, Cohere, Voyage, or bring your own
- Choose your extractor β GPT, Claude, or implement the interface
- Use your existing workflows β Inngest, Vercel Workflow DevKit, or any background job system
| Core Memory | Structured Memory | |
|---|---|---|
| Package | @youcraft/recall |
@youcraft/recall-structured |
| Storage | Vector similarity search | SQL tables with schemas |
| Best for | Fuzzy recall, semantic search | Precise queries, analytics |
| Query style | "What does the user like?" | "How much did I spend last month?" |
| Status | Stable | Experimental |
Structured Memory lets you define Zod schemas and query memories with SQL precision β perfect for tracking payments, workouts, medications, or any structured data.
- LLM-powered extraction β Automatically extract facts from conversations
- Intelligent consolidation β Deduplicate memories with ADD/UPDATE/DELETE/NONE decisions
- Vector similarity search β Find relevant memories using embeddings
- Pluggable architecture β Swap databases, embedding providers, and extractors
- TypeScript-first β Full type safety with comprehensive interfaces
- Zero lock-in β All data stays in your infrastructure
When you call extract(), Recall doesn't just blindly insert new memories. It uses a two-step LLM process:
- Extract β LLM identifies facts from the conversation
- Consolidate β For each fact, Recall:
- Searches for similar existing memories
- Asks the LLM to decide:
ADD,UPDATE,DELETE, orNONE - Executes the decision
New fact: "User's name is John Doe"
Existing: [{ id: "abc", content: "User's name is John" }]
LLM Decision: UPDATE (merge into "User's name is John Doe")
This prevents duplicate memories and keeps your memory store clean.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β @youcraft/recall (core) β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββββββ β
β β extract() β β query() β β list/get/update/delete β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββ
β Extractor β β Embeddings β β Database Adapter β
β OpenAI/Anthropicβ β OpenAI/Cohere/ β β SQLite/PostgreSQL/ β
β β β Voyage β β MySQL β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββ
// Extract and store memories from text (with automatic consolidation)
await memory.extract(text, { userId })
// Find relevant memories using vector similarity
await memory.query(context, { userId, limit?, threshold? })
// CRUD operations
await memory.list(userId) // List all memories
await memory.get(id) // Get single memory
await memory.update(id, { content?, metadata? }) // Update memory
await memory.delete(id) // Delete memory
await memory.clear(userId) // Clear all user memories| Package | Description |
|---|---|
@youcraft/recall |
Core memory client with extract, query, and CRUD operations |
@youcraft/recall-structured |
Schema-based structured memory with Zod validation |
@youcraft/recall-client |
Client SDK for hosted Recall API |
| Package | Description |
|---|---|
@youcraft/recall-adapter-sqlite |
SQLite adapter using better-sqlite3 |
@youcraft/recall-adapter-postgresql |
PostgreSQL adapter with pgvector support |
@youcraft/recall-adapter-mysql |
MySQL adapter using mysql2 |
| Package | Description |
|---|---|
@youcraft/recall-embeddings-openai |
OpenAI text-embedding models |
@youcraft/recall-embeddings-cohere |
Cohere embed models |
@youcraft/recall-embeddings-voyage |
Voyage AI embeddings |
| Package | Description |
|---|---|
@youcraft/recall-extractor-openai |
GPT-based fact extraction |
@youcraft/recall-extractor-anthropic |
Claude-based fact extraction |
| Package | Description |
|---|---|
@youcraft/recall-ai-sdk |
Vercel AI SDK integration |
@youcraft/recall-mcp |
MCP tool definitions |
@youcraft/recall-mcp-server |
Standalone MCP server for Claude, Cursor, etc. |
| Example | Description |
|---|---|
with-inngest |
Next.js chatbot with background memory extraction |
with-inngest-structured |
Structured memory with Inngest workflows |
with-wdk |
Vercel Workflow DevKit integration |
with-client |
Using the Recall client SDK |
Visit recall-docs-sand.vercel.app for full documentation:
P.S. docs are generated by AI.
MIT