内存搜索
- 作者仓库星标 80,444
- 作者仓库 claude-mem
- 领域
- 数据
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @thedotmack · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
timeline(anchor=11131, depth_before=3, depth_after=3, project="my-project")
第 1 步:搜索 - 获取带 ID 的索引
使用 `search` MCP 工具: 返回:包含 ID、时间戳、类型、标题的表(~50-100 个标记/结果) 参数: `query`(字符串)- 搜索词 `limit`(数字)- 最大结果,默认 20,最大 100
第 2 步:时间轴 - 获取有趣结果的背景信息
使用 `timeline` MCP 工具: 或从查询中自动查找锚点: 返回: `depth_before + 1 + depth_after` 按时间顺序排列的项目,观察、会话和提示在锚点周围交错。参数: `anchor`(数字,可选)- 以观察 ID 为中心
第 3 步:获取 - 仅获取过滤 ID 的完整详细信息
查看第 1 步中的标题和第 2 步中的上下文。选择相关 ID。丢弃其余的。使用 `get_observations` MCP 工具:始终使用 `get_observations` 进行 2 个以上的观察 - 单个请求与 N 个请求。参数:`ids`(数字数组,必需)- 要获取的观察 ID
# Memory Search
Search past work across all sessions. Simple workflow: search -> filter -> fetch.
## When to Use
Use when users ask about PREVIOUS sessions (not current conversation):
- "Did we already fix this?"
- "How did we solve X last time?"
- "What happened last week?"
## 3-Layer Workflow (ALWAYS Follow)
**NEVER fetch full details without filtering first. 10x token savings.**
### Step 1: Search - Get Index with IDs
Use the `search` MCP tool:
```
search(query="authentication", limit=20, project="my-project")
```
**Returns:** Table with IDs, timestamps, types, titles (~50-100 tokens/result)
```
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #11131 | 3:48 PM | 🟣 | Added JWT authentication | ~75 |
| #10942 | 2:15 PM | 🔴 | Fixed auth token expiration | ~50 |
```
**Parameters:**
- `query` (string) - Search term
- `limit` (number) - Max results, default 20, max 100
- `project` (string) - Project name filter
- `type` (string, optional) - "observations", "sessions", or "prompts"
- `obs_type` (string, optional) - Comma-separated: bugfix, feature, decision, discovery, change
- `dateStart` (string, optional) - YYYY-MM-DD or epoch ms
- `dateEnd` (string, optional) - YYYY-MM-DD or epoch ms
- `offset` (number, optional) - Skip N results
- `orderBy` (string, optional) - "date_desc" (default), "date_asc", "relevance"
### Step 2: Timeline - Get Context Around Interesting Results
Use the `timeline` MCP tool:
```
timeline(anchor=11131, depth_before=3, depth_after=3, project="my-project")
```
Or find anchor automatically from query:
```
timeline(query="authentication", depth_before=3, depth_after=3, project="my-project")
```
**Returns:** `depth_before + 1 + depth_after` items in chronological order with observations, sessions, and prompts interleaved around the anchor.
**Parameters:**
- `anchor` (number, optional) - Observation ID to center around
- `query` (string, optional) - Find anchor automatically if anchor not provided
- `depth_before` (number, optional) - Items before anchor, default 5, max 20
- `depth_after` (number, optional) - Items after anchor, default 5, max 20
- `project` (string) - Project name filter
### Step 3: Fetch - Get Full Details ONLY for Filtered IDs
Review titles from Step 1 and context from Step 2. Pick relevant IDs. Discard the rest.
Use the `get_observations` MCP tool:
```
get_observations(ids=[11131, 10942])
```
**ALWAYS use `get_observations` for 2+ observations - single request vs N requests.**
**Parameters:**
- `ids` (array of numbers, required) - Observation IDs to fetch
- `orderBy` (string, optional) - "date_desc" (default), "date_asc"
- `limit` (number, optional) - Max observations to return
- `project` (string, optional) - Project name filter
**Returns:** Complete observation objects with title, subtitle, narrative, facts, concepts, files (~500-1000 tokens each)
## Examples
**Find recent bug fixes:**
```
search(query="bug", type="observations", obs_type="bugfix", limit=20, project="my-project")
```
**Find what happened last week:**
```
search(type="observations", dateStart="2025-11-11", limit=20, project="my-project")
```
**Understand context around a discovery:**
```
timeline(anchor=11131, depth_before=5, depth_after=5, project="my-project")
```
**Batch fetch details:**
```
get_observations(ids=[11131, 10942, 10855], orderBy="date_desc")
```
## Why This Workflow?
- **Search index:** ~50-100 tokens per result
- **Full observation:** ~500-1000 tokens each
- **Batch fetch:** 1 HTTP request vs N individual requests
- **10x token savings** by filtering before fetching
## Knowledge Agents
Want synthesized answers instead of raw records? Use `/knowledge-agent` to build a queryable corpus from your observation history. The knowledge agent reads all matching observations and answers questions conversationally.
章节与文件索引
按说明文件中的顺序排列。
何时使用
三层工作流程(始终遵循)
第 1 步:搜索 - 获取带 ID 的索引
第 2 步:时间轴 - 获取有趣结果的背景信息
第 3 步:获取 - 仅获取过滤 ID 的完整详细信息
文件/命令 -> search · query · limit · project · type · obs_type · dateStart · dateEnd
内容校验值 -> a2b1708afa95
当前原文的自动摘译,尚未人工审校。
何时使用
当用户询问之前的会话(不是当前的对话)时使用:“我们已经解决了这个问题吗?” “上次我们是怎么解决X的?” “上周发生了什么?”
三层工作流程(始终遵循)
切勿在未先过滤的情况下获取完整详细信息。 10 倍代币节省。
第 2 步:时间轴 - 获取有趣结果的背景信息
使用
timelineMCP 工具: 或从查询中自动查找锚点: 返回:depth_before + 1 + depth_after按时间顺序排列的项目,观察、会话和提示在锚点周围交错。参数:anchor(数字,可选)- 以观察 ID 为中心