agentskit.js

@agentskit/memory — for agents

Chat + vector memory backends, plus hierarchical, encrypted, graph, and personalization stores.

#Install

npm install @agentskit/memory

#Primary exports

#Chat memory (ordered history)

  • fileChatMemory({ path }) — JSON file.
  • sqliteChatMemory — SQLite-backed.
  • redisChatMemory — Redis-backed.
  • tursoChatMemory — Turso / libSQL.

#Vector memory

  • fileVectorMemory({ path }) — JSON file.
  • redisVectorMemory — Redis Vector.
  • pgvector, pinecone, qdrant, chroma, upstashVector — BYO-client / HTTP vector adapters. See Vector adapters.
  • supabaseVectorStore, weaviateVectorStore, milvusVectorStore, mongoAtlasVectorStore — managed / cluster backends.
  • matchesFilter(record, filter) — utility for evaluating vector-store filter predicates outside an adapter.

#Higher-order memory

  • createVirtualizedMemory — hot window + cold retriever.
  • createHierarchicalMemory — MemGPT tiers (working / recall / archival).
  • createAutoSummarizingMemory (from @agentskit/core/auto-summarize) — fold oldest into a summary.
  • createEncryptedMemory — AES-GCM over any ChatMemory. See Encrypted memory.
  • createInMemoryGraph — knowledge graph (nodes + edges + BFS). See Graph memory.
  • createInMemoryPersonalization + renderProfileContext — per-subject profile. See Personalization.
  • wrapChatMemoryWithRedaction(mem, { rules, mode?, vault?, allowedRoles? }) — redact (or tokenize) PII at save() time on any ChatMemory. Pairs with @agentskit/core/security tokenize / reveal for role-gated read.
  • wrapVectorMemoryWithRedaction(mem, { rules, mode?, vault?, allowedRoles? }) — same for VectorMemory.store(). Embeddings pass through verbatim; redact the input to your embedder separately if it is a hosted provider.
  • forgetSubject(memory, subjectId) / makeForgettable(memory) — GDPR-style right-to-erasure helpers that purge all records for a subject across ChatMemory and VectorMemory.

#Minimal example

import { createInMemoryMemory } from '@agentskit/core'
import { createVirtualizedMemory } from '@agentskit/memory'

const memory = createVirtualizedMemory(createInMemoryMemory(), { maxActive: 50 })

#Source

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page