Logo Total Agent Memory

Total Agent Memory

Cộng đồng
vbcherepanov

Persistent local memory for AI coding agents — Claude Code, Codex CLI, Cursor, any MCP client. Temporal knowledge graph, procedural memory, AST codebase ingest, cross-project analogy. LongMemEval R@5 95.1%, LoCoMo 0.607, BEAM 1M 0.448. 74 MCP tools, 9 IDEs, 100% local.

Nhà phát hànhvbcherepanov
Kho mãtotal-agent-memory
Ngôn ngữPython
Bản fork
18
Sao
73
Công cụ có sẵn
0
Phương thức truyền tảistdio, streamable-http
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Total Agent Memory cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    73 sao và 18 bản fork từ kho mã được liên kết.

Persistent, local memory for AI coding agents: Claude Code, Codex CLI, Cursor and any MCP client.

Website and documentation: totalmemory.dev · Quick start · Claude Code guide · Benchmarks · Compare with other tools

Version PyPI npm Docker GHCR MCP License

total-agent-memory (TAM) is an open-source memory server for AI coding agents. Coding agents start every session without memory of earlier ones, so decisions, fixes and project conventions have to be explained again. TAM stores decisions, solutions, facts, errors and session summaries on your machine and returns them through the Model Context Protocol (MCP), so any MCP client can use it without code changes.

Each store is one directory built around a SQLite database. Recall combines full-text BM25, dense embeddings computed locally, fuzzy matching and a knowledge graph, and fuses the ranked lists with reciprocal rank fusion; an optional cross-encoder can rerank the result. The default profile makes no LLM call on write or search, so retrieval can be measured offline and a rerun gives the same result. Facts can carry validity intervals (kg_add_fact, kg_at), and a newer value of a single-valued fact can retire the older one.

TAM is for developers who use coding agents daily and for researchers who need a memory baseline they can run locally, inspect and change. The same package can also run as a team server: personal, department and company areas are separate stores behind one gateway, with roles, authorship and an audit trail (team server).

Installation

TAM needs Python 3.11 or newer. CI tests Python 3.11, 3.12 and 3.13 on Ubuntu, Windows and macOS.

From PyPI (use a virtual environment, or pipx / uvx):

bash
pip install total-agent-memory          # or: pipx install total-agent-memory
uvx total-agent-memory                  # run once without installing

This installs the total-agent-memory (alias tam) MCP server and the tam-team, tam-remote and lookup-memory commands. The optional cross-encoder reranker pulls in PyTorch and is an extra: pip install "total-agent-memory[rerank]". The PostgreSQL backend of the team server is the [postgres] extra.

Register it with your clients. Run tam setup at a terminal. The wizard asks "Just me" or "Company server", detects Claude Code, Claude Desktop, Codex, Cursor, Windsurf, Gemini CLI, Cline and OpenCode, and registers the server with the ones you pick (setup wizard).

Other channels:

ChannelCommand
Docker (linux/amd64, linux/arm64)docker run -p 3737:3737 -p 37737:37737 -v ~/.tam:/data ghcr.io/vbcherepanov/total-agent-memory:14.9.0 — MCP over HTTP on :3737/mcp, dashboard on :37737
npx connectornpx -y total-agent-memory connect claude-code (or codex, cursor, cline, continue, aider, windsurf, gemini-cli, opencode)
Claude Code plugin (server, skill and capture hooks)/plugin marketplace add vbcherepanov/total-agent-memory/plugin install total-agent-memory@vbcherepanov
Plugin for Claude Code and Cowork, from the plugin repository (server and skill, no hooks; needs uv)/plugin marketplace add vbcherepanov/total-agent-memory-plugin/plugin install total-agent-memory@vbcherepanov
The same plugin for Codex CLIcodex plugin marketplace add vbcherepanov/total-agent-memory-plugincodex plugin add total-agent-memory@vbcherepanov
Source checkout with IDE hooks and background servicesgit clone https://github.com/vbcherepanov/total-agent-memory.git && cd total-agent-memory && ./install.sh --ide claude-code (Windows: install.ps1 -Ide claude-code)

Use one of the two Claude Code plugins, not both. Per-platform details, WSL2, the IDE matrix, uninstalling and troubleshooting are in the installation guide.

