What is MemoFS?
The file-first memory runtime for AI agents — architecture, mental model, and agent memory loop.
MemoFS is a file-first memory runtime for AI agents. It bridges the gap between ephemeral agent context windows and persistent codebase evolution by storing decisions, architectural constraints, project conventions, and search indexes directly as Markdown and JSONL files in your repository.
Designed for Two Primary Paths
Whether you are a developer using AI coding agents day-to-day (Claude Code, Cursor, Codex, Copilot, Cline) or an engineer building custom AI agents and agentic systems, MemoFS provides the standard runtime for structured, persistent agent memory.
Which Path Fits You?
Using AI Coding Agents
Equip Claude Code, Cursor, Codex, Copilot, Cline, or Aider with automatic memory via MCP.
Building Custom AI Agents
Import @memofs/core or @memofs/server directly into your TypeScript or Node.js agent architecture.
Self-Hosting & Deploying
Run the MemoFS HTTP server on Node.js or deploy globally on Cloudflare Workers.
MemoFS Cloud (Managed)
Zero-maintenance managed MCP endpoint, file replica, and team workspaces in the cloud.
The 4-Stage Agent Memory Loop
Every effective AI agent follows the four-phase MemoFS memory cycle:
Load Context
At the start of every session or task, the agent calls memofs.context to load core rules, architecture constraints, and recent briefing fragments.
Recall Past Decisions
Before modifying code or making assumptions, the agent queries memofs.recall to surface exact past reasoning, schemas, or prior bug fixes.
Execute With Memory
The agent performs the code modifications, refactors, or tests while strictly adhering to recalled decisions and repository constraints.
Persist Discoveries
Before ending the turn, the agent calls memofs.remember to write newly learned facts, root causes, or architectural patterns into .memofs/.
The Mental Model in 3 Core Tenets
Architectural Comparison
- Storage: Plain Markdown & JSONL in
.memofs/ - Offline Execution: 100% local, 0 external API keys required
- Search: BM25 keyword + optional vector hybrid search + knowledge graph
- Collaboration: Git-versioned with optional cloud edge replication
- Transparency: Fully human-auditable and editable in any IDE
Explore the Documentation
Quick Start Guide
Initialize MemoFS and connect your agent in 3 minutes.
Core Runtime & SDK
Dive into @memofs/core: memory architecture, recall, graph, and snapshots.
MCP Server
Configure local and hosted Model Context Protocol endpoints.
CLI Reference
Learn all command-line tools for memory inspection, indexing, and cloud sync.