memory

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memory - Persistent Knowledge Storage

Memory - 持久化知识存储

Store and retrieve knowledge across sessions using semantic search.
通过语义搜索跨会话存储和检索知识。

Prerequisites

前置要求

Install basic-memory:
bash
pip install basic-memory
安装basic-memory:
bash
pip install basic-memory

CLI Reference

CLI参考

Write a Note

撰写笔记

bash
undefined
bash
undefined

Basic note

基础笔记

basic-memory tool write-note --title "Note Title" --content "Note content in markdown"
basic-memory tool write-note --title "Note Title" --content "Note content in markdown"

With tags

带标签

basic-memory tool write-note --title "React Patterns" --content "# Content here" --tags "react,patterns,frontend"
basic-memory tool write-note --title "React Patterns" --content "# Content here" --tags "react,patterns,frontend"

To specific folder

保存到指定文件夹

basic-memory tool write-note --title "Meeting Notes" --content "# Notes" --folder "meetings"
basic-memory tool write-note --title "Meeting Notes" --content "# Notes" --folder "meetings"

With specific project

关联指定项目

basic-memory tool write-note --title "Project Notes" --content "# Notes" --project myproject
undefined
basic-memory tool write-note --title "Project Notes" --content "# Notes" --project myproject
undefined

Read a Note

读取笔记

bash
undefined
bash
undefined

By identifier/permalink

通过标识符/永久链接

basic-memory tool read-note "note-title"
basic-memory tool read-note "note-title"

From specific project

从指定项目读取

basic-memory tool read-note "note-title" --project myproject
undefined
basic-memory tool read-note "note-title" --project myproject
undefined

Search Memories

搜索记忆内容

bash
undefined
bash
undefined

Semantic search (query is positional)

语义搜索(查询词为位置参数)

basic-memory tool search-notes "your search query"
basic-memory tool search-notes "your search query"

Limit results

限制结果数量

basic-memory tool search-notes "react hooks" --page-size 10
basic-memory tool search-notes "react hooks" --page-size 10

Search by permalink

通过永久链接搜索

basic-memory tool search-notes "pattern" --permalink
basic-memory tool search-notes "pattern" --permalink

Search by title

通过标题搜索

basic-memory tool search-notes "meeting" --title
basic-memory tool search-notes "meeting" --title

Filter by date

按日期过滤

basic-memory tool search-notes "feature" --after_date "7d"
basic-memory tool search-notes "feature" --after_date "7d"

With specific project

关联指定项目搜索

basic-memory tool search-notes "authentication" --project myproject
undefined
basic-memory tool search-notes "authentication" --project myproject
undefined

Build Context for a Topic

为主题构建上下文

bash
undefined
bash
undefined

Get related notes for a URL/topic (URL is positional)

获取URL/主题的相关笔记(URL为位置参数)

basic-memory tool build-context "memory://topic/authentication"
basic-memory tool build-context "memory://topic/authentication"

With depth and timeframe

指定深度和时间范围

basic-memory tool build-context "memory://note/my-note" --depth 2 --timeframe 30d
basic-memory tool build-context "memory://note/my-note" --depth 2 --timeframe 30d

With specific project

关联指定项目

basic-memory tool build-context "memory://topic/api" --project myproject
undefined
basic-memory tool build-context "memory://topic/api" --project myproject
undefined

List Recent Activity

查看近期活动

bash
undefined
bash
undefined

Default (depth 1, 7 days)

默认设置(深度1,7天)

basic-memory tool recent-activity
basic-memory tool recent-activity

With depth

指定深度

basic-memory tool recent-activity --depth 3
basic-memory tool recent-activity --depth 3

With timeframe

指定时间范围

basic-memory tool recent-activity --timeframe 30d
basic-memory tool recent-activity --timeframe 30d

Combined

组合设置

basic-memory tool recent-activity --depth 3 --timeframe 14d
undefined
basic-memory tool recent-activity --depth 3 --timeframe 14d
undefined

Continue Conversation

继续对话

bash
undefined
bash
undefined

Get prompt to continue previous work

获取用于延续之前工作的提示

basic-memory tool continue-conversation "previous topic or context"
undefined
basic-memory tool continue-conversation "previous topic or context"
undefined

Sync Database

同步数据库

bash
basic-memory sync
bash
basic-memory sync

Check Status

检查状态

bash
basic-memory status
bash
basic-memory status

Note Format

笔记格式

