# memobase - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 memobase 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **想在安装前理解开源项目价值和边界的用户**：当前证据主要来自项目文档。 Claim：`clm_0002` unverified 0.25

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`CONTRIBUTING.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/site/DOC.md`, `src/server/api/DEVELOPMENT.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `curl -X POST "$PROJECT_URL/api/v1/blobs/insert/{uid}" \` 证据：`docs/site/DOC.md` Claim：`clm_0003` supported 0.86
- `pip install memobase openai` 证据：`docs/site/DOC.md` Claim：`clm_0004` supported 0.86
- `pip install memobase` 证据：`docs/site/DOC.md` Claim：`clm_0004` supported 0.86, `clm_0005` supported 0.86
- `npm install @memobase/memobase` 证据：`docs/site/DOC.md` Claim：`clm_0006` supported 0.86
- `curl -H "Authorization: Bearer $YOUR_API_KEY" "$YOUR_PROJECT_URL/api/v1/healthcheck"` 证据：`docs/site/DOC.md` Claim：`clm_0007` supported 0.86
- `curl -X POST "$YOUR_PROJECT_URL/api/v1/users" \` 证据：`docs/site/DOC.md` Claim：`clm_0008` supported 0.86, `clm_0015` supported 0.86
- `curl -X PUT "$YOUR_PROJECT_URL/api/v1/users/{uid}" \` 证据：`docs/site/DOC.md` Claim：`clm_0009` supported 0.86
- `curl -X GET "$YOUR_PROJECT_URL/api/v1/users/{uid}" \` 证据：`docs/site/DOC.md` Claim：`clm_0010` supported 0.86
- `curl -X DELETE "$YOUR_PROJECT_URL/api/v1/users/{uid}" \` 证据：`docs/site/DOC.md` Claim：`clm_0011` supported 0.86
- `curl -X POST "$YOUR_PROJECT_URL/api/v1/blobs/insert/{uid}" \` 证据：`docs/site/DOC.md` Claim：`clm_0012` supported 0.86

## 继续前判断卡

- **当前建议**：需要管理员/安全审批
- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、本地环境或项目文件、环境变量 / API Key

### 现在可以相信

- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`CONTRIBUTING.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/site/DOC.md`, `src/server/api/DEVELOPMENT.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`docs/site/DOC.md` Claim：`clm_0003` supported 0.86

### 现在还不能相信

- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`docs/site/DOC.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`CONTRIBUTING.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/site/DOC.md`, `src/server/api/DEVELOPMENT.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`CONTRIBUTING.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/site/DOC.md`, `src/server/api/DEVELOPMENT.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`assets/blogs/remember_forget.py`, `assets/episodic_memory.py`, `assets/quickstart.py`, `docs/experiments/900-chats/run.py` 等
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0027` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`CONTRIBUTING.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/site/DOC.md`, `src/server/api/DEVELOPMENT.md` Claim：`clm_0028` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`CONTRIBUTING.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/site/DOC.md`, `src/server/api/DEVELOPMENT.md` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：318
- 重要文件覆盖：40/318
- 证据索引条目：72
- 角色 / Skill 条目：14

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 memobase 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 memobase 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 memobase 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 14 个角色 / Skill / 项目文档条目。

- **Setup**（project_doc）：Use ~900 turns of chats from the ShareGPT dataset to evaluate Memobase 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/experiments/900-chats/readme.md`
- **Running Results from multiple chat sessions**（project_doc）：Running Results from multiple chat sessions This tutorial contains a script to run Memobase Server on mulitple chat sessions. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/experiments/chat_sessions/readme.md`
- **Locomo Benchmark for Various Memory Backends**（project_doc）：Locomo Benchmark for Various Memory Backends 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/experiments/locomo-benchmark/README.md`
- **News**（project_doc）：- 🚀 Meet Acontext https://github.com/memodb-io/Acontext , Context Data Platform that Improves your Agent with Experiences. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`readme.md`
- **Build Voice Agent with Long-term Memory**（project_doc）：Build Voice Agent with Long-term Memory 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/tutorials/livekit+memobase/readme.md`
- **Step 1**（project_doc）：ollama is a tool to pull and run LLMs locally on your computer 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/tutorials/ollama+memobase/readme.md`
- **MemoBase Go Client**（project_doc）：A Go client library for interacting with the MemoBase API. This library allows you to store, retrieve, and manage chat conversation data in MemoBase. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/client/memobase-go/README.md`
- **Memobase TypeScript and JavaScript API Library**（project_doc）：User Profile-Based Memory for GenAI Apps 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/client/memobase-ts/README.md`
- **Overview**（project_doc）：Memobase-MCP: Long-Term Memory for AI Agents 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/mcp/README.md`
- **Memobase Backend API**（project_doc）：Memobase is a user memory system designed for LLM Applications. It provides a FastAPI-based server that manages user profiles, memories, and various types of data blobs. Details of developing it in here ./DEVELOPMENT.md . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/server/api/readme.md`
- **Get started**（project_doc）：config.yaml https://docs.memobase.io/references/full 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/server/readme.md`
- **Contributing to Memobase**（project_doc）：Thank you for your interest in contributing to Memobase! This document provides guidelines and instructions for contributing to the project. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **Memobase API Overview**（project_doc）：=== api-reference/blobs/delete blob.mdx === --- title: 'Delete Blob' openapi: delete /api/v1/blobs/{user id}/{blob id} --- 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/site/DOC.md`
- **Memobase Architecture Guide**（project_doc）：Generated by Claude 3.5 Sonnet Memobase Architecture Guide 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/server/api/DEVELOPMENT.md`

