
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
🧠 Plug & Play Memory for Your AI Apps
Add intelligent, persistent memory to any AI application with just one line of code. Works with any AI model - OpenAI, Anthropic, Claude, Gemini, or any other provider!
recall(result) after any AI interactionnpm install recallkit-sdk ai
# Plus your preferred AI provider:
npm install @ai-sdk/openai # for OpenAI
npm install @ai-sdk/anthropic # for Anthropic
npm install @ai-sdk/google # for Google
Required:
Optional:
import { RecallClient } from "recallkit-sdk";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai"; // or any provider you prefer
// RecallKit setup - uses Gemini internally for memory processing
const recall = new RecallClient({
geminiApiKey: "your_gemini_api_key_here", // For RecallKit's internal use
redis: {
// Option 1: Redis URL (if you have a connection string)
url: "redis://username:password@host:port",
// Option 2: Individual credentials
// host: "your-redis-host.com",
// port: 6379,
// username: "default", // or your username
// password: "your_redis_password",
},
memoryNamespace: "my-app", // Separate memories by app/user
});
// Use ANY AI model you prefer - OpenAI, Anthropic, Claude, etc.
const result = await generateText({
model: openai("gpt-4o"), // 🎉 Use any model you want!
// model: anthropic('claude-3-5-sonnet-20241022'),
// model: google('gemini-1.5-pro'),
prompt: "I love hiking in Colorado",
});
// RecallKit automatically processes memories (using Gemini internally)
await recall.recall(result, {
userMessage: "I love hiking in Colorado",
});
// Your AI model can manage memories automatically with tools
const result = await generateText({
model: openai("gpt-4o"), // 🎉 Still use any model you want!
messages: [
{ role: "user", content: "I work at Google as a software engineer" },
],
tools: recall.createMemoryTools(), // AI manages memories automatically!
});
// Memories are created/updated automatically by AI (processed with Gemini internally)
// Duplicates are automatically detected and prevented
Perfect for Next.js API routes with any AI model:
// app/api/chat/route.ts
import { streamText } from "ai";
import { openai } from "@ai-sdk/openai"; // or any provider
import { RecallClient } from "recallkit-sdk";
const recall = new RecallClient({
geminiApiKey: "your_gemini_api_key", // RecallKit internal use
redis: {
host: "your-redis-host.com",
port: 6379,
username: "default", // or your username
password: "your_redis_password",
},
memoryNamespace: "chat-app",
});
export async function POST(request: Request) {
const { messages } = await request.json();
// Get memory context
const memoryContext = await recall.getMemoryContext(
messages[messages.length - 1].content
);
// Use any AI model you prefer
const result = await streamText({
model: openai("gpt-4o"), // 🎉 Your choice of model!
messages: [
{
role: "system",
content: `You are a helpful assistant with memory.${memoryContext}`,
},
...messages,
],
tools: recall.createMemoryTools(), // AI manages memories automatically
});
return result.toDataStreamResponse();
}
recall(result): RecallKit processes the conversation using Gemini internallyWhy Gemini internally? RecallKit uses Gemini for consistent, cost-effective memory processing while letting you use any model for your main application.
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai"; // Use any provider!
import { RecallClient } from "recallkit-sdk";
const recall = new RecallClient({
geminiApiKey: "your_gemini_api_key", // RecallKit internal
redis: {
url: "redis://username:password@host:port", // or use individual fields
},
memoryNamespace: "my-app",
});
async function chatWithMemory(userMessage: string) {
// 1. Get relevant memories
const memoryContext = await recall.getMemoryContext(userMessage);
// 2. Generate AI response with ANY model
const result = await generateText({
model: openai("gpt-4o"), // 🎉 Your choice!
// model: anthropic('claude-3-5-sonnet-20241022'),
// model: google('gemini-1.5-pro'),
system: `You are a helpful assistant with memory.${memoryContext}`,
prompt: userMessage,
});
// 3. RecallKit processes memories with Gemini internally
await recall.recall(result, { userMessage });
return result.text;
}
// Usage
const response = await chatWithMemory("I love hiking in Colorado");
console.log(response); // AI response with memory context
You can customize RecallKit behavior:
const recall = new RecallClient({
// Required
geminiApiKey: "your_gemini_api_key",
redis: {
// Option 1: Redis URL
url: "redis://username:password@host:port",
// Option 2: Individual credentials (choose one approach)
// host: "your-redis-host.com",
// port: 6379,
// username: "default", // Redis username
// password: "your_redis_password",
// database: 0, // Redis database number (optional)
// Optional: Advanced Redis options
// options: {
// connectTimeout: 10000,
// commandTimeout: 5000,
// tls: false, // Enable for secure connections
// },
},
// Optional
memoryNamespace: "my-app", // Separate memories by app/user
embeddingModel: "text-embedding-004", // Google embedding model
summaryModel: "gemini-1.5-flash", // Model for memory extraction
debug: true, // Enable debug logging
// Memory options
memoryOptions: {
maxRelatedMemories: 10, // Max memories per search
minConfidenceThreshold: 0.7, // Similarity threshold
autoDeleteAfterDays: 30, // Auto-cleanup old memories
},
});
Free Options:
const recall = new RecallClient({
geminiApiKey: "your_gemini_api_key",
redis: {
url: "redis://default:your_password@your-host.upstash.io:6379",
},
});
const recall = new RecallClient({
geminiApiKey: "your_gemini_api_key",
redis: {
host: "redis-12345.cloud.redislabs.com",
port: 12345,
username: "default",
password: "your_password",
},
});
const recall = new RecallClient({
geminiApiKey: "your_gemini_api_key",
redis: {
host: "localhost",
port: 6379,
// username: "default", // if auth enabled
// password: "your_password", // if auth enabled
},
});
Comprehensive error handling with specific error types:
import {
ConfigurationError,
RedisConnectionError,
MemoryProcessingError,
} from "recallkit-sdk";
try {
await recall.recall(result);
} catch (error) {
if (error instanceof ConfigurationError) {
console.error("Config issue:", error.missingField);
} else if (error instanceof RedisConnectionError) {
console.error("Redis connection failed:", error.message);
} else if (error instanceof MemoryProcessingError) {
console.error("Memory processing failed:", error.memoryId);
}
}
RecallClient → AI Tools → Smart Memory Management
↓ ↓ ↓
Memory Search → Duplicate Check → Storage
RecallKit → MemoryProcessor → MemoryAgent → Redis
↓ ↓ ↓ ↓
Config → Extract Memories → Analyze → Store
We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE file for details.
Made with ❤️ for the AI developer community
Add memory to your AI apps in minutes, not hours.
FAQs
Later
The npm package recallkit receives a total of 1 weekly downloads. As such, recallkit popularity was classified as not popular.
We found that recallkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.