🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@agentskit/memory

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentskit/memory

Persistent and vector memory backends for AgentsKit.

Source
npmnpm
Version
0.10.12
Version published
Weekly downloads
847
-22.08%
Maintainers
1
Weekly downloads
 
Created
Source

@agentskit/memory

AgentsKit

Persist conversations and add vector search to your agents — swap backends without changing agent code.

npm version npm downloads bundle size license stability GitHub stars

Tags: ai · agents · llm · agentskit · ai-agents · memory · vector-db · embeddings · rag · sqlite · redis · vector-search

How this fits the ecosystem

@agentskit/memory gives agents continuity: chat history, vector memory, graph memory, encrypted stores, and local or hosted backends.

  • AgentsKit: compose it with the other packages in this repo to build agents from small, swappable parts.
  • Registry: look for ready agents and templates that already use this layer at registry.agentskit.io.
  • Playbook: learn the production patterns behind this layer at playbook.agentskit.io.
  • AKOS: run the same concepts with enterprise deployment, governance, and observability at akos.agentskit.io.

Docs: package guide · agent handoff

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 VectorStore interface is 3 methods; bring LanceDB, Pinecone, or any custom store in minutes
  • One interface, every deployment target — swap from inMemory to sqlite to redis without touching agent code

Install

npm install @agentskit/memory better-sqlite3
# For production:  npm install redis
# For vectors:     npm install vectra

Quick 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 (3)

  • fileChatMemory({ path }) — JSON on disk; zero infra.
  • sqliteChatMemory({ path }) — WAL-mode SQLite; indexed by session.
  • redisChatMemory({ client, keyPrefix }) — distributed, serverless-friendly.

All on top of createInMemoryMemory / createLocalStorageMemory from @agentskit/core.

Vector memory (7)

  • fileVectorMemory — pure-JS, file-persisted (good to ~10k vectors).
  • redisVectorMemory — Redis Stack / Redis 8+ HNSW.
  • pgvector — BYO SQL runner (postgres.js, pg, Drizzle, Prisma, Neon).
  • pinecone — managed; namespaces + metadata filters.
  • qdrant — self-hosted or cloud via HTTP.
  • chroma — HTTP collection client.
  • upstashVector — serverless HTTP.

Same 3-method VectorStore contract — swap without touching agent code.

Higher-order wrappers (6)

  • createHierarchicalMemory — MemGPT-style tiers: working / recall / archival. Recipe.
  • createVirtualizedMemory — hot window + cold retriever for long sessions. Recipe.
  • createAutoSummarizingMemory (via @agentskit/core/auto-summarize) — fold oldest turns into a running summary. Recipe.
  • createEncryptedMemory — AES-GCM-256 envelope over any ChatMemory; keys never leave the caller. Recipe.
  • createInMemoryGraph — knowledge graph (nodes + edges + BFS). Recipe.
  • createInMemoryPersonalization + renderProfileContext — per-user trait profile. Recipe.

Memory contract v1 (ADR 0003) — substitutable across runtime, useChat, and every framework binding.

Ecosystem

PackageRole
@agentskit/coreMemory, VectorMemory types
@agentskit/ragChunking + retrieval on top of vector memory
@agentskit/runtimememory / retriever options
@agentskit/adaptersEmbeddings for RAG

Contributors

AgentsKit contributors

License

MIT — see LICENSE.

Docs

Full documentation · GitHub

Keywords

agentskit

FAQs

Package last updated on 11 Jul 2026

Did you know?

Socket

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.

Install

Related posts