Skip to content

README: document the architecture with diagrams - #2

Merged
Ninadnj merged 1 commit into
mainfrom
docs/architecture
Aug 8, 2026
Merged

README: document the architecture with diagrams#2
Ninadnj merged 1 commit into
mainfrom
docs/architecture

Conversation

@Ninadnj

@Ninadnj Ninadnj commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Replaces the prose "How it works" bullets with an Architecture section that shows where MCP actually sits.

What's new

System diagram — agents → MCP server (stdio) / CLI / Python API → context guards → MemoryStore → embedder, token counter, store.json. MCP is drawn as the integration surface it is: a stdio server each agent launches as a subprocess, with the CLI and Python API as alternative entry points onto the same engine.

Module map — a table pairing each box with the file behind it, so a reader can go from diagram to code.

Recall path — embed, rank by cosine, drop anything below the relevance floor, greedily pack under the token budget. Makes explicit why the guards sit between the tools and the store: tool output hides scores, so the agent can't judge relevance itself.

Write path — the lock → re-read → atomic-replace sequence, as a sequence diagram showing two agents contending for the same file. Documents the durability properties fixed in #1: no lost updates, no torn files, fresh reads, compact storage.

Verified

All four mermaid blocks render on GitHub — the viewscreen iframes resize from the 180px placeholder to 377/756/190/570px, with no syntax errors in the DOM. Checked on this branch before merging.

🤖 Generated with Claude Code

Replaces the prose "How it works" bullets with an Architecture section that
shows where MCP actually sits: a stdio server each agent launches, with the
CLI and Python API as alternative entry points onto the same engine.

- System diagram: agents -> MCP/CLI/API -> context guards -> MemoryStore ->
  embedder, token counter, store.json.
- Module map table, so a reader can find the file behind each box.
- Recall path: embed, rank, drop below the relevance floor, greedily pack
  under the token budget.
- Write path: the lock/merge/atomic-replace sequence that lets two agents
  share one file without losing each other's memories.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Ninadnj
Ninadnj merged commit 654eb31 into main Aug 8, 2026
4 checks passed
@Ninadnj
Ninadnj deleted the docs/architecture branch August 8, 2026 20:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 037480f848

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md

EMB["Embedder — embeddings.py<br/>HashingEmbedder default, offline<br/>SentenceTransformer optional"]
TOK["Token counter — tokens.py<br/>tiktoken, or an approximation"]
DISK[("store.json<br/>one file per project<br/>lock · merge · atomic replace")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clarify that project isolation requires separate paths

When the tool is used from multiple repositories, no project scoping creates this “one file per project” topology: both the CLI and MCP server default to the single ~/.agent_memory/store.json path, and the setup examples above hard-code that same path. Users following this architecture literally will therefore mix unrelated memories and handoffs across projects; document that each project must configure a distinct AGENT_MEMORY_PATH, or add actual project namespacing.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant