MemOS
AGENTS.md12k starsChanged 6 months agoApache-2.0View on GitHub
Single source of truth for the project across AI runtimes. Claude Code, Codex, Cursor, Copilot, etc. all defer to this file. Runtime-specific adaptation belongs in each runtime's own file (Claude reads CLAUDE.md); do not mix it in here. MemOS / MemoryOS: a memory operating system for LLM agents. Python library plus a FastAPI service, providing multiple memory types (textual / tree / preference / skill / KV cache / LoRA parametric) plus scheduling, version management, and vector & graph storage.
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
Trending
Quiet since September.about the whole repository
Who's talking about MemTensor/MemOS
- @sungkim.bsky.social“MemOS: A Memory OS for AI System A unified memory-management substrate for AI—so those stateless AI can act …”Bluesky · Jul 9, 2025 · 17 likes
- @github-trending-js.bsky.social“📦 MemTensor / MemOS ⭐ 9,829 (+58) 🗒 TypeScript Self-evolving memory OS for LLM & AI Agents: …”Bluesky · Jun 12, 2026 · 4 likes
- A Hacker News story“MemOS: Treating "memory" as a first-class resource for LLMs”Hacker News · Aug 18, 2025 · 2 points
- @github-trending-js.bsky.social“📦 MemTensor / MemOS ⭐ 9,324 (+67) 🗒 TypeScript Self-evolving memory OS for LLM & AI Agents: …”Bluesky · May 23, 2026 · 1 likes
- @reachsumit.com“MemReranker: Reasoning-Aware Reranking for Agent Memory Retrieval Introduces a compact reranking model …”Bluesky · May 8, 2026 · 1 likes
The biggest 5 of 33 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 33
Talked about on GitHub, Bluesky and Hacker News (33 times).
On GitHub · 28
- Jan 20, 2026Analyze MemOS repository for improvements — criptogus/liquid-ai1 reaction
- Sep 30, 2026CLI download_examples has no request timeout and can hang forever — MemTensor/MemOS-Cloud-CLI0 reactions · 3 comments
- Sep 29, 2026agent-skills.github.memtensor.memos: init at 2.0.34 — sudosubin/agents.nix0 reactions
- Sep 20, 2026fix(server): bound VikingBot log growth — volcengine/OpenViking0 reactions · 1 comment
- Sep 10, 2026docs: sync DingTalk release plan v2.0.34 — MemTensor/MemOS-Docs0 reactions · 1 comment
23 more on GitHub
- Sep 3, 2026docs: sync DingTalk release plan v2.0.33 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Aug 27, 2026docs: sync DingTalk release plan v2.0.32 — MemTensor/MemOS-Docs0 reactions
- Aug 24, 2026Curate persistent memory and skill evolution resources — YuxingLu613/awesome-agentic-evolution0 reactions
- Aug 24, 2026docs: sync DingTalk release plan v2.0.31 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Aug 21, 2026[new system]: MemOS — RonsenbergVI/agent-memory-benchmarks0 reactions
- Aug 20, 2026docs: sync DingTalk release plan v2.0.31 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Aug 17, 2026[Argus] CVE-2026-75110: INTERNAL_SERVICE_SECRET 미설정을 통한 MemOS 인증 우회 — LEEKIYOON-SEC/Argus-DEV0 reactions
- Aug 13, 2026docs: sync DingTalk release plan v2.0.30 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Aug 13, 2026docs: backfill MemOS Local Plugin v2.0.14 changelog — MemTensor/MemOS-Docs0 reactions
- Aug 9, 2026feat(core/ports): AgentTrajectoryRecorderPort — capture action sequences for Cases→Skills distillation — hleserg/atman0 reactions · 1 comment
- Aug 7, 2026docs: sync DingTalk release plan v2.0.29 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Aug 6, 2026docs: sync DingTalk release plan v2.0.29 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Jul 30, 2026docs: sync DingTalk release plan v2.0.28 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Jul 24, 2026docs: sync DingTalk release plan v2.0.25 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Jul 23, 2026docs: sync DingTalk release plan v2.0.25 — MemTensor/MemOS-Docs0 reactions · 1 comment
- Jul 19, 2026feat(core): MemoryFeedbackPort — natural-language correction / supplement / replacement of stored memories (MemOS pattern) — hleserg/atman0 reactions · 1 comment
- Jul 3, 2026Audit candidate: MemTensor/MemOS — xiaolai/nlpm0 reactions · 2 comments
- Jul 3, 2026MemOS — конкурентный анализ: skill reuse layer и trust-scored facts как прямая угроза Atman — hleserg/atman0 reactions · 1 comment
- Apr 13, 2026[SUBMISSION] MemOS — ProSkillsMD/proskills0 reactions
- Apr 7, 2026[SUBMISSION] MemOS — ProSkillsMD/proskills0 reactions
- Apr 1, 2026[SUBMISSION] MemOS — ProSkillsMD/proskills0 reactions · 1 comment
- Mar 19, 2026feat(mem_reader): add reasoning_chain field to summarizer output — abakane1/MemOS0 reactions
- Mar 9, 2026每日更新: 2026-03-10 - 新发现项目 — vivy-yi/awesome-openclaw0 reactions
On Bluesky · 4
- Jul 9, 2025MemOS: A Memory OS for AI System A unified memory-management substrate for AI—so those stateless AI can act like the human brain, possess… — @sungkim.bsky.social17 likes and reposts · 3 replies
- Jun 12, 2026📦 MemTensor / MemOS ⭐ 9,829 (+58) 🗒 TypeScript Self-evolving memory OS for LLM & AI Agents: ultra-persistent memory,… — @github-trending-js.bsky.social4 likes and reposts
- May 23, 2026📦 MemTensor / MemOS ⭐ 9,324 (+67) 🗒 TypeScript Self-evolving memory OS for LLM & AI Agents: ultra-persistent memory,… — @github-trending-js.bsky.social1 likes and repost
- May 8, 2026MemReranker: Reasoning-Aware Reranking for Agent Memory Retrieval Introduces a compact reranking model family (0.6B/4B) for agent memory… — @reachsumit.com1 likes and repost
On Hacker News · 1
- Aug 18, 2025MemOS: Treating "memory" as a first-class resource for LLMs2 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 1 is common, 3 are distinctive, and 14 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 43
Run full tests: make test
- Very specific: line 44
Run a single test: poetry run pytest tests/<path>/test_xxx.py -q
- Very specific: line 81
Every provider follows the same three-piece pattern: base.py abstract class + factory.py registry + configs/<category>.py config.
- Very specific: line 100
Add a pydantic config in src/memos/configs/<category>.py and register it in <Category>ConfigFactory.backend_to_class.
- Very specific: line 103
Add tests under tests/<category>/test_<backend>.py.
- Very specific: line 109
Write a failing test first (TDD), placed under tests/<corresponding module>/test_*.py.
- Very specific: line 110
Before claiming a task is done, run verification commands and paste the real output (at minimum make format plus the relevant pytest run).
- Distinctive: line 111
Keep changes within the directories the current task authorizes.
- Very specific: line 112
Use memos.log.get_logger(__name__) for logging.
- Very specific: line 114
After touching src/memos/api/, run make openapi to refresh docs/openapi.json.
- Very specific: line 126
Never: commit .env, private/, .private-paths, tmp/, *.log, secrets, tokens, or model credentials.
- Common: line 127
Do not log or include real API keys, raw user data, or vector contents in tests/fixtures.
- Very specific: line 128
Do not skip pre-commit or push with --no-verify (the scripts/check-public-push.sh pre-push hook is enforced).
- Distinctive: line 129
Do not claim tests pass without real pytest output as evidence.
- Very specific: line 130
Do not add third-party dependencies to core dependencies — they must go into optional extras.
- Very specific: line 131
Do not run wide-scope rm -rf outside src/.
- Distinctive: line 137
All configs and API schemas use Pydantic v2.
- Very specific: line 154
Do not commit paths listed in .private-paths.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Single source of truth for the project across AI runtimes. Claude Code, Codex, Cursor, Copilot, etc. all defer to this file. Runtime-specific adaptation belongs in each runtime's own file (Claude reads
CLAUDE.md); do not mix it in here.
Project Overview
MemOS / MemoryOS: a memory operating system for LLM agents. Python library plus a FastAPI service, providing multiple memory types (textual / tree / preference / skill / KV cache / LoRA parametric) plus scheduling, version management, and vector & graph storage.
- Repository: https://github.com/MemTensor/MemOS
- Documentation: https://memos-docs.openmem.net/home/overview/
- PyPI: https://pypi.org/project/MemoryOS/
- License: Apache-2.0
- Top-level package:
src/memos/. Distribution nameMemoryOS; import namememos. - CLI:
memos(entrymemos.cli:main) - API service:
memos.api.start_api:app
Repository Layout
| Path | Purpose |
src/memos/mem_os/ | MOS / MOSCore — top-level Memory OS entry |
src/memos/mem_cube/ | GeneralMemCube — memory container aggregating multiple memory types |
src/memos/memories/ | Memory implementations: textual/, activation/, parametric/ |
src/memos/mem_scheduler/ | Memory scheduler + monitors + ORM + task scheduling |
src/memos/mem_user/ | User / multi-tenant management (MySQL / Redis backends) |
src/memos/mem_chat/ mem_reader/ mem_agent/ mem_feedback/ multi_mem_cube/ | Chat sessions, ingest pipeline, agent integration, feedback channel, multi-cube routing |
src/memos/llms/ embedders/ vec_dbs/ graph_dbs/ chunkers/ parsers/ reranker/ | Provider implementations (base.py + factory.py + each backend) |
src/memos/api/ | FastAPI service (routers / handlers / middleware / MCP server) |
src/memos/configs/ | All pydantic configuration classes (one-to-one with the modules above) |
src/memos/context/ | Cross-thread context (trace_id / user / env) |
tests/ | pytest cases, subdirectories mirror src/memos/ |
apps/ | Independent sub-projects, each with its own README; not part of the main Harness flow |
extensions/ | Official plugin examples |
docker/ docs/ evaluation/ scripts/ | Deployment, documentation, evaluation, helper scripts |
.claude/agents/, .codex/agents/ | Project-recommended AI sub-agent definitions |
Command Cheatsheet
- Install:
make install(=poetry install --extras all --with dev --with test+ pre-commit + push hook) - Start API:
make serve - Export OpenAPI:
make openapi(writes todocs/openapi.json) - Run full tests:
make test - Run a single test:
poetry run pytest tests/<path>/test_xxx.py -q - Lint + format:
make format - Full pre-commit:
make pre_commit - Build:
poetry build(publishing is automated bypython-release.ymlon GitHub release)
Core API
Python top-level entries (from memos import ...)
| Symbol | Purpose | Source |
MOS | Memory OS top-level entry (inherits MOSCore) | memos.mem_os.main |
GeneralMemCube | General memory container | memos.mem_cube.general |
MOSConfig / GeneralMemCubeConfig | Primary configs | memos.configs.mem_os / memos.configs.mem_cube |
GeneralScheduler / SchedulerFactory / SchedulerConfigFactory | Scheduler and factories | memos.mem_scheduler.* |
Common MOS methods: MOS.simple() (auto-configure from env), register_mem_cube(cube), add(...), search(...), chat(...), create_user(...) / list_users().
API entry
- ASGI app:
memos.api.start_api:app - Routers:
src/memos/api/routers/(admin_router,product_router,server_router) - OpenAPI contract:
docs/openapi.json(must runmake openapiafter touching the API)
Import Patterns
| Use | Import |
| Top-level entries | from memos import MOS, GeneralMemCube, MOSConfig |
| Config classes | from memos.configs.<submodule> import <Config> |
| Any provider factory | from memos.<category>.factory import <Category>Factory |
| Logger | from memos.log import get_logger; logger = get_logger(__name__) |
| Context (trace) | from memos.context.context import get_current_trace_id, get_current_user_name |
| Exceptions | from memos.exceptions import <semantic Exception> |
Provider Matrix
Every provider follows the same three-piece pattern: base.py abstract class + factory.py registry + configs/<category>.py config. The authoritative list of registered backends is the factory's backend_to_class; the snapshot below is provided for quick reference:
| Category | Base class | Factory | Registered backends |
| LLM | BaseLLM | LLMFactory | openai / openai_new / azure / ollama / huggingface / huggingface_singleton / vllm / qwen / deepseek |
| Embedder | BaseEmbedder | EmbedderFactory | ollama / sentence_transformer / ark / universal_api |
| Vector DB | BaseVecDB | VecDBFactory | qdrant / milvus |
| Graph DB | BaseGraphDB | GraphStoreFactory | neo4j / neo4j_community / nebular / polardb / postgres |
| Chunker | BaseChunker | ChunkerFactory | sentence / markdown / simple / charactertext |
| Parser | BaseParser | ParserFactory | markitdown |
| Reranker | BaseReranker | RerankerFactory | cosine_local / http_bge / http_bge_strategy / concat / noop |
| Memory | BaseMemory (+ BaseTextMemory / BaseActMemory / BaseParaMemory) | MemoryFactory | naive_text / general_text / tree_text / simple_tree_text / pref_text / simple_pref_text / kv_cache / vllm_kv_cache / lora |
| Scheduler | BaseScheduler | SchedulerFactory | general / optimized |
Adding a New Provider
Mirror any existing provider in the same category:
- Implement
src/memos/<category>/<backend>.py, inheriting thebase.pyabstract class and matching the signatures of existing providers. - Add a pydantic config in
src/memos/configs/<category>.pyand register it in<Category>ConfigFactory.backend_to_class. - Register the implementation in
<Category>Factory.backend_to_classinsrc/memos/<category>/factory.py. - Third-party dependencies must go into an optional extras group in
pyproject.toml(tree-mem/mem-scheduler/mem-user/mem-reader/pref-mem/skill-mem) and be added toall; guard the import with try/except ImportError and raise a clear "install extras X" message on failure. - Add tests under
tests/<category>/test_<backend>.py; external HTTP / model loading must be mocked.
Behavior Boundaries
Always do
- Write a failing test first (TDD), placed under
tests/<corresponding module>/test_*.py. - Before claiming a task is done, run verification commands and paste the real output (at minimum
make formatplus the relevant pytest run). - Keep changes within the directories the current task authorizes; cross-module edits need to be called out and approved first.
- Use
memos.log.get_logger(__name__)for logging; route trace info throughmemos.context.context— do notprint. - Optional third-party dependencies (neo4j / redis / pika / pymilvus / markitdown, etc.) must be guarded with try/except ImportError and declared in the matching extras group.
- After touching
src/memos/api/, runmake openapito refreshdocs/openapi.json.
Ask first
- Modifying
pyproject.tomldependencies or the Python version constraint. - Touching public routes, request/response models, or the OpenAPI contract under
src/memos/api/. - Changing DB schema, migrations,
mem_usertables, orgraph_dbsgraph models. - Deleting files or doing wide-scope renames of public APIs (
memos.*top-level symbols). - Editing
Makefile,.pre-commit-config.yaml,pyproject.toml [tool.*], or.github/workflows/.
Never do (IMPORTANT)
- Never commit
.env,private/,.private-paths,tmp/,*.log, secrets, tokens, or model credentials. - Do not log or include real API keys, raw user data, or vector contents in tests/fixtures.
- Do not skip
pre-commitor push with--no-verify(thescripts/check-public-push.shpre-push hook is enforced). - Do not claim tests pass without real pytest output as evidence.
- Do not add third-party dependencies to core
dependencies— they must go into optional extras. - Do not run wide-scope
rm -rfoutsidesrc/; do notgit push --forceorgit reset --hard origin/*.
Code Style
- Format and lint with Ruff (configured in
pyproject.toml [tool.ruff]);make formatmust pass before commit. - Type annotations are required on public functions, API schemas, and config classes; implicit
Optionalis not allowed (enforced via pre-commit). - All configs and API schemas use Pydantic v2.
- Logging:
logger.info("... %s", x)form — do not pre-format with f-strings before passing to the logger. - Exceptions: library code raises semantic exceptions from
memos.exceptions, never bareException/RuntimeError; the API layer translates them to HTTP errors inmemos.api.exceptions. - File naming: source
snake_case.py, teststest_<module>.py.
Change → Test Mapping
- Edit
src/memos/<module>/: at minimum runpytest tests/<corresponding module>/ -q; runmake testonce more before merging. - Edit
src/memos/api/: runtests/api/andmake openapito confirm the OpenAPI spec did not change unexpectedly. - Edit
pyproject.tomldependencies:poetry lock --no-update, thenmake test. - Edit
Makefile/ pre-commit / Ruff config: runmake pre_commitlocally over the whole tree.
Git Conventions
- Commits: Conventional Commits (
feat:/fix:/chore:/refactor:/docs:), subject line ≤ 72 chars. - Branches:
feat/<slug>/fix/<slug>/dev-YYYYMMDD-v<version>. mainis protected — all changes go through PRs; never force-push tomain; do not skip git hooks.- Do not commit paths listed in
.private-paths. - The PR template lives at
.github/PULL_REQUEST_TEMPLATE.md— its checklist must be fully ticked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

