Package Exports
- @agentskit/memory
Readme
@agentskit/memory
Persist conversations and add vector search to your agents — swap backends without changing agent code.
Tags: ai · agents · llm · agentskit · ai-agents · memory · vector-db · embeddings · rag · sqlite · redis · vector-search
Why memory
- Conversations that survive restarts — SQLite for local development, Redis for production; your agent remembers context across sessions with zero code changes
- RAG-ready vector search — store and retrieve embeddings with
fileVectorMemory(pure JS, no native deps) or Redis vector search for scale - Plug any backend — the
VectorStoreinterface is 3 methods; bring LanceDB, Pinecone, or any custom store in minutes - One interface, every deployment target — swap from
inMemorytosqlitetorediswithout touching agent code
Install
npm install @agentskit/memory better-sqlite3
# For production: npm install redis
# For vectors: npm install vectraQuick example
import { createRuntime } from '@agentskit/runtime'
import { anthropic } from '@agentskit/adapters'
import { sqliteChatMemory, fileVectorMemory } from '@agentskit/memory'
const runtime = createRuntime({
adapter: anthropic({ apiKey: process.env.ANTHROPIC_API_KEY, model: 'claude-sonnet-4-6' }),
memory: sqliteChatMemory({ path: './chat.db' }),
})
// Agent now remembers previous conversations across process restarts
const result = await runtime.run('What did we discuss yesterday?')
console.log(result.content)With RAG
Use a vector backend with @agentskit/rag createRAG({ embed, store }) — fileVectorMemory and redisVectorMemory implement VectorMemory for chunk storage and search.
Features
- Chat memory:
inMemoryChatMemory,sqliteChatMemory,redisChatMemory,fileChatMemory - Vector memory:
fileVectorMemory(pure JS),redisVectorMemory VectorMemoryinterface — 3 methods, bring any custom store- Memory contract v1 (ADR 0003) — substitutable across
runtime,useChat, and@agentskit/ink
Ecosystem
| Package | Role |
|---|---|
| @agentskit/core | Memory, VectorMemory types |
| @agentskit/rag | Chunking + retrieval on top of vector memory |
| @agentskit/runtime | memory / retriever options |
| @agentskit/adapters | Embeddings for RAG |
Contributors
License
MIT — see LICENSE.