agentleFS
MemTensorMemTensor/MemOS/AGENTS.md

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

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 3 mentionsMay 2026: 2 mentionsJun 2026: 1 mentionJul 2026: 6 mentionsAug 2026: 11 mentionsSep 2026: 5 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the MemTensor/MemOS repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about MemTensor/MemOS

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

23 more on GitHub

On Bluesky · 4

  • 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.

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
  1. Very specific:

    Run full tests: make test

    line 43
  2. Very specific:

    Run a single test: poetry run pytest tests/<path>/test_xxx.py -q

    line 44
  3. Very specific:

    Every provider follows the same three-piece pattern: base.py abstract class + factory.py registry + configs/<category>.py config.

    line 81
  4. Very specific:

    Add a pydantic config in src/memos/configs/<category>.py and register it in <Category>ConfigFactory.backend_to_class.

    line 100
  5. Very specific:

    Add tests under tests/<category>/test_<backend>.py.

    line 103
  6. Very specific:

    Write a failing test first (TDD), placed under tests/<corresponding module>/test_*.py.

    line 109
  7. Very specific:

    Before claiming a task is done, run verification commands and paste the real output (at minimum make format plus the relevant pytest run).

    line 110
  8. Distinctive:

    Keep changes within the directories the current task authorizes.

    line 111
  9. Very specific:

    Use memos.log.get_logger(__name__) for logging.

    line 112
  10. Very specific:

    After touching src/memos/api/, run make openapi to refresh docs/openapi.json.

    line 114
  11. Very specific:

    Never: commit .env, private/, .private-paths, tmp/, *.log, secrets, tokens, or model credentials.

    line 126
  12. Common:

    Do not log or include real API keys, raw user data, or vector contents in tests/fixtures.

    line 127
  13. Very specific:

    Do not skip pre-commit or push with --no-verify (the scripts/check-public-push.sh pre-push hook is enforced).

    line 128
  14. Distinctive:

    Do not claim tests pass without real pytest output as evidence.

    line 129
  15. Very specific:

    Do not add third-party dependencies to core dependencies — they must go into optional extras.

    line 130
  16. Very specific:

    Do not run wide-scope rm -rf outside src/.

    line 131
  17. Distinctive:

    All configs and API schemas use Pydantic v2.

    line 137
  18. Very specific:

    Do not commit paths listed in .private-paths.

    line 154

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 Layout

PathPurpose
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 to docs/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 by python-release.yml on GitHub release)

Core API

Python top-level entries (from memos import ...)

SymbolPurposeSource
MOSMemory OS top-level entry (inherits MOSCore)memos.mem_os.main
GeneralMemCubeGeneral memory containermemos.mem_cube.general
MOSConfig / GeneralMemCubeConfigPrimary configsmemos.configs.mem_os / memos.configs.mem_cube
GeneralScheduler / SchedulerFactory / SchedulerConfigFactoryScheduler and factoriesmemos.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 run make openapi after touching the API)

Import Patterns

UseImport
Top-level entriesfrom memos import MOS, GeneralMemCube, MOSConfig
Config classesfrom memos.configs.<submodule> import <Config>
Any provider factoryfrom memos.<category>.factory import <Category>Factory
Loggerfrom memos.log import get_logger; logger = get_logger(__name__)
Context (trace)from memos.context.context import get_current_trace_id, get_current_user_name
Exceptionsfrom 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:

CategoryBase classFactoryRegistered backends
LLMBaseLLMLLMFactoryopenai / openai_new / azure / ollama / huggingface / huggingface_singleton / vllm / qwen / deepseek
EmbedderBaseEmbedderEmbedderFactoryollama / sentence_transformer / ark / universal_api
Vector DBBaseVecDBVecDBFactoryqdrant / milvus
Graph DBBaseGraphDBGraphStoreFactoryneo4j / neo4j_community / nebular / polardb / postgres
ChunkerBaseChunkerChunkerFactorysentence / markdown / simple / charactertext
ParserBaseParserParserFactorymarkitdown
RerankerBaseRerankerRerankerFactorycosine_local / http_bge / http_bge_strategy / concat / noop
MemoryBaseMemory (+ BaseTextMemory / BaseActMemory / BaseParaMemory)MemoryFactorynaive_text / general_text / tree_text / simple_tree_text / pref_text / simple_pref_text / kv_cache / vllm_kv_cache / lora
SchedulerBaseSchedulerSchedulerFactorygeneral / optimized

Adding a New Provider

Mirror any existing provider in the same category:

  1. Implement src/memos/<category>/<backend>.py, inheriting the base.py abstract class and matching the signatures of existing providers.
  2. Add a pydantic config in src/memos/configs/<category>.py and register it in <Category>ConfigFactory.backend_to_class.
  3. Register the implementation in <Category>Factory.backend_to_class in src/memos/<category>/factory.py.
  4. 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 to all; guard the import with try/except ImportError and raise a clear "install extras X" message on failure.
  5. 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 format plus 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 through memos.context.context — do not print.
  • 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/, run make openapi to refresh docs/openapi.json.

Ask first

  • Modifying pyproject.toml dependencies or the Python version constraint.
  • Touching public routes, request/response models, or the OpenAPI contract under src/memos/api/.
  • Changing DB schema, migrations, mem_user tables, or graph_dbs graph 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-commit or push with --no-verify (the scripts/check-public-push.sh pre-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 -rf outside src/; do not git push --force or git reset --hard origin/*.

Code Style

  • Format and lint with Ruff (configured in pyproject.toml [tool.ruff]); make format must pass before commit.
  • Type annotations are required on public functions, API schemas, and config classes; implicit Optional is 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 bare Exception / RuntimeError; the API layer translates them to HTTP errors in memos.api.exceptions.
  • File naming: source snake_case.py, tests test_<module>.py.

Change → Test Mapping

  • Edit src/memos/<module>/: at minimum run pytest tests/<corresponding module>/ -q; run make test once more before merging.
  • Edit src/memos/api/: run tests/api/ and make openapi to confirm the OpenAPI spec did not change unexpectedly.
  • Edit pyproject.toml dependencies: poetry lock --no-update, then make test.
  • Edit Makefile / pre-commit / Ruff config: run make pre_commit locally 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>.
  • main is protected — all changes go through PRs; never force-push to main; 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.