Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@kernel.chat/memory-tiers

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kernel.chat/memory-tiers

Three-tier generative memory for AI agents: observations → reflections → identity. Based on Stanford's Generative Agents paper. Zero LLM calls.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

@kernel.chat/memory-tiers

Three-tier generative memory for AI agents: observations → reflections → identity. Based on Stanford's Generative Agents paper. Zero LLM calls.

Part of the kernel.chat open-source stack. Used by @kernel.chat/kbot to give specialist agents a persistent sense of what they've seen, what it means, and who they're becoming over time.

Why three tiers

Single-tier memory (a flat log of everything) doesn't scale: every query re-scans the whole history. Two-tier memory (raw + summary) loses the why behind the what.

This package implements three tiers, each derived from the one below:

  • Observations — raw events the agent encountered (user asked X, tool returned Y, error Z occurred). Append-only.
  • Reflections — synthesized patterns across observations ("the user often asks about Polymarket on Fridays"). Generated periodically by deterministic summarization rules.
  • Identity — durable traits that emerge from reflections over time ("treats every regulated-industry question as audit-grade by default"). The slowest-changing layer; the agent's working self-model.

The synthesis between tiers is rule-based and deterministic — no LLM call. This makes it cheap to run continuously and replayable for audit.

Install

npm install @kernel.chat/memory-tiers

Usage

import { MemorySystem } from '@kernel.chat/memory-tiers'

const memory = new MemorySystem({
  // Optional config — thresholds for synthesis cadence, retention, etc.
})

// Tier 1 — feed observations as they happen.
memory.observe('User asked about Polymarket Trump 2028 odds', 'query', {
  threadId: 'abc',
})
memory.observe('Tool call: polymarket_query succeeded in 312ms', 'tool')

// Tier 2 — periodically synthesize reflections.
const reflections = memory.synthesize()

// Tier 3 — let reflections accumulate into identity.
const identity = memory.evolve()

// Read each tier back.
const observations = memory.getObservations('query')
const allReflections = memory.getReflections()
const traits = memory.getIdentity()

// Persist across runs.
memory.save('./memory.json')
memory.load('./memory.json')

// Inspect.
console.log(memory.summary())
console.log(memory.getStats())

Public API

ExportShape
MemorySystemMain class — observe, getObservations, synthesize, getReflections, evolve, getIdentity, toJSON/fromJSON, save/load, getStats, summary
ObservationTier 1 entry
ObservationCategoryUnion of categories (query, tool, error, etc.)
ReflectionTier 2 entry
IdentityTraitTier 3 entry
MemoryStateSerialized state shape
MemoryConfigConstructor config

Status

v1.0.x — production use inside @kernel.chat/kbot; light external test coverage. The three-tier model has been running in kbot since early 2026. The public API is stable. External test suite expanded in v1.1.

File issues at github.com/isaacsight/kernel if you hit edge cases outside the kernel.chat usage path.

PackageDiscipline
@kernel.chat/kbotThe agent itself
@kernel.chat/prompt-evolverPrompt self-optimization from traces
@kernel.chat/skill-routerBayesian routing across specialists
@kernel.chat/tool-forgeRuntime tool creation

See docs/agentic-engineering.md for the field map this package sits inside.

License

MIT.

Keywords

ai-agent

FAQs

Package last updated on 18 May 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