Quick start

  1. Install the package and run tam setup, or add the server to your client by hand. For Claude Code:

    bash
    claude mcp add memory -- total-agent-memory

    For clients that use an mcpServers file:

    json
    { "mcpServers": { "memory": { "command": "total-agent-memory" } } }

    If you installed into a virtual environment, use the full path to its total-agent-memory executable.

  2. Restart the client. Memory is stored in ~/.tam/ unless TAM_MEMORY_DIR points elsewhere.

  3. Ask the agent to remember something ("remember that we chose PostgreSQL for billing because of row-level security"). It calls memory_save. In a later session, ask "which database did we choose for billing?"; it calls memory_recall and gets the record back.

To try the server without an agent, this script starts it over stdio with the MCP Python SDK (installed as a dependency), saves one record and recalls it. The SDK passes only a few variables to the server by default, so the script hands over the full environment, including TAM_MEMORY_DIR:

python
import asyncio
import os

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client


async def main() -> None:
    server = StdioServerParameters(command="total-agent-memory", env=dict(os.environ))
    async with stdio_client(server) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            await session.call_tool("memory_save", {
                "type": "decision",
                "content": "Chose PostgreSQL over MySQL for the billing service",
                "context": "WHY: row-level security per tenant",
                "project": "demo",
            })
            result = await session.call_tool("memory_recall", {
                "query": "which database for billing", "project": "demo", "limit": 3,
            })
            print(result.content[0].text)


asyncio.run(main())
bash
TAM_MEMORY_DIR="$(mktemp -d)" python quickstart.py

The first run downloads the default embedding model. The output is JSON with the saved decision under results.decision. More examples: tools and interfaces.

Running the tests

The tests run from a source checkout. These commands mirror the CI workflows in .github/workflows:

bash
git clone https://github.com/vbcherepanov/total-agent-memory.git
cd total-agent-memory
python3 -m venv .venv
.venv/bin/pip install -e . -r requirements-dev.txt

export FASTEMBED_CACHE_PATH="$PWD/.tam-models" TAM_MEMORY_DIR="$PWD/.tam-test-memory"
.venv/bin/python tests/smoke/prewarm_models.py   # downloads the text and code embedding models and the cross-encoder (~940 MB) once
.venv/bin/python -m pytest tests -q

The tests need no API keys and no LLM; the full suite takes 15 to 20 minutes on a laptop. Do not set MEMORY_LLM_ENABLED=false for the full suite: the configuration tests check LLM auto-detection. Tests that need services you do not have are skipped:

  • PostgreSQL (team server backend): install the extra with .venv/bin/pip install -e ".[postgres]", then run .venv/bin/python -m pytest tests -m postgres --backend=postgres or --backend=both. Without TAM_TEST_PG_URL the fixtures start a pgvector container through Docker. See CONTRIBUTING.md and .github/workflows/postgres.yml.
  • Browser tests (tests/browser, Playwright with Chromium, Firefox and WebKit) run in the image built from docker/Dockerfile.browser; see the browser job in .github/workflows/smoke.yml.
  • Installed-package smoke test: python tests/smoke/installed_runtime.py checks an installed wheel over local and remote MCP.

Reproducing the benchmarks

The retrieval benchmarks (LoCoMo, LongMemEval, BEAM) need no API key and run with scripts in benchmarks/ once the public datasets are downloaded. Results with the default profile, v13.0.0:

BenchmarkMetricResult
LongMemEval (470 questions)R@5 (recall_any)95.1%
LoCoMo (1,536 questions)R@50.607
BEAM, 1M-token scale (625 probes)R@50.448

Dataset locations, commands, end-to-end (LLM-judged) accuracy, negative controls, latency and the 14.x studies are in docs/benchmarks.md.

Documentation

Citation

A paper describing TAM is under review at the Journal of Open Source Software (paper/paper.md). Until it is published, please cite the software and the preprint:

Cherepanov, V. total-agent-memory (version 14.9.0) [software]. https://github.com/vbcherepanov/total-agent-memory

Preprint: doi:10.5281/zenodo.23011523

Citation metadata for the software is in CITATION.cff.

Contributing

Issues, pull requests and benchmark reproductions are welcome. See CONTRIBUTING.md for the development setup, the rules for a pull request and the commit convention. Report security issues privately as described in SECURITY.md. Donations to support development: PayPal.

License

MIT. See LICENSE. Third-party licenses are listed in THIRD-PARTY-LICENSES.md.

Cài đặt

TypingMind
{
  "mcpServers": {
    "total-agent-memory": {
      "command": "python",
      "args": [
        "-m",
        "total_agent_memory.server"
      ]
    }
  }
}

Dùng MCP Total Agent Memory với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Total Agent Memory, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. Bạn có thể chạy MCP ngay trên thiết bị của mình hoặc kết nối qua URL của máy chủ MCP từ xa.

Cách 1: Dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Total Agent Memory làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Total Agent Memory.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "total-agent-memory": {
      "command": "npx",
      "args": [
        "-y",
        "total-agent-memory"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Total Agent Memory, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Total Agent Memory.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Total Agent Memory giúp tôi làm việc này không?
Total Agent Memory
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Total Agent Memory.

Cách 2: Thêm URL máy chủ MCP

Dùng cách này khi Total Agent Memory đã được lưu trữ từ xa hoặc nhóm của bạn muốn có một trình kết nối dùng chung cho nhiều người dùng.

1

Mở mục Trình kết nối MCP

Trong TypingMind, vào Plugin, mở mục Trình kết nối MCP, rồi chọn Thêm URL.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Vào mục Plugin.
  3. Mở mục Trình kết nối MCP.
  4. Nhấp vào Thêm URL.
Biểu mẫu Thêm URL máy chủ MCP tùy chỉnh của TypingMind
2

Dán URL máy chủ

Nhập URL máy chủ MCP do nhà cung cấp cung cấp vào trường URL máy chủ. Thêm tên kết nối, mô tả, biểu tượng, header HTTP tùy chỉnh hoặc cài đặt ứng dụng khách OAuth nếu máy chủ yêu cầu.

  1. Dán URL máy chủ MCP do nhà cung cấp cung cấp vào trường URL máy chủ.
  2. Nhập tên kết nối cho Total Agent Memory.
  3. Thêm mô tả và biểu tượng nếu bạn muốn dễ nhận biết kết nối hơn.
  4. Thêm header HTTP tùy chỉnh hoặc thông tin ứng dụng khách OAuth nếu máy chủ yêu cầu xác thực.
3

Tạo kết nối

Nhấp vào Tạo kết nối, sau đó quay lại danh sách Plugin và xác nhận kết nối MCP mới đang hoạt động.

  1. Nhấp vào Tạo kết nối.
  2. Quay lại danh sách trình kết nối MCP.
  3. Xác nhận kết nối Total Agent Memory hiển thị trạng thái đang hoạt động.
  4. Làm mới danh sách plugin nếu kết nối chưa xuất hiện ngay.
4

Đổi mô hình mà không cần kết nối lại

Bắt đầu cuộc trò chuyện với mô hình bạn thích, bật các công cụ của Total Agent Memory trong mục Plugin và chuyển sang mô hình khác khi cần. Kết nối MCP vẫn sẵn dùng trong không gian làm việc TypingMind.

  1. Bắt đầu cuộc trò chuyện mới trong TypingMind.
  2. Chọn mô hình AI bạn muốn dùng.
  3. Bật các công cụ của Total Agent Memory trong mục Plugin.
  4. Yêu cầu mô hình dùng công cụ khi cần.
  5. Chuyển sang mô hình AI khác và dùng lại cùng kết nối MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Total Agent Memory giúp tôi làm việc này không?
Total Agent Memory
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Total Agent Memory.

Câu hỏi thường gặp

Máy chủ MCP Total Agent Memory dùng để làm gì?

Total Agent Memory là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Total Agent Memory với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Total Agent Memory với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Total Agent Memory với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Total Agent Memory, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Total Agent Memory với TypingMind?

Bạn có thể kết nối Total Agent Memory trong TypingMind bằng trình kết nối MCP cục bộ hoặc bằng cách thêm URL máy chủ MCP từ xa. Dùng trình kết nối cục bộ khi máy chủ cần truy cập tệp, ứng dụng hoặc tài nguyên riêng trên thiết bị của bạn; dùng URL máy chủ khi máy chủ MCP được lưu trữ từ xa.

MCP Total Agent Memory cung cấp những công cụ nào trong TypingMind?

Total Agent Memory cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Total Agent Memory không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Total Agent Memory yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