Notes are stored as markdown with YAML frontmatter:
markdown
---
title: My Note
tags: [tag1, tag2]
created: 2024-01-15
---
笔记以带YAML前置元数据的markdown格式存储:
markdown
---
title: My Note
tags: [tag1, tag2]
created: 2024-01-15
---

My Note

My Note

Content here in markdown format.
Content here in markdown format.

Sections

Sections

More content...
undefined
More content...
undefined

Workflow Patterns

工作流模式

Save Learning

保存学习内容

When you discover something useful:
bash
basic-memory tool write-note \
  --title "TypeScript Utility Types" \
  --content "# Utility Types\n\n- Partial<T> - Makes all properties optional\n- Required<T> - Makes all properties required\n- Pick<T, K> - Picks specific properties" \
  --tags "typescript,types,reference"
当你发现有用的内容时:
bash
basic-memory tool write-note \
  --title "TypeScript Utility Types" \
  --content "# 工具类型\n\n- Partial<T> - 将所有属性设为可选\n- Required<T> - 将所有属性设为必填\n- Pick<T, K> - 选择特定属性" \
  --tags "typescript,types,reference"

Save Decision

保存决策记录

When making an architectural decision:
bash
basic-memory tool write-note \
  --title "Auth Strategy Decision" \
  --content "# Decision: Use JWT for API auth\n\n## Context\n...\n\n## Decision\n...\n\n## Consequences\n..." \
  --tags "architecture,auth,decision" \
  --folder "decisions"
当做出架构决策时:
bash
basic-memory tool write-note \
  --title "Auth Strategy Decision" \
  --content "# 决策:为API使用JWT认证\n\n## 背景\n...\n\n## 决策\n...\n\n## 影响\n..." \
  --tags "architecture,auth,decision" \
  --folder "decisions"

Retrieve Context

检索上下文

Before starting related work:
bash
undefined
在开始相关工作前:
bash
undefined

Search for relevant notes

搜索相关笔记

basic-memory tool search-notes "authentication jwt tokens"
basic-memory tool search-notes "authentication jwt tokens"

Or build comprehensive context

或构建全面的上下文

basic-memory tool build-context "memory://topic/api-authentication"
undefined
basic-memory tool build-context "memory://topic/api-authentication"
undefined

Review Recent Work

回顾近期工作

bash
basic-memory tool recent-activity --depth 5 --timeframe 7d
bash
basic-memory tool recent-activity --depth 5 --timeframe 7d

Use Cases

使用场景

Personal Wiki

个人知识库

  • Store code snippets and patterns
  • Document project decisions
  • Keep reference material
  • 存储代码片段和模式
  • 记录项目决策
  • 保存参考资料

Learning Log

学习日志

  • Record things you learn
  • Tag by topic for later retrieval
  • Build knowledge over time
  • 记录所学内容
  • 按主题打标签以便后续检索
  • 逐步积累知识

Project Context

项目上下文

  • Save project-specific knowledge
  • Retrieve relevant context at session start
  • Share knowledge across sessions
  • 保存项目专属知识
  • 在会话开始时检索相关上下文
  • 跨会话共享知识

Best Practices

最佳实践

  1. Use meaningful titles - They become permalinks
  2. Add tags - Improves search and organization
  3. Use markdown - Full markdown support in content
  4. Organize with folders - Group related notes
  5. Search before writing - Check if knowledge already exists
  6. Keep notes focused - One topic per note
  7. Update, don't duplicate - Revise existing notes
  1. 使用有意义的标题 - 标题会成为永久链接
  2. 添加标签 - 提升搜索和组织效率
  3. 使用markdown - 内容支持完整的markdown语法
  4. 用文件夹组织 - 分组相关笔记
  5. 先搜索再撰写 - 检查知识是否已存在
  6. 保持笔记聚焦 - 每个笔记对应一个主题
  7. 更新而非重复 - 修改现有笔记而非创建重复内容

Integration Pattern

集成模式

Session Start

会话开始

bash
undefined
bash
undefined

Get context for today's work

获取今日工作的上下文

basic-memory tool build-context "memory://topic/feature-youre-building"
undefined
basic-memory tool build-context "memory://topic/feature-youre-building"
undefined

During Work

工作过程中

bash
undefined
bash
undefined

Save discoveries

保存新发现

basic-memory tool write-note --title "Discovery Title" --content "What I learned"
undefined
basic-memory tool write-note --title "发现标题" --content "我学到的内容"
undefined

Session End

会话结束

bash
undefined
bash
undefined

Sync to ensure persistence

同步以确保持久化

basic-memory sync
undefined
basic-memory sync
undefined