How LangChain built the memory system for LangSmith Agent Builder
Task-specific agents that execute the same workflow repeatedly need persistent memory across sessions; without it, users must repeat their preferences to the agent in every session, which would be a fundamentally poor experience. Most AI products launch without memory, but LangSmith Agent Builder's design made it a necessity.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · Builder creates task-specific agent
In LangSmith Agent Builder, builders create an agent to automate a particular workflow or part of their day.
Tools used
LangSmith Agent BuilderPostgresMCPAGENTS.md
Outcome
LangChain shipped a file-based memory system backed by Postgres, with human-in-the-loop approval and schema validation, enabling agents to build their own AGENTS.md through natural-language corrections without any upfront manual configuration.
What failed first
During development, the agent failed in multiple ways: not remembering when it should, remembering when it should not, routing memory to the wrong file type, generating files with invalid schemas, and failing to generalize specific learnings into compact rules.