MemALL
Multi-agent Memory OS — 本地优先的 AI Agent 持久化记忆系统
7 MCP tools · 3 priority + 11-layer memory lifecycle · 31-step self-evolving pipeline · Knowledge graph · Multi-agent shared memory · Hook-driven automation
✨ What is MemALL?
MemALL gives AI Agents memory that persists across sessions, tools, and agents. Install it, connect it to Claude Desktop / Cursor / Cline / any MCP client, and your agents stop starting from scratch every conversation.
pip install memall-os # install (lightweight, no AI models)
pip install memall-os[full] # install + viz + FAISS
pip install memall-os[rerank] # install + cross-encoder reranking (HEAVY: ~1.8GB, requires PyTorch)
memall init # initialize
memall start # start services
memall hook list # list registered lifecycle hooks
memall hook register post_capture --action log # register a hook
# → MCP ready at http://127.0.0.1:9876/mcp
# → MCP ready at stdio (add to your mcp.json)
Then in any MCP client:
{
"mcpServers": {
"memall": {
"command": "memall",
"args": ["serve"]
}
}
}
# /capture "Decided to go open-source: MIT license, GitHub-first distribution"
# /retrieve "pricing decision"
# → finds the memory above, plus its context, timestamp, and relations
🔥 Why MemALL?
🧠 14-Level Memory Lifecycle (3 Priority + 11 Lifecycle Layers)
Not just "store and retrieve". Every memory has a semantic level with exclusion-based priority classification, epoch detection, and echo scoring:
| Level | Meaning | Example |
|---|---|---|
| P0/P1/P2 | Planning (priority layers) | "Ship v0.1.0 by June 23" |
| L1 | Raw fact | "User reported login bug" |
| L2 | Convention | "Use exclusion chain for classifier" |
| L3 | Business idea | "MemPort — cross-platform memory migration" |
| L4 | Decision | "Use FastAPI, not Flask" |
| L5 | Discussion | Multi-agent debate with convergence |
| L6 | Self-reflection | "What went well/badly this session" |
| L7 | Preference | "Prefers SMALL response, English-only" |
| L8 | Edge-promoted | Auto-promoted via knowledge graph connectivity |
| L9 | Distillation | Same-agent, same-category knowledge compression ("10k conversations → 200 knowledge nodes") |
| L10 | System insight | Cross-category insight — same agent spanning ≥2 distinct categories |
| L11 | Domain intelligence | Cross-project / cross-agent domain patterns |
Scope note: "Cross-domain" at L10 means cross-category within one agent (produced by
integrate_step). Truly cross-agent insight is produced separately by thecross_agentpipeline step, which can also emit L10 (cross-agent L9 aggregation) and L11 (domain patterns recurring across ≥5 agents). The two mechanisms are distinct.
30 core steps + 5 optional auto pipeline (see list_pipeline_steps()): enriches → classifies → detects epochs → reflects → distills → integrates → observes. No manual CRUD needed.
🔗 Knowledge Graph
Memories are connected by typed edges (refines, cites, contradicts, supersedes, extends). Traverse from "bug #123" to "fix PR #456" to "retrospective L6 reflection" in one hop.
/capture "Bug #123: OOM on large datasets"
/connect 123 456 --relation "resolved_by"
/traverse 123
→ finds #456 (fix), #789 (regression test), #912 (L6 reflection)
🤝 Multi-Agent Shared Memory
Claude, opencode, Codex, WorkBuddy — all reading from and writing to the same memory base. Cross-agent queries, fact extraction, and active push delivery are single MCP calls.
/fed_query "architecture decision last week" agent_name="claude"
→ returns cross-agent results with source attribution
🔄 Self-Evolving Pipeline
MemALL doesn't just store — it improves itself:
- L6 Reflection — auto-reviews work quality, identifies patterns, corrects mistakes
- L7 Preference Extraction — learns user preferences from interaction patterns
- Hook-Driven Automation — post-capture auto-triggers lightweight pipeline + discussion convergence; pre-retrieve injects pending work; post-pipeline reports rich summaries
- L9 Distillation — compresses raw conversations into structured knowledge
- L11 Domain Intelligence — cross-project pattern detection
- Forget & Adaptive — TTL-based decay, low-value cleanup, automatic re-indexing
- OODA Loop — Observe → Orient → Decide → Act, no human intervention
🏠 100% Local
SQLite + FTS5 + vector search. Zero cloud dependency. Your data stays on your machine.
🛠️ MCP Tool Surface (7 server endpoints)
Count clarification: The gateway exposes 7 top-level MCP tools (
memall_write,memall_read,memall_persona,memall_discussion,memall_federation,memall_system,memall_hooks_recent). Each is a consolidated tool with manyactions — the table below lists the individual actions, which may read like "30+ tools" but are dispatched through those 7 endpoints. This is why older docs said "6 consolidated tools": the count depends on whethermemall_hooks_recentis counted. Source of truth:src/memall/mcp/tools/__init__.py.
| Category | Tools |
|---|---|
| Memory CRUD | capture, retrieve, update, smart_store, store_batch |
| Knowledge Graph | connect, traverse, timeline |
| Search | vector_search, FTS5 full-text search, hybrid_search (FTS5+vec0 RRF, optional cross-encoder[¹]), memall_search |
| Session | session_start, session_end, session_summary |
| Identity & Persona | persona, persona_profile, identity, ask, memall_persona action=identity |
| Discussion & Decision | discussion_create, discussion_respond, discussion_status, trace |
| Distillation | memall_system action=distill |
| Federation | fed_query, fed_publish, fed_deliver, fed_conflicts, fed_inject, fed_extract |
| Hub Sync | hub_connect, hub_sync |
| Pipeline & Evolution | run_pipeline, reflect_interact, forget, adaptive, index_rebuild, memall_write action=forget, memall_system action=adaptive |
| Hook Activity | memall_hooks_recent — view async pipeline runs, notifications, and reminder checks |
| Security & Ops | security, ops, gateway, db, memall_system action=db, memall_system action=security, memall_write action=ops |
| Onboarding | onboarding |
| Export/Import | export, import, sync |
🚀 Quick Start
# One-shot install + start (recommended)
pip install memall-os && memall quickstart
# Or from source
git clone https://github.com/j19800/MemALL.git
cd MemALL
python install.py
memall quickstart initialises the database, starts the gateway, wires up the
MCP config, and opens the browser — nothing else to configure.
Then start recording:
memall capture "Project X: decided to use FastAPI, reason: async support"
memall capture "Fixed OOM bug in NLP pipeline — root cause: vector dimension mismatch"
memall retrieve "FastAPI decision"
📊 Why Not Competitors?
| Feature | MemALL | Mem0 | Letta | Zep |
|---|---|---|---|---|
| Memory model | 14 levels (P0/P1/P2 + L1–L11) | user/session | agent/memory-block | session/summary |
| Knowledge graph | ✅ Native + traversal | ❌ | ❌ | ❌ |
| Self-evolving pipeline | ✅ 31-step auto + 5 optional | ❌ | ❌ | ❌ |
| Multi-agent shared | ✅ Federation + active push | ❌ | Same agent only | ❌ |
| Decision tracking | ✅ Arc lifecycle | ❌ | ❌ | ❌ |
| Discussion convergence | ✅ Multi-agent auto | ❌ | ❌ | ❌ |
| Protocol | MCP (native) | REST API | REST + gRPC | REST API |
| Local-first | ✅ SQLite | ❌ Cloud | PostgreSQL | ❌ Cloud |
| Open source | ✅ MIT | ⚠️ Partial | ✅ | ⚠️ Partial |
📁 Project Structure
src/memall/
├── cli/ # CLI (40+ commands)
├── core/ # SQLite / NLP / vector search / event processor / echo scoring
├── api/ # FastAPI REST (35 routes)
├── mcp/ # MCP adapter (7 consolidated tool endpoints)
├── pipeline/ # 31-step auto pipeline + 5 optional (see list_pipeline_steps())
│ ├── observe/ # OODA observation step
│ ├── distill/ # L9/L10/L11 distillation, L7 preference, epoch detection
│ ├── classify/ # Exclusion-based priority classification
│ └── forget/ # TTL decay, L5 archive, low-value decay
├── graph/ # Knowledge graph + arc lifecycle management
├── federation/ # Cross-device memory sync + active push delivery
├── plugins/ # Hook/event-driven dashboard, exporter, notifier, scheduler
└── migrations/ # DB migrations
📝 Roadmap
- v0.1.0 — Core MCP server, 7 consolidated tool endpoints, CLI, PyPI package
- v0.1.69 — Repo made clonable again (
task_identity+ migrations 038/040 were live but uncommitted), goaltriagegate now emits an action, skills layer transactions fixed for concurrency, policy refusals return 403 instead of 500 - v0.2.0 — Web dashboard, user system, Pro tier gating
- v0.3.0 — Cloud sync, team collaboration, API gateway
Known gaps (stated, not hidden)
claim_taskis not atomic across processes.mcp/tasks.pydoes read → modify →UPDATE ... WHERE id = ?with no state predicate and no row lock, so two concurrent claims end last-writer-wins andclaimed_byis silently overwritten. Planned: add a state predicate or a unique index on(task_id, status).- Goal-level block reasons are not observable. Cards already carry a two-value
last_block_reasonenum; goals stillreturn Nonewhen they are stuck, so "why this goal is not moving" is invisible. - The guard suite is slow by design. Every guard replays all migrations via
init_db(), so a full run is measured in hours rather than minutes. Treat a green card guard set as evidence for that set, not for the whole repository. check_fixes.pyleaves scratch directories under%TEMP%(mkdtempwithoutrmtree).
🤝 Contributing
PRs welcome! See CONTRIBUTING.md for guidelines.
- Report bugs → Issues
- Ask questions → Discussions
- Browse the code → Repository
📄 License
MIT License. See LICENSE for details.
[¹] Cross-encoder reranking requires
pip install memall-os[rerank](downloads PyTorch + ~560MB model on first use). Core search works without it using RRF fusion of FTS5 + vec0.
Metadata
Release files for memall-os 0.1.69
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memall_os-0.1.69.tar.gz | 1.5 MB | Without provenance | Details for memall_os-0.1.69.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memall_os-0.1.69-py3-none-any.whl | Python 3 | none | any | Details for memall_os-0.1.69-py3-none-any.whl |
Total release size: 2.3 MB
Release files / memall_os-0.1.69.tar.gz
| Download URL | memall_os-0.1.69.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
794c01bcd7ba912b58544496b4532122f25d5259a63c26a5686bd794f968d6a0
|
|
BLAKE2b-256 checksum How to use checksums |
86798d08e45feee8c670d26ddb5499b282888bc0f0bea38fe121c3f233d6c991
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.8
|
Release files / memall_os-0.1.69-py3-none-any.whl
| Download URL | memall_os-0.1.69-py3-none-any.whl |
|---|---|
| Size | 824.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfff8260917b7b742d9774c5469fee952a14c65ef57454a6ec1c02d84dff3bab
|
|
BLAKE2b-256 checksum How to use checksums |
c98bd00127cd6a4975d97bed047660587a905722d81b144b79205f667940cb3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.8
|
Security for memall-os 0.1.69
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.