## 证据索引

- 共索引 72 条证据。

- **Setup**（documentation）：Use ~900 turns of chats from the ShareGPT dataset to evaluate Memobase 证据：`docs/experiments/900-chats/readme.md`
- **Running Results from multiple chat sessions**（documentation）：Running Results from multiple chat sessions This tutorial contains a script to run Memobase Server on mulitple chat sessions. 证据：`docs/experiments/chat_sessions/readme.md`
- **Locomo Benchmark for Various Memory Backends**（documentation）：Locomo Benchmark for Various Memory Backends 证据：`docs/experiments/locomo-benchmark/README.md`
- **News**（documentation）：- 🚀 Meet Acontext https://github.com/memodb-io/Acontext , Context Data Platform that Improves your Agent with Experiences. 证据：`readme.md`
- **Build Voice Agent with Long-term Memory**（documentation）：Build Voice Agent with Long-term Memory 证据：`assets/tutorials/livekit+memobase/readme.md`
- **Step 1**（documentation）：ollama is a tool to pull and run LLMs locally on your computer 证据：`assets/tutorials/ollama+memobase/readme.md`
- **MemoBase Go Client**（documentation）：A Go client library for interacting with the MemoBase API. This library allows you to store, retrieve, and manage chat conversation data in MemoBase. 证据：`src/client/memobase-go/README.md`
- **Memobase TypeScript and JavaScript API Library**（documentation）：User Profile-Based Memory for GenAI Apps 证据：`src/client/memobase-ts/README.md`
- **Overview**（documentation）：Memobase-MCP: Long-Term Memory for AI Agents 证据：`src/mcp/README.md`
- **Memobase Backend API**（documentation）：Memobase is a user memory system designed for LLM Applications. It provides a FastAPI-based server that manages user profiles, memories, and various types of data blobs. Details of developing it in here ./DEVELOPMENT.md . 证据：`src/server/api/readme.md`
- **Get started**（documentation）：config.yaml https://docs.memobase.io/references/full 证据：`src/server/readme.md`
- **Contributing to Memobase**（documentation）：Thank you for your interest in contributing to Memobase! This document provides guidelines and instructions for contributing to the project. 证据：`CONTRIBUTING.md`
- **Package**（package_manifest）：{ "name": "@memobase/memobase", "version": "0.0.18", "main": "dist/index.js", "types": "dist/index.d.ts", "files": "dist" , "scripts": { "build": "rm -rf ./dist && tsc", "test": "jest", "prepare": "chmod -R +x ./scripts/ && npm run build", "lint": "./scripts/lint", "fix": "./scripts/format" }, "keywords": "retrieval", "memory", "rag", "chatgpt", "llm-application", "user-memory" , "author": "Memobase ", "license": "Apache-2.0", "description": "Client SDK for Memobase", "devDependencies": { "@types/jest": "^29.5.14", "@types/node": "^24.0.1", "@typescript-eslint/eslint-plugin": "^8.34.0", "@typescript-eslint/parser": "^8.34.0", "eslint": "^9.28.0", "eslint-plugin-prettier": "^5.4.1", "eslint-… 证据：`src/client/memobase-ts/package.json`
- **License**（source_file）：Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ 证据：`LICENSE`
- **Memobase API Overview**（documentation）：=== api-reference/blobs/delete blob.mdx === --- title: 'Delete Blob' openapi: delete /api/v1/blobs/{user id}/{blob id} --- 证据：`docs/site/DOC.md`
- **Memobase Architecture Guide**（documentation）：Generated by Claude 3.5 Sonnet Memobase Architecture Guide 证据：`src/server/api/DEVELOPMENT.md`
- **Extract**（source_file）：USER = "user1" parser = argparse.ArgumentParser ⋮---- args = parser.parse args USER = args.user PROJECT URL = args.project url PROJECT TOKEN = args.project token client = MemoBaseClient hclient = Client total files = sorted os.listdir f"./chats/{USER}" total files = t for t in total files if t.endswith ".json" sessions = ⋮---- messages = json.load f ⋮---- uid = client.add user ⋮---- u = client.get user uid ⋮---- messages = session "messages" blobs = ⋮---- start = time ⋮---- prompts = m.describe for m in u.profile 证据：`docs/experiments/chat_sessions/extract.py`
- **Initialize SentenceTransformer model this will be reused**（source_file）：Initialize SentenceTransformer model this will be reused ⋮---- sentence model = SentenceTransformer 'all-MiniLM-L6-v2' ⋮---- sentence model = None def simple tokenize text ⋮---- """Simple tokenization function.""" Convert to string if not already text = str text ⋮---- def calculate rouge scores prediction: str, reference: str - Dict str, float ⋮---- """Calculate ROUGE scores for prediction against reference.""" scorer = rouge scorer.RougeScorer 'rouge1', 'rouge2', 'rougeL' , use stemmer=True scores = scorer.score reference, prediction ⋮---- def calculate bleu scores prediction: str, reference: str - Dict str, float ⋮---- """Calculate BLEU scores with different n-gram settings.""" pred token… 证据：`docs/experiments/locomo-benchmark/metrics/utils.py`
- **Init**（source_file）：all = "MemobaseADD", "MemobaseSearch" 证据：`docs/experiments/locomo-benchmark/src/memobase_client/__init__.py`
- **Config**（source_file）：language: en overwrite user profiles: - topic: "basic info" sub topics: - name: "gender" - name: "name" - name: "birth date" - name: "location" - topic: "personal narrative" sub topics: - name: "identity journey" - name: "self acceptance" - name: "emotional states" - name: "life milestones" - topic: "life circumstances" sub topics: - name: "career" - name: "education" - name: "family status" - name: "living situation" - topic: "personal growth" sub topics: - name: "hobbies" - name: "creative pursuits" - name: "mental health" - name: "self care activities" - topic: "plans" sub topics: - name: "career goals" - name: "personal aspirations" - name: "family planning" - name: "life goals" 证据：`docs/experiments/locomo-benchmark/src/memobase_client/config.yaml`
- **Utils**（source_file）：TECHNIQUES = "mem0", "rag", "langmem", "zep", "openai", "memobase" METHODS = "add", "search" 证据：`docs/experiments/locomo-benchmark/src/utils.py`
- **Client**（source_file）：package core import "bytes" "encoding/json" "fmt" "net/http" "os" "time" "github.com/memodb-io/memobase/src/client/memobase-go/network" ⋮---- "bytes" "encoding/json" "fmt" "net/http" "os" "time" "github.com/memodb-io/memobase/src/client/memobase-go/network" ⋮---- type MemoBaseClient struct { ProjectURL string APIKey string APIVersion string BaseURL string HTTPClient http.Client } func NewMemoBaseClient projectURL string, apiKey string MemoBaseClient, error type authTransport struct { apiKey string base http.RoundTripper } func t authTransport RoundTrip req http.Request http.Response, error func c MemoBaseClient Ping bool func c MemoBaseClient AddUser data map string interface func c MemoBas… 证据：`src/client/memobase-go/core/client.go`
- **Types**（source_file）：package core import "time" "github.com/google/uuid" ⋮---- "time" "github.com/google/uuid" ⋮---- type UserProfileData struct { ID uuid.UUID json:"id" Content string json:"content" Attributes struct { Topic string json:"topic" SubTopic string json:"sub topic" } json:"attributes" type ProfileDelta struct { Content string json:"content" Attributes map string interface{} json:"attributes" type EventTag struct { Tag string json:"tag" Value string json:"value" } type EventData struct { ProfileDelta ProfileDelta json:"profile delta" EventTip string json:"event tip,omitempty" EventTags EventTag json:"event tags,omitempty" } type UserEventData struct { ID uuid.UUID json:"id" EventData EventData json:… 证据：`src/client/memobase-go/core/types.go`
- **User**（source_file）：package core import "bytes" "encoding/json" "fmt" "net/http" "net/url" "github.com/memodb-io/memobase/src/client/memobase-go/blob" "github.com/memodb-io/memobase/src/client/memobase-go/network" ⋮---- "bytes" "encoding/json" "fmt" "net/http" "net/url" "github.com/memodb-io/memobase/src/client/memobase-go/blob" "github.com/memodb-io/memobase/src/client/memobase-go/network" ⋮---- type User struct { UserID string ProjectClient MemoBaseClient Fields map string interface{} func u User Insert blob blob.BlobInterface, sync bool string, error func u User Get blobID string blob.BlobInterface, error ⋮---- var blobData blob.BlobData ⋮---- func u User GetAll blobType blob.BlobType, page int, pageSize in… 证据：`src/client/memobase-go/core/user.go`
- **Client**（source_file）：import { User } from './user'; import { unpackResponse } from './network'; import type { BaseResponse, HttpUrl, GetConfigResponse, GetProjectUsersResponse, GetProjectUsageItemResponse } from './types'; export class MemoBaseClient ⋮---- constructor projectUrl: string, private readonly apiKey?: string, private readonly apiVersion: string = 'api/v1', async fetch path: string, init?: RequestInit : Promise async ping : Promise async getConfig : Promise async updateConfig config: string : Promise async addUser data?: Record , id?: string : Promise async updateUser userId: string, data?: Record : Promise async getUsers search: string = "", order by: "updated at" "profile count" "event count" = "up… 证据：`src/client/memobase-ts/src/client.ts`
- **Init**（source_file）：author = "memobase.io" version = "0.0.27" url = "https://github.com/memodb-io/memobase" license = "Apache-2.0" 证据：`src/client/memobase/__init__.py`
- **Async Entry**（source_file）：def profiles to json profiles: list UserProfile - dict ⋮---- results = defaultdict dict ⋮---- @dataclass class AsyncMemoBaseClient ⋮---- api key: Optional str = None api version: str = "api/v1" project url: str = "https://api.memobase.dev" def post init self ⋮---- @property def client self - httpx.AsyncClient async def ping self - bool async def get usage self - dict ⋮---- r = unpack response await self. client.get "/project/billing" ⋮---- async def get config self - str ⋮---- r = unpack response await self. client.get "/project/profile config" ⋮---- async def update config self, config: str - bool ⋮---- r = unpack response ⋮---- async def add user self, data: dict = None, id=None - str asy… 证据：`src/client/memobase/core/async_entry.py`
- **Blob**（source_file）：class OpenAICompatibleMessage BaseModel ⋮---- role: Literal "user", "assistant" content: str alias: Optional str = None created at: Optional str = None class TranscriptStamp BaseModel ⋮---- start timestamp in seconds: float end time timestamp in seconds: Optional float = None speaker: Optional str = None class BlobType StrEnum ⋮---- chat = "chat" summary = "summary" doc = "doc" image = "image" code = "code" transcript = "transcript" class Blob BaseModel ⋮---- type: BlobType fields: Optional dict = None created at: Optional datetime = None def get blob data self def to request self class ChatBlob Blob ⋮---- messages: list OpenAICompatibleMessage type: Literal BlobType.chat = BlobType.chat cl… 证据：`src/client/memobase/core/blob.py`
- **Entry**（source_file）：def profiles to json profiles: list UserProfile - dict ⋮---- results = defaultdict dict ⋮---- @dataclass class MemoBaseClient ⋮---- api key: Optional str = None api version: str = "api/v1" project url: str = "https://api.memobase.dev" def post init self ⋮---- @property def client self - httpx.Client def ping self - bool def get config self - str ⋮---- r = unpack response self. client.get "/project/profile config" ⋮---- def update config self, config: str - bool ⋮---- r = unpack response ⋮---- def get usage self - dict ⋮---- r = unpack response self. client.get "/project/billing" ⋮---- def add user self, data: dict = None, id=None - str ⋮---- r = unpack response self. client.post "/users", j… 证据：`src/client/memobase/core/entry.py`
- **Utils**（source_file）：LOG = logging.getLogger "memobase" def string to uuid s: str, salt="memobase client" - str 证据：`src/client/memobase/utils.py`
- **Utils**（source_file）：def get memobase client ⋮---- client = AsyncMemoBaseClient 证据：`src/mcp/src/utils.py`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o language: en event tags: - name: "mental health" description: You need to look at user's mental health status and pick the most relevant tag from the following list: - depression - anxiety - stress - anger - sadness - happiness 证据：`src/server/api/example_config/event_tag/config.yaml`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o embedding provider: jina embedding api key: jina XXXX embedding model: jina-embeddings-v3 embedding dim: 1024 language: en 证据：`src/server/api/example_config/jina_embedding/config.yaml`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o embedding provider: ollama embedding api key: ollama embedding base url: "http://127.0.0.1:11434/" embedding model: "qwen3-embedding:4b-q4 K M" embedding dim: 2560 language: en 证据：`src/server/api/example_config/ollama_embedding/config.yaml`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o enable event embedding: false enable event summary: false profile strict mode: true overwrite user profiles: - topic: "basic info" sub topics: - name: "name" - name: "age" - name: "gender" - name: "occupation" description: "user's professional background" - name: "location" - name: "languages" description: "languages the user speaks" - name: "timezone" description: "user's local timezone for scheduling" 证据：`src/server/api/example_config/only_strict_profile/config.yaml`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o overwrite user profiles: - topic: "basic info" sub topics: - name: "name" - name: "age" - name: "gender" - name: "occupation" - name: "location" - name: "timezone" description: "user's local timezone for scheduling" - name: "languages" description: "preferred languages for communication" - name: "contact info" description: "preferred contact methods" - topic: "schedule prefs" sub topics: - name: "work hours" description: "typical working schedule" - name: "sleep schedule" description: "usual sleep and wake times" - name: "meeting prefs" description: "preferred meeting times and duration" - name: "break times" d… 证据：`src/server/api/example_config/profile_for_assistant/config.yaml`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o overwrite user profiles: - topic: "basic info" sub topics: - name: "name" - name: "age" - name: "gender" - name: "occupation" description: "user's professional background" - name: "location" - name: "languages" description: "languages the user speaks" - name: "timezone" description: "user's local timezone for scheduling" - topic: "companion preferences" sub topics: - name: "companion type" description: "preferred ai companion personality type" - name: "interaction style" description: "formal, casual, friendly, professional etc." - name: "communication freq" description: "how often they want to interact with the… 证据：`src/server/api/example_config/profile_for_companion/config.yaml`
- **Config**（source_file）：llm api key: XXX llm base url: https://api.openai.com/v1/ best llm model: gpt-4o overwrite user profiles: - topic: "basic info" sub topics: - name: "name" - name: "age" - name: "gender" - name: "grade level" description: "current academic grade or level" - name: "school type" description: "public, private, homeschool, university etc." - name: "location" - name: "primary language" - name: "learning languages" description: "languages being studied" - topic: "academic profile" sub topics: - name: "major subjects" description: "main subjects being studied" - name: "weak subjects" description: "subjects needing improvement" - name: "strong subjects" description: "subjects with good performance"… 证据：`src/server/api/example_config/profile_for_education/config.yaml`
- **Init**（source_file）：version = "0.0.42" author = "memobase.io" url = "https://github.com/memodb-io/memobase" license = "Apache-2.0" 证据：`src/server/api/memobase_server/__init__.py`
- **need to process buffer**（source_file）：project id = request.state.memobase project id ⋮---- p = await controllers.billing.get project billing project id ⋮---- billing = p.data ⋮---- insert result = await controllers.blob.insert blob ⋮---- bid = insert result.data .id pb = await controllers.buffer.insert blob to buffer ⋮---- process ids = await controllers.buffer.detect buffer full or not ⋮---- final results = need to process buffer ⋮---- sync p = await controllers.buffer.flush buffer by ids ⋮---- async ⋮---- p = await controllers.blob.get blob user id, project id, blob id ⋮---- p = await controllers.blob.remove blob user id, project id, blob id 证据：`src/server/api/memobase_server/api_layer/blob.py`
- **Buffer**（source_file）：project id = request.state.memobase project id p = await controllers.buffer.get unprocessed buffer ids ⋮---- p = await controllers.buffer.flush buffer by ids 证据：`src/server/api/memobase_server/api_layer/buffer.py`
- **Init**（source_file）：all = "API X CODE DOCS" 证据：`src/server/api/memobase_server/api_layer/docs/__init__.py`
- **await capture int key TelemetryKeyName.has request**（source_file）：PATH MAPPINGS = async def global wrapper middleware request: Request, call next ⋮---- req id = request.headers.get "X-Request-ID" ⋮---- req id = str uuid.uuid4 project id = getattr request.state, "memobase project id", None ⋮---- url = get path with query string request.scope client host = request.client.host client port = request.client.port http method = request.method http version = request.scope "http version" start time = time.perf counter ns ⋮---- response = await call next request status code = response.status code errmsg = None traceback str = None ⋮---- status code = 500 errmsg = f"Sorry, we have encountered an unknown error: \n{e}\nPlease report this issue to https://github.com/me… 证据：`src/server/api/memobase_server/api_layer/middleware.py`
- **Roleplay**（source_file）：project id = request.state.memobase project id topic limits json = topic limits json or "{}" ⋮---- topic limits = res.StrIntData data=json.loads topic limits json .data ⋮---- p = await proactive topics.process messages 证据：`src/server/api/memobase_server/api_layer/roleplay.py`
- **Blob**（source_file）：async def insert blob user id: str, project id: str, blob: BlobData - Promise IdData ⋮---- blob parsed = blob.to blob ⋮---- blob db = GeneralBlob ⋮---- b id = blob db.id ⋮---- async def get blob user id: str, project id: str, blob id: str - Promise BlobData ⋮---- blob db = ⋮---- rt blob = BlobData ⋮---- async def remove blob user id: str, project id: str, blob id: str - Promise None 证据：`src/server/api/memobase_server/controllers/blob.py`
- **FIXME: parallel calling will cause duplicated flush**（source_file）：buffer count = ⋮---- buffer = BufferZone ⋮---- p = await get unprocessed buffer ids user id, project id, blob type ⋮---- p = await flush buffer by ids user id, project id, blob type, p.data .ids ⋮---- buffer zone = buffer ids = row.id for row in buffer zone buffer token size = sum row.token size for row in buffer zone ⋮---- buffer ids = ⋮---- FIXME: parallel calling will cause duplicated flush ⋮---- Join BufferZone with GeneralBlob to get all data in one query buffer blob data = process buffer ids = row.buffer id for row in buffer blob data ⋮---- blob ids = row.blob id for row in buffer blob data blobs = pack blob from db row, blob type for row in buffer blob data total token size = sum row… 证据：`src/server/api/memobase_server/controllers/buffer.py`
- **Init**（source_file）：BlobProcessFunc = Callable BLOBS PROCESS: dict BlobType, BlobProcessFunc = { 证据：`src/server/api/memobase_server/controllers/modal/__init__.py`
- **4. Re-summary profiles if any slot is too big**（source_file）：results = total token size = 0 ⋮---- ts = len get encoded tokens get blob str b ⋮---- blobs = truncate chat blobs blobs, CONFIG.max chat blob buffer process token size ⋮---- p = await get project profile config project id ⋮---- project profiles = p.data p = await get user profiles user id, project id ⋮---- current user profiles = p.data p = await entry chat summary ⋮---- user memo str = p.data .strip ⋮---- processing results = await asyncio.gather profile results: Promise = processing results 0 event results: Promise = processing results 1 ⋮---- event tags = event results.data p = await handle session event ⋮---- eid = p.data p = await handle user profile db user id, project id, intermediat… 证据：`src/server/api/memobase_server/controllers/modal/chat/__init__.py`
- **Event Summary**（source_file）：event tags = read out event tags config available event tags = set et.name for et in event tags ⋮---- event tags str = "\n".join f"- {et.name} {et.description} " for et in event tags r = await llm complete ⋮---- parsed event tags = parse string into subtopics r.data parsed event tags = strict parsed event tags = 证据：`src/server/api/memobase_server/controllers/modal/chat/event_summary.py`
- **Extract**（source_file）：def merge by topic sub topics new facts: list FactResponse ⋮---- topic subtopic = {} ⋮---- key = nf ContanstTable.topic , nf ContanstTable.sub topic ⋮---- profiles = current user profiles.profiles CURRENT PROFILE INFO = pack current user profiles USE LANGUAGE = CURRENT PROFILE INFO "use language" STRICT MODE = CURRENT PROFILE INFO "strict mode" project profiles slots = CURRENT PROFILE INFO "project profile slots" p = await llm complete ⋮---- results = p.data parsed facts: AIUserProfiles = parse string into profiles results new facts: list FactResponse = parsed facts.model dump "facts" ⋮---- new facts = merge by topic sub topics new facts fact contents = fact attributes = 证据：`src/server/api/memobase_server/controllers/modal/chat/extract.py`
- **session merge validate results "delete" .append runtime profile.id**（source_file）：DEFINE MAPS = { RUNTIME MAPS = { profile session results: MergeAddResult = { tasks = ⋮---- task = handle profile merge or valid ⋮---- KEY = USE LANGUAGE = config.language or CONFIG.language PROFILE VALIDATE MODE = runtime profile = profile runtime maps.get KEY, None define sub topic = profile define maps.get KEY, SubTopic name="" ⋮---- r = await llm complete ⋮---- update response: UpdateResponse None = parse string into merge action r.data ⋮---- oneline response = r.data .replace "\n", " " ⋮---- session merge validate results "delete" .append runtime profile.id 证据：`src/server/api/memobase_server/controllers/modal/chat/merge.py`
- **Merge Yolo**（source_file）：DEFINE MAPS = { RUNTIME MAPS = { USE LANGUAGE = config.language or CONFIG.language PROFILE VALIDATE MODE = profile session results: MergeAddResult = { tasks = new memos = ⋮---- KEY = runtime profile = RUNTIME MAPS.get KEY, None define sub topic = DEFINE MAPS.get KEY, SubTopic name="" ⋮---- new memos input = {"memo id": i + 1, m 0 } for i, m in enumerate new memos r = await llm complete oneline response = r.data .replace "\n", " " ⋮---- memo actions = parse string into merge yolo action r.data abort infos = ⋮---- update response = memo actions.get i + 1, None ⋮---- KEY = f a ContanstTable.topic , f a ContanstTable.sub topic 证据：`src/server/api/memobase_server/controllers/modal/chat/merge_yolo.py`
- **Utils**（source_file）：class PackCurrentUserProfilesResult TypedDict ⋮---- already topics prompt: str allowed topic subtopics: set tuple str, str already topic subtopics values: dict tuple str, str , str project profile slots: list UserProfileTopic use language: str strict mode: bool ⋮---- profiles = current user profiles.profiles USE LANGUAGE = project profiles.language or CONFIG.language STRICT MODE = project profiles slots = read out profile config ⋮---- allowed topic subtopics = set ⋮---- allowed topic subtopics = None ⋮---- already topics subtopics = set already topic subtopics values = { ⋮---- already topics subtopics = already topics subtopics.intersection ⋮---- already topics subtopics = sorted already to… 证据：`src/server/api/memobase_server/controllers/modal/chat/utils.py`
- **Init**（source_file）：def pack summary blobs: list Blob - str async def process blobs user id: str, project id: str, blobs: list Blob ⋮---- p = await get project profile config project id ⋮---- project profiles = p.data p = await get user profiles user id, project id ⋮---- current user profiles = p.data user memo str = pack summary blobs processing results = await asyncio.gather profile results: Promise = processing results 0 event results: Promise = processing results 1 ⋮---- event tags = event results.data p = await handle session event ⋮---- eid = p.data p = await handle user profile db user id, project id, intermediate profile 证据：`src/server/api/memobase_server/controllers/modal/summary/__init__.py`
- **Utils**（source_file）：JSON BODY REGEX = re.compile r" { \s\S } " def try json loads content: str - dict None 证据：`src/server/api/memobase_server/controllers/modal/utils.py`
- **TODO: add TPM/Rate limiter**（source_file）：FACTORIES = {"openai": openai complete, "doubao cache": doubao cache complete} ⋮---- TODO: add TPM/Rate limiter ⋮---- use model = model or CONFIG.best llm model ⋮---- start time = time.time results = await FACTORIES CONFIG.llm style latency = time.time - start time 1000 ⋮---- in tokens = len out tokens = len get encoded tokens results ⋮---- parse dict = convert response to json results ⋮---- async def llm sanity check ⋮---- r = await llm complete 证据：`src/server/api/memobase_server/llms/__init__.py`
- **Init**（source_file）：FACTORIES = {"openai": openai embedding, "jina": jina embedding, "lmstudio": lmstudio embedding, "ollama": ollama embedding} ⋮---- async def check embedding sanity ⋮---- r = await get embedding DEFAULT PROJECT ID, "Hello, world!" ⋮---- d = r.data embedding dim = d.shape -1 ⋮---- model = model or CONFIG.embedding model ⋮---- start time = time.time results = await FACTORIES CONFIG.embedding provider model, texts, phase latency ms = time.time - start time 1000 ⋮---- embedding tokens = len get encoded tokens "\n".join texts 证据：`src/server/api/memobase_server/llms/embeddings/__init__.py`
- **Utils**（source_file）：global openai async client = None global jina async client = None global lmstudio async client = None global ollama async client = None def get openai async client instance - AsyncOpenAI ⋮---- global openai async client = AsyncOpenAI ⋮---- def get jina async client instance - AsyncClient ⋮---- global jina async client = AsyncClient ⋮---- def get lmstudio async client instance - AsyncClient ⋮---- global lmstudio async client = AsyncClient ⋮---- def get ollama async client instance - AsyncClient ⋮---- global ollama async client = AsyncClient 证据：`src/server/api/memobase_server/llms/embeddings/utils.py`
- **Utils**（source_file）：global openai async client = None global doubao async client = None def get openai async client instance - AsyncOpenAI ⋮---- global openai async client = AsyncOpenAI ⋮---- def get doubao async client instance - AsyncArk ⋮---- global doubao async client = AsyncArk api key=CONFIG.llm api key ⋮---- def exclude special kwargs kwargs: dict ⋮---- prompt id = kwargs.pop "prompt id", None no cache = kwargs.pop "no cache", None 证据：`src/server/api/memobase_server/llms/utils.py`
- **Blob**（source_file）：class OpenAICompatibleMessage BaseModel ⋮---- role: Literal "user", "assistant" content: str alias: Optional str = None created at: Optional str = None class TranscriptStamp BaseModel ⋮---- start timestamp in seconds: float end time timestamp in seconds: Optional float = None speaker: Optional str = None class BlobType StrEnum ⋮---- chat = "chat" summary = "summary" doc = "doc" image = "image" code = "code" transcript = "transcript" class Blob BaseModel ⋮---- type: BlobType fields: Optional dict = None created at: Optional datetime = None def get blob data self def to request self class ChatBlob Blob ⋮---- messages: list OpenAICompatibleMessage type: Literal BlobType.chat = BlobType.chat cl… 证据：`src/server/api/memobase_server/models/blob.py`
- 其余 12 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/experiments/900-chats/readme.md`, `docs/experiments/chat_sessions/readme.md`, `docs/experiments/locomo-benchmark/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/experiments/900-chats/readme.md`, `docs/experiments/chat_sessions/readme.md`, `docs/experiments/locomo-benchmark/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **Overview and Quickstart Guide**：importance `high`
  - source_paths: readme.md, src/client/memobase/__init__.py, src/server/readme.md, src/server/api/readme.md
- **Backend Architecture and API Layer**：importance `high`
  - source_paths: src/server/api/api.py, src/server/api/memobase_server/api_layer/__init__.py, src/server/api/memobase_server/models/database.py, src/server/api/memobase_server/controllers/__init__.py, src/server/api/memobase_server/connectors.py
- **Client SDKs and MCP Integration**：importance `high`
  - source_paths: src/client/memobase/core/entry.py, src/client/memobase/core/async_entry.py, src/client/memobase/core/blob.py, src/client/memobase-go/core/client.go, src/client/memobase-go/core/user.go
- **LLM Integration and Memory Processing Pipeline**：importance `high`
  - source_paths: src/server/api/memobase_server/controllers/modal/chat/extract.py, src/server/api/memobase_server/controllers/modal/chat/merge.py, src/server/api/memobase_server/controllers/modal/chat/event_summary.py, src/server/api/memobase_server/controllers/buffer.py, src/server/api/memobase_server/controllers/buffer_background.py

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `358c16bbc6d687937d79bc2f984a11c3be8da901`
- inspected_files: `readme.md`, `requirements.txt`, `docs/experiments/900-chats/readme.md`, `docs/experiments/900-chats/run.py`, `docs/experiments/900-chats/run_mem0.py`, `docs/experiments/900-chats/sharegpt_test_7uOhOjo.json`, `docs/experiments/chat_sessions/chats/mock_user/1.json`, `docs/experiments/chat_sessions/chats/mock_user/2.json`, `docs/experiments/chat_sessions/extract.py`, `docs/experiments/chat_sessions/readme.md`, `docs/experiments/locomo-benchmark/README.md`, `docs/experiments/locomo-benchmark/compute_p95_latency.py`, `docs/experiments/locomo-benchmark/evals.py`, `docs/experiments/locomo-benchmark/fixture/memobase/memobase_eval_0503_3000.json`, `docs/experiments/locomo-benchmark/fixture/memobase/memobase_eval_0710_3000.json`, `docs/experiments/locomo-benchmark/fixture/memobase/results_0503_3000.json`, `docs/experiments/locomo-benchmark/fixture/memobase/results_0710_3000.json`, `docs/experiments/locomo-benchmark/generate_scores.py`, `docs/experiments/locomo-benchmark/metrics/llm_judge.py`, `docs/experiments/locomo-benchmark/metrics/utils.py`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：“add_user” and “update_user” handle additional data differently

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：“add_user” and “update_user” handle additional data differently
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/memodb-io/memobase/issues/155 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：Your AI needs an identity — here's how to fix that

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Your AI needs an identity — here's how to fix that
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/memodb-io/memobase/issues/158 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：memobase embedding模型维度不匹配

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：memobase embedding模型维度不匹配
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/memodb-io/memobase/issues/76 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：[Question] : user_event_gist 在执行插入是否有重复事件去重操作

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：[Question] : user_event_gist 在执行插入是否有重复事件去重操作
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/memodb-io/memobase/issues/159 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | https://github.com/memodb-io/memobase | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 来源证据：search_event returns KeyError 'events'

- Trigger: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：search_event returns KeyError 'events'
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/memodb-io/memobase/issues/137 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | https://github.com/memodb-io/memobase | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://github.com/memodb-io/memobase | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://github.com/memodb-io/memobase | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 来源证据：Error in get_embedding: Failed to embed texts: 404 page not found Traceback (most recent call last)

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Error in get_embedding: Failed to embed texts: 404 page not found Traceback (most recent call last)
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/memodb-io/memobase/issues/153 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
