Satori CLI Integration
Satori persists notable information across AI applications. It stores facts in both vector and knowledge graph databases for later retrieval.
Environment Requirements
Works in: Claude Code, Cursor, Windsurf, or any AI tool with local terminal access.
Authentication
The CLI auto-configures on first run:
- - Checks
~/.config/satori/satori.json for API key and memory ID - If missing, creates the file and provisions new credentials automatically
- No manual setup required
CLI Commands
Save facts:
CODEBLOCK0
Search for context:
CODEBLOCK1
Workflow: Proactive Search
At conversation start, if the user's message suggests existing context would help:
- 1. Extract key entities/topics from user's first message
- Run search command with relevant query
- Parse JSON response to extract relevant facts
- Silently incorporate retrieved context into response
- Do NOT announce "I searched Satori" unless results significantly impact the response
Parsing search results:
The CLI returns JSON. Extract the relevant facts and use them as context:
CODEBLOCK2
Example triggers for proactive search:
- - "Let's continue working on [project]"
- "What's the status of [thing]"
- References to past decisions without full context
- Project names, company names, people names
Workflow: Save Facts
When to Save
Save at natural breakpoints:
- - End of a decision-making discussion
- When user explicitly requests ("remember this", "save this")
- After establishing concrete preferences, names, dates, deadlines
- When significant project context is established
What to Save
See references/fact-criteria.md for detailed criteria.
SAVE - Notable, persistent information:
- - Decisions: "Using PostgreSQL for the database"
- Tech preferences: "User prefers Bun over Node"
- Names/branding: "Company name is Flamingo, they make pink cookies"
- Dates/deadlines: "MVP deadline is March 15"
- Architecture choices: "Microservices with event sourcing"
- Strategic directions: "Targeting enterprise customers first"
- Key contacts: "Sarah is the design lead"
- Project context: "Satori is an AI memory infrastructure company"
DO NOT SAVE - Transient, granular, or obvious:
- - Work-in-progress feedback: "the color scheme needs work"
- Claude's explanations or code snippets
- Temporary debugging context
- Generic preferences derivable from context
- Conversational filler
Save Execution
- 1. Extract notable facts from conversation (see criteria)
- Format as natural language, batch related facts together
- Execute CLI command
- On success: continue silently (fire-and-forget)
- On failure: notify user with error
Batching: The API handles batching, so longer natural language text is fine:
CODEBLOCK3
Error Handling
If CLI fails or isn't installed:
CODEBLOCK4
Fact Formatting
Write facts as clear, standalone statements. Include context so facts make sense when retrieved later:
Good: "Satori project uses PostgreSQL for primary storage and FalkorDB for knowledge graphs"
Bad: "Using Postgres and FalkorDB"
Good: "User prefers Bun runtime over Node.js for all JavaScript/TypeScript projects"
Bad: "Bun not Node"
Satori CLI 集成
Satori 可在 AI 应用间持久化存储重要信息。它将事实同时存储在向量数据库和知识图谱数据库中,以便后续检索。
环境要求
适用环境: Claude Code、Cursor、Windsurf 或任何支持本地终端访问的 AI 工具。
身份验证
CLI 在首次运行时自动配置:
- - 检查 ~/.config/satori/satori.json 中的 API 密钥和记忆 ID
- 如果文件缺失,则自动创建文件并生成新凭证
- 无需手动设置
CLI 命令
保存事实:
bash
npx -y @satori-sh/cli@latest add <事实>
搜索上下文:
bash
npx -y @satori-sh/cli@latest search <查询>
工作流程:主动搜索
在对话开始时,如果用户的消息表明现有上下文会有帮助:
- 1. 从用户的第一条消息中提取关键实体/主题
- 使用相关查询运行搜索命令
- 解析 JSON 响应以提取相关事实
- 将检索到的上下文静默整合到回复中
- 除非结果对回复产生重大影响,否则不要声明我已搜索 Satori
解析搜索结果:
CLI 返回 JSON。提取相关事实并将其用作上下文:
bash
npx -y @satori-sh/cli search Flamingo 项目技术栈
返回包含匹配事实的 JSON - 解析并自然整合
主动搜索的触发示例:
- - 让我们继续处理 [项目]
- [某事物] 的状态如何
- 提及过去决策但缺少完整上下文
- 项目名称、公司名称、人员姓名
工作流程:保存事实
何时保存
在自然断点处保存:
- - 决策讨论结束时
- 当用户明确要求时(记住这个、保存这个)
- 确定具体偏好、名称、日期、截止日期后
- 当建立重要的项目上下文时
保存内容
详细标准请参见 references/fact-criteria.md。
保存 - 重要、持久的信息:
- - 决策:使用 PostgreSQL 作为数据库
- 技术偏好:用户偏好 Bun 而非 Node
- 名称/品牌:公司名称为 Flamingo,他们生产粉色饼干
- 日期/截止日期:MVP 截止日期为 3 月 15 日
- 架构选择:采用事件溯源的微服务架构
- 战略方向:首先瞄准企业客户
- 关键联系人:Sarah 是设计负责人
- 项目上下文:Satori 是一家 AI 记忆基础设施公司
不保存 - 临时、细粒度或显而易见的信息:
- - 进行中的反馈:配色方案需要改进
- Claude 的解释或代码片段
- 临时调试上下文
- 可从上下文推导出的通用偏好
- 对话填充内容
保存执行
- 1. 从对话中提取重要事实(参见标准)
- 格式化为自然语言,将相关事实批量组合
- 执行 CLI 命令
- 成功时:静默继续(即发即忘)
- 失败时:向用户显示错误通知
批量处理: API 支持批量处理,因此较长的自然语言文本也可以:
bash
npx -y @satori-sh/cli add 用户正在构建 Satori,一家 AI 记忆基础设施公司。技术栈:TypeScript、Bun、PostgreSQL。MVP 截止日期为 3 月 15 日。最初瞄准开发者工具市场。
错误处理
如果 CLI 失败或未安装:
⚠️ Satori CLI 错误:[错误信息]
安装方式:npm install -g @satori-sh/cli
事实未保存。是否需要显示我尝试保存的内容?
事实格式化
将事实编写为清晰、独立的陈述。包含上下文,以便后续检索时事实有意义:
正确: Satori 项目使用 PostgreSQL 作为主存储,使用 FalkorDB 作为知识图谱
错误: 使用 Postgres 和 FalkorDB
正确: 用户偏好 Bun 运行时而非 Node.js 用于所有 JavaScript/TypeScript 项目
错误: Bun 不是 Node