Add persistent memory and session management system for agents#37159
Draft
Cazador0 wants to merge 1 commit intoanthropics:mainfrom
Draft
Add persistent memory and session management system for agents#37159Cazador0 wants to merge 1 commit intoanthropics:mainfrom
Cazador0 wants to merge 1 commit intoanthropics:mainfrom
Conversation
Implements a zero-dependency agent memory system with three modules: - MemoryStore: persistent key-value memory with tag indexing, word-level search, relevance scoring (importance + recency + frequency), and compaction - SessionManager: conversation session lifecycle (create/pause/resume/close) with context windowing and automatic memory extraction - AgentOrchestrator: ties sessions and memory together, builds memory-augmented prompts with scored memory injection Includes 43 passing tests and a Claude Code execution prompt (AGENT_PROMPT.md). https://claude.ai/code/session_011WRXRxpD4joSJbpdAG81nX
This was referenced Mar 22, 2026
|
This exists: npx archetypal-aiPersistent memory MCP server. Three tools: No account. No API key. Free. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a complete memory and session management system for agentic LLM assistants. The system enables agents to maintain persistent knowledge across conversations, manage multi-turn sessions with context windowing, and automatically extract learnings into a memory bank.
Key Changes
MemoryStore (
src/memory/memory-store.js): A persistent, indexed key-value memory bank with:SessionManager (
src/session/session-manager.js): Conversation session lifecycle management with:AgentOrchestrator (
src/agent/agent-orchestrator.js): High-level orchestration layer that:Comprehensive test suite (
tests/): 43 tests covering:Public API (
src/index.js): Clean exports for MemoryStore, SessionManager, and AgentOrchestratorDocumentation (
AGENT_PROMPT.md): Complete usage guide and operating principles for Claude Code integrationImplementation Details
importance × 0.4 + recency × 0.3 + frequency × 0.3https://claude.ai/code/session_011WRXRxpD4joSJbpdAG81nX