Engram-Fold - Persistent Structured Memory for AI Agents
Engram processes agent experiences into structured long-term memory while Fold provides semantic search across project knowledge. A practical look at building persistent memory for AI agents.
TL;DR
TL;DR: Engram-Fold gives AI agents persistent, structured memory - Engram encodes experiences into searchable knowledge graphs, Fold retrieves relevant context at runtime via semantic similarity.
Source and Accuracy Notes
- Official site: engram-fold.dev
- GitHub:
engram-aiorganization (MIT licensed) - This post is based on the product website, public documentation, and GitHub repositories.
What Is Engram-Fold?
Engram-Fold is a two-part memory system for AI agents:
- Engram processes agent experiences and encodes them into structured, long-term memory
- Fold indexes and retrieves that memory using semantic search so agents can recall relevant context when needed
The core problem it solves is context window limitation. Even with large context windows, agents forget details across sessions. Engram-Fold gives them a persistent memory layer that survives across interactions and can be queried in natural language.
Setup Workflow
Step 1: Install
git clone https://github.com/engram-ai/engram-fold.git
cd engram-fold
npm install
npm run build
Step 2: Configure
Create a .env file with your LLM provider credentials:
ENGRAM_LLM_PROVIDER=openai
ENGRAM_LLM_API_KEY=sk-......
VECTOR_STORE=pg
DATABASE_URL=postgresql://localhost/engram
Step 3: Integrate with your agent
Install the SDK package:
npm install @engram-ai/sdk
Use it in your code:
import { EngramClient, FoldClient } from '@engram-ai/sdk';
const engram = new EngramClient({ url: 'http://localhost:3001' });
const fold = new FoldClient({ url: 'http://localhost:3001' });
// Store an experience
await engram.store({
type: 'task_completion',
content: 'Fixed authentication bug by adding JWT validation middleware',
metadata: { task: 'auth-fix', priority: 'high' }
});
// Retrieve relevant memories
const memories = await fold.search('authentication fixes and security changes');
console.log(memories);
Deeper Analysis
Architecture
Engram-Fold uses a three-tier retrieval pipeline:
- Experience capture - Agent actions are logged with structured metadata (task type, outcome, entities involved)
- Encoding - Engram runs embeddings over experience text and stores them in a vector database (supports pgvector, Qdrant, Weaviate)
- Retrieval - Fold receives a query, runs semantic similarity search, and returns top-k relevant memories ranked by relevance score
Use Cases
- Code review agents that remember past bug patterns and similar fixes
- DevOps agents that recall previous incident resolutions
- Research agents that accumulate findings across sessions
Comparison
| Feature | Engram-Fold | Memory agents (built-in) | Vector DB only | |---|---|---|---| | Structured memory | Yes | No | No | | Semantic retrieval | Yes | Limited | Yes | | Session persistence | Yes | No | Yes | | Setup complexity | Low | None | Medium |
Practical Evaluation Checklist
- [ ] Memory survives across agent restarts
- [ ] Semantic search returns relevant (not just keyword-matched) results
- [ ] Encoding latency under 200ms for typical experience entries
- [ ] Fold retrieval latency under 100ms for 10K+ memory entries
- [ ] SDK works with both OpenAI and Claude-compatible backends
- [ ] Memory can be filtered by type, date range, or metadata
Security Notes
- LLM API keys stored in environment variables, not in memory store
- Memory entries are scoped to your agent session by default
- No third-party data sharing - all memory stays local or on your chosen vector DB
- PostgreSQL backend recommended for production to enable standard DB access controls
FAQ
Q: How does Engram differ from a simple vector database?
A: A vector DB stores embeddings. Engram adds a processing layer that structures raw experiences into typed memory entries with metadata. This structure enables filtering by type or tag during retrieval, which plain similarity search cannot do.
Q: Can I use Fold without Engram?
A: Yes. Fold is a standalone retrieval service. You can push custom memory entries directly to it via the API. Engram is the opinionated experience-capture layer on top.
Q: What vector stores does Fold support?
A: pgvector (PostgreSQL), Qdrant, and Weaviate. Local in-memory storage is also available for development.
Conclusion
Engram-Fold addresses a real gap in agent tooling: persistent, queryable memory that survives across sessions. The two-component design (Engram for encoding, Fold for retrieval) keeps concerns separated and makes it easy to plug into existing agent frameworks. If you are building long-horizon AI agents today, memory persistence is the next bottleneck to solve.
Visit engram-fold.dev to get started.
Related Posts
dev-tools
Automotive Skills Suite for AI Engineering
Evaluate Automotive Skills Suite for APQP, ASPICE, HARA, safety-plan, and DIA workflows with setup notes, governance risks, and SME review guidance.
5/28/2026
dev-tools
awesome-agentic-ai-zh Roadmap Guide
Explore awesome-agentic-ai-zh as a Chinese agentic AI learning roadmap, with setup notes, track selection, study workflow, and evaluation guidance.
5/28/2026
dev-tools
Baguette iOS Simulator Automation Guide
Set up Baguette for iOS Simulator automation, web dashboards, device farms, gesture input, streaming, and camera testing with Xcode caveats.
5/28/2026