Spaces

将知识整理到独立的工作区中。每个 Space 都是存储数据的隔离容器。

Spaces 仪表盘,展示 Space 列表及各 Space 的条目数量与可用操作

什么是 Spaces?

Spaces 类似于文件夹或项目,帮助你整理知识。每个 Space 拥有独立的条目集合、Snapshots,并可拥有独立的上下文。

Your Account
├── Space: "Frontend App"
│   ├── React component patterns
│   ├── State management decisions
│   └── UI/UX guidelines
├── Space: "Backend API"
│   ├── API endpoints documentation
│   ├── Database schema notes
│   └── Authentication flow
└── Space: "Mobile App"
    ├── React Native setup
    └── Platform-specific code

创建 Spaces

你可以从仪表盘创建 Spaces,也可以通过 MCP 直接在 Claude 中创建。

从仪表盘创建

  1. 1. 在侧边栏点击 Spaces
  2. 2. 点击 Create Space
  3. 3. 输入名称和可选描述
  4. 4. 点击 Create

从 Claude(MCP)创建

# 让 Claude 创建一个 Space

"Create a new space called Mobile App
for my React Native project"

通过 MCP 使用 Spaces

保存或查询数据时,你可以指定使用哪个 Space。若未指定,系统将使用你的默认 Space。

方式 1:按 Space 名称指定

"Save this to the Frontend App space:
React components should use TypeScript..."

"Search the Backend API space for
authentication documentation"

方式 2:配置默认 Space

在 MCP 配置中设置默认 Space,使所有操作自动使用它:

claude mcp add contextforge \
  -e CONTEXTFORGE_API_KEY=cf_xxx \
  -e CONTEXTFORGE_DEFAULT_SPACE=your-space-id \
  -- npx -y contextforge-mcp

方式 3:自动检测(默认)

若未指定 Space 且未配置默认 Space,ContextForge 将自动使用你的第一个 Space,或为你创建一个名为 "Default" 的 Space。

删除 Spaces

你可以从仪表盘删除 Spaces,也可以通过 MCP 直接在 Claude 中删除。删除 Space 后,其中的所有 Knowledge Items 也会被一并删除。

从仪表盘删除

  1. 1. 在侧边栏点击 Spaces
  2. 2. 将鼠标悬停在要删除的 Space 上
  3. 3. 点击删除图标
  4. 4. 确认删除操作

从 Claude(MCP)删除

# 让 Claude 删除一个 Space

"Delete the space called Old Notes"

警告:删除 Space 是永久性操作,无法撤销。Space 中的所有 Knowledge Items 将被删除。

MCP 工具参考

memory_list_spaces

列出账户中的所有 Spaces。

{
  "spaces": [
    {
      "id": "abc-123",
      "name": "Frontend App",
      "slug": "frontend-app",
      "description": "React frontend documentation"
    }
  ],
  "total": 1
}
memory_create_space

创建一个新的 Space。

参数

名称类型必填描述
namestring新 Space 的名称
descriptionstring可选描述
memory_delete_space危险操作

永久删除一个 Space 及其所有 Knowledge Items。此操作无法撤销。

参数

名称类型必填描述
spacestring要删除的 Space 名称或 UUID

# 示例响应

{
  "success": true,
  "message": "Space 'Old Notes' and all its items have been deleted"
}

最佳实践

  • 1

    每个项目使用独立的 Space

    为不同项目或领域创建独立的 Spaces,保持知识有条不紊。

  • 2

    使用描述性名称

    为 Spaces 起清晰的名称,以便在 Claude 中通过名称轻松引用。

  • 3

    为专注工作设置默认 Space

    如果你主要在某一项目上工作,可将其设为默认 Space。

  • 4

    按 Space 创建 Snapshots

    在每个 Space 中创建 Snapshots,备份重要的知识状态。

免费计划限制

免费计划最多可创建 3 个 Spaces。升级到 Pro 可享受无限 Spaces。