memory-architect

memory-architect is an agent for Claude Code from TheLobbi/claude. It costs 20 tokens per session (7,005 once invoked), scanned A, original, MIT.

An agent for designing how LangGraph applications save and retrieve state over time. It covers short-term conversation history, longer-term semantic memory, checkpoints, databases, and vector stores, which index information for meaning-based search.

In plain words
What is it for?
Use it to design conversation memory, checkpoint workflows, choose PostgreSQL or Redis persistence, define memory scopes, and add vector-store retrieval or RAG, meaning retrieval-augmented generation.
Why use it?
It helps an agent retain the right information between steps or conversations without relying only on the current prompt. It also addresses how that information is stored, organized, cleaned up, and retrieved.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; positional $N argument.

Part of the langgraph-architect plugin — 5 commands, 12 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/thelobbi/claude/memory-architect
Clone the repo
git clone --depth 1 https://github.com/TheLobbi/claude

Made for: Claude Code.

Or install langgraph-architect, the plugin that ships this one along with the rest of its 5 commands, 12 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/thelobbi/claude/memory-architect.svg)](https://agentmods.dev/agents/thelobbi/claude/memory-architect)
Your own site
<a href="https://agentmods.dev/agents/thelobbi/claude/memory-architect"><img src="https://agentmods.dev/badge/agents/thelobbi/claude/memory-architect.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,005 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.07005
Opus 5 $0.00010 $0.03503
Sonnet 5 $0.00004 $0.01401
Haiku 4.5 $0.00002 $0.00700

Measured today against content hash 4d6323187dd3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

memory-architect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/plugins/langgraph-architect/agents/memory-architect.md · 1,227 lines

How it starts

The opening of the file, as written. The whole thing — 1,227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Architect

You are the Memory Architect, the definitive expert in LangGraph memory systems, checkpointing, and persistence strategies. Your expertise spans short-term conversation buffers, long-term semantic memory, vector store integrations, and production-grade persistence layers.

Core Responsibilities

  1. Design memory architectures for conversation history, semantic retrieval, and state persistence
  2. Implement checkpointing systems from development (MemorySaver) to production (PostgreSQL/Redis)
  3. Configure memory scopes (thread, namespace, user, global) for optimal data organization
  4. Integrate vector stores for semantic memory and RAG patterns
  5. Optimize memory performance including cleanup, indexing, and retrieval strategies

1. Short-Term Memory (Conversation Buffer)

Basic Message State Management

from typing import Annotated
from langgraph.graph import StateGraph, MessagesState
from langgraph.graph.message import add_messages
from langchain_core.messages import BaseMessage

# Use built-in MessagesState for conversation history
class ConversationState(MessagesState):
    """State with conversation history using add_messages reducer."""
    # messages: Annotated[list[BaseMessage], add_messages] - already defined
    pass

# Custom state with additional fields
class CustomState(MessagesState):
    user_id: str
    metadata: dict

def chatbot(state: ConversationState):
    """Access full conversation history."""
    messages = state["messages"]
    last_message = messages[-1]

    # The add_messages reducer handles:
    # - Appending new messages
    # - Updating messages by ID
    # - Removing messages (RemoveMessage)

    return {"messages": [AIMessage(content="Response")]}

Thread-Scoped Conversations

from langgraph.checkpoint.memory import MemorySaver
from langgraph.graph import StateGraph

# Create graph with checkpointing
builder = StateGraph(ConversationState)
builder.add_node("chatbot", chatbot)
builder.set_entry_point("chatbot")

memory = MemorySaver()
graph = builder.compile(checkpointer=memory)

# Each thread_id maintains separate conversation history
config1 = {"configurable": {"thread_id": "user_123_session_1"}}
config2 = {"configurable": {"thread_id": "user_123_session_2"}}

# Separate conversation histories
graph.invoke({"messages": [("user", "Hello")]}, config1)
graph.invoke({"messages": [("user", "Hi there")]}, config2)

# Resume conversations
graph.invoke({"messages": [("user", "Continue")]}, config1)

Read the full file on GitHub · 1,227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 1,227 lines · 20 tokens per session scan A 4d6323187dd3

Subscribe to this mod's changes

memory-architect is an agent published in the GitHub repository TheLobbi/claude (21 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 7,005 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other agents, from other repositories

context-engineer

Expert in AI memory architectures, context window optimization, token budget management, and state persistence. Use for designing conversation memory systems, implementing sliding window strategies, RAG-based context extension, and multi-agent con...

SteveGJones/ai-first-sdlc-practices · 45 tokens

search-optimizer

Search pipeline — hybrid fusion, reranking, quality gates, FTS5 tuning, vector search.

ArkaAiAdmin/Agentic-Memory · 23 tokens

rag-memory

MBSEモデル設計LLMフレームワークの長期記憶(ハイブリッドRAG)を検索・更新するエージェント。過去の設計原則・論文・ニュース・実験ログを思い出す、新しい知識を記憶に取り込む、チャンクに重要度タグを付ける、記憶の棚卸し(忘却バッチ)を行う、といった依頼で使う。「過去の設計判断を調べて」「この資料を記憶に入れて」「これは重要度高でタグ付けして」「knowledgetypeをprincipleに昇格して」のような依頼が対象。.

masaki-kato-119/hybrid-rag-memory · 158 tokens

pipeline

Pipeline agent for src/extractor.ts, src/consolidator.ts, src/claude-md.ts, prompts/ — extraction, consolidation, and CLAUDE.md sync.

bakabaka91/claude-baton · 34 tokens

context-manager

Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects with 2025/2026 best practices. Use PROACTIVELY for complex AI…

HermeticOrmus/LibreUIUX-Claude-Code · 62 tokens

rag-ops

Керує RAG індексацією, колекціями, пам'яттю та здоров'ям системи. Використовуй для операційних задач.

getreka/reka · 42 tokens