# agent-memory **Repository Path**: xlyjx2012/agent-memory ## Basic Information - **Project Name**: agent-memory - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-28 - **Last Updated**: 2026-09-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Agent Memory (Go) AI Agent 记忆管理系统 — Go 一体化实现。 将原 TypeScript / Python 版本的四大模块(MemoryCore、MemoryProxy、MemoryKnowledge、MemoryPanel)重写为 **单一 Go 二进制**,开箱即用、无需 Docker、无需外部依赖。 ## 特性 - **单二进制部署**:`./agent-memory` 启动所有模块 - **四大模块协同** - **Core**(:8765)— 会话消息存储、归档、元数据管理 - **Proxy**(:8096)— OpenAI / Anthropic LLM 代理、上下文注入管道 - **Knowledge**(:8421)— Wiki + Code Graph 知识库、MCP 工具服务 - **Panel**(:8123)— 管理 API + 嵌入式 Web UI - **多协议支持**:OpenAI Chat Completions、Anthropic Messages、MCP - **本地嵌入模型**:支持 `embeddinggemma-300m` 等 GGUF 模型,无需调用远程 API - **多种存储后端**:SQLite(默认)、腾讯云向量数据库、COS、文件系统、内存 - **优雅关闭**:SIGINT/SIGTERM 信号处理,等待在途请求完成 - **跨平台**:预构建二进制支持 Linux / macOS / Windows,也支持源码交叉编译 ## 快速开始 ### 二进制运行 ```bash # 下载对应平台的二进制(或从源码构建,见 docs/installation.md) ./agent-memory # 默认监听端口 # Core :8765 # Proxy :8096 # Knowledge:8421 # Panel :8123 ``` ### 从源码构建 ```bash git clone cd agent-memory go build -o bin/agent-memory ./cmd/agent-memory ./bin/agent-memory ``` ### 首次配置 ```bash cp configs/config.example.yaml config.yaml # 编辑 config.yaml,按需开启模块、配置 LLM 上游、指定存储后端 ``` 完整配置项说明见 [docs/configuration.md](docs/configuration.md)。 ## 架构 ``` ┌─────────────────────────────────────────────────────────────────┐ │ agent-memory (单二进制) │ ├─────────────────────────────────────────────────────────────────┤ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌────────┐ │ │ │ Panel │ │ Proxy │ │ Knowledge │ │ Core │ │ │ │ :8123 │ │ :8096 │ │ :8421 │ │ :8765 │ │ │ │ (Web UI) │ │ (LLM 代理) │ │ (知识库) │ │(记忆) │ │ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └───┬────┘ │ │ │ │ │ │ │ │ └────────────────┴────────────────┴─────────────┘ │ │ │ │ │ ┌─────────▼─────────┐ │ │ │ Storage Layer │ │ │ │ SQLite / COS / │ │ │ │ Tcvdb / Memory │ │ │ └───────────────────┘ │ └─────────────────────────────────────────────────────────────────┘ ``` ## 项目结构 ``` agent-memory/ ├── cmd/agent-memory/ 程序入口(main.go) ├── internal/ │ ├── app/ 模块编排与优雅关闭 │ ├── core/ MemoryCore 模块 │ ├── proxy/ MemoryProxy 模块 │ ├── knowledge/ MemoryKnowledge 模块 │ ├── panel/ MemoryPanel 模块 │ └── shared/ 共享组件(配置、日志、错误、类型) ├── tests/e2e/ 端到端测试 ├── web/panel/ 前端源码(React + Vite) ├── configs/ 配置示例 ├── docs/ 用户文档 └── openspec/ PRD 实现提案 ``` ## 文档 | 文档 | 说明 | |------|------| | [安装指南](docs/installation.md) | 系统要求、二进制下载、源码编译、首次配置 | | [配置说明](docs/configuration.md) | 完整配置项、环境变量映射、示例配置 | | [API 文档](docs/api.md) | Core / Proxy / Knowledge / Panel 端点参考 | | [PRD 文档](prd/) | 产品需求文档(12 篇) | ## 开发 ### 测试 ```bash # 运行所有单元测试 go test ./... -v -race # 运行端到端测试(tests/e2e/) go test ./tests/e2e/... -v -race -timeout 120s # 带覆盖率 go test ./... -coverprofile=coverage.out go tool cover -func=coverage.out ``` ### 前端 ```bash cd web/panel npm install npm run dev # 开发服务器 npm run build # 构建产物会嵌入到 Go 二进制 ``` ### 交叉编译 ```bash # Linux GOOS=linux GOARCH=amd64 go build -o bin/agent-memory-linux-amd64 ./cmd/agent-memory # macOS (Apple Silicon) GOOS=darwin GOARCH=arm64 go build -o bin/agent-memory-darwin-arm64 ./cmd/agent-memory # Windows GOOS=windows GOARCH=amd64 go build -o bin/agent-memory-windows-amd64.exe ./cmd/agent-memory ``` ## 致谢 本项目是对原 TypeScript / Node.js 版本的 Go 语言重写。原项目位于 [TencentDB-Agent-Memory](https://github.com/)。 ## License MIT