---
title: ClickHouse Loom 文档
seo:
  title: 智能体记忆与代码搜索文档
  description: 面向 AI 智能体的自托管 MCP 服务器，提供共享记忆、文档检索和代码索引。
lastModified: '2026-11-24T19:38:17.000Z'
---

<!-- i18n: source=docs/index.md blob=173314858f057f518abf314eb98af3afff03c87b model=claude-sonnet-5-5 -->
> 本页由机器从[英文原文](https://loom.clickhouse.com/docs)翻译，内容以英文原文为准。
> Machine-translated from the [English page](https://loom.clickhouse.com/docs), which is authoritative.

<a id="clickhouse-loom-documentation"></a>

Loom 是面向 AI agent 的记忆、文档和代码索引服务器，数据存储在 ClickHouse 中，也可以选择用 [Postgres](/docs/zh-CN/architecture/storage-authority#why-two-stores) 存放实时记忆和知识状态。agent 和用户可以通过 MCP、HTTP、Python 和 TypeScript SDK 以及控制台访问它。本页按阅读顺序列出了所有页面。

![控制台的资料库：搜索退款规则，返回带引用的段落](https://github.com/ClickHouse/loom/raw/main/docs/assets/screenshots/document-search.webp)

<details>
<summary>Ask AI 回答问题并附带已核对的来源（视频片段）</summary>
<video src="/docs/blume-assets/content/.blume-content/assets/screenshots/clip-assistant-answer.webm" controls preload="none" muted playsinline width="100%" aria-label="Ask AI answering a question about refunds, with its numbered sources checked against Loom"><a href="/docs/blume-assets/content/.blume-content/assets/screenshots/clip-assistant-answer.webm">Ask AI 回答问题并附带已核对的来源（视频片段）</a></video>
</details>

<a id="start-here"></a>

## 从这里开始

| 步骤                | 阅读                                                                                                                                                                                      |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. 评估             | [概览](https://loom.clickhouse.com/docs/getting-started/overview) → [评估 Loom](https://loom.clickhouse.com/docs/getting-started/evaluate)                                                                                                    |
| 2. 安装             | [快速开始](/docs/zh-CN/getting-started/quickstart) → [部署](https://loom.clickhouse.com/docs/operations/deployment)                                                                                                      |
| 3. 连接 agent       | [连接编码 agent](https://loom.clickhouse.com/docs/getting-started/connect-a-coding-agent) → [集成](https://loom.clickhouse.com/docs/features/integrations)                                                                      |
| 4. SDK 和 API       | [你的第一个 agent](https://loom.clickhouse.com/docs/getting-started/first-agent) → [Python SDK](https://loom.clickhouse.com/docs/reference/python-sdk) / [HTTP API](https://loom.clickhouse.com/docs/reference/http-api)                                                            |
| 5. 命名空间与访问   | [身份与命名空间](/docs/zh-CN/concepts/identities-and-namespaces) → [令牌与授权](https://loom.clickhouse.com/docs/guides/tokens-and-grants)                                                                     |
| 6. 代码索引         | [代码索引](/docs/zh-CN/features/code-index/overview) → [代码仓库](/docs/zh-CN/features/code-index/repositories) → [代码索引运维](https://loom.clickhouse.com/docs/operations/code-index-operations)                        |
| 7. 运维             | [监控](https://loom.clickhouse.com/docs/operations/monitoring) · [故障排查](https://loom.clickhouse.com/docs/operations/troubleshooting) · [升级](https://loom.clickhouse.com/docs/operations/upgrades) · [备份与恢复](https://loom.clickhouse.com/docs/operations/backup-and-recovery) |

<a id="use-cases"></a>

## 使用场景

每个需求一个页面，说明 Loom 能为此做什么，以及从哪里开始：
[agent 记忆](/docs/zh-CN/use-cases/agent-memory) ·
[文档搜索与 RAG](/docs/zh-CN/use-cases/document-search) ·
[面向编码 agent 的代码索引](/docs/zh-CN/use-cases/code-intelligence) ·
[按语言划分的代码索引](/docs/zh-CN/use-cases/code-intelligence-by-language) ·
[与代码关联的记忆](/docs/zh-CN/use-cases/memory-linked-to-code) ·
[编码 agent 的模型成本](/docs/zh-CN/use-cases/coding-agent-cost) ·
[多 agent 共享上下文](/docs/zh-CN/use-cases/multi-agent) ·
[自主 agent：召回、审计、擦除](/docs/zh-CN/use-cases/autonomous-agents) ·
[运行、追踪与 PR 历史](/docs/zh-CN/use-cases/runs-and-pr-history) ·
[基于 ClickHouse 的自托管](/docs/zh-CN/use-cases/self-hosted-clickhouse) ·
[所有使用场景](/docs/zh-CN/use-cases)。

<a id="1-getting-started"></a>

## 1. 快速入门

- [概览](https://loom.clickhouse.com/docs/getting-started/overview)：Loom 是什么、适用场景、前提条件。
- [包含的功能](https://loom.clickhouse.com/docs/getting-started/whats-included)：Loom 的主要能力，每项都附有对应页面。
- [快速开始](/docs/zh-CN/getting-started/quickstart)：完整走通本地部署。
- [配置模型和 API 密钥](https://loom.clickhouse.com/docs/getting-started/models-and-keys)：agent 订阅、服务器 LLM、嵌入模型以及单一提供商的配置。
- [评估 Loom](https://loom.clickhouse.com/docs/getting-started/evaluate)：冒烟测试、工作负载评估以及可复现的公开基准测试。
- [连接编码 agent](https://loom.clickhouse.com/docs/getting-started/connect-a-coding-agent)：插件或 MCP 接入。
- [通过编码 agent 设置 Loom](https://loom.clickhouse.com/docs/getting-started/agent-setup)：适用于由 agent 安装固定版本并验证其可用的场景，附有固定格式的报告。
- [你的第一个 agent](https://loom.clickhouse.com/docs/getting-started/first-agent)：SDK 教程。

<a id="2-install-and-run-the-server"></a>

## 2. 安装并运行服务器

- [部署](https://loom.clickhouse.com/docs/operations/deployment)：部署形态、环境、提供方、身份模式、代理、镜像、生产环境检查清单。
- [单点登录](https://loom.clickhouse.com/docs/operations/sso)：为控制台、`loom login` 和 MCP 客户端接入 OIDC 身份提供方。
- [不使用控制台使用 Loom](https://loom.clickhouse.com/docs/guides/without-the-dashboard)：`loom login`、`loom call` 和 SDK 可完成控制台每个视图的调用。
- [升级](https://loom.clickhouse.com/docs/operations/upgrades) · [受支持的版本](https://loom.clickhouse.com/docs/operations/supported-versions) ·
  [备份与恢复](https://loom.clickhouse.com/docs/operations/backup-and-recovery) ·
  [监控](https://loom.clickhouse.com/docs/operations/monitoring) · [维护](https://loom.clickhouse.com/docs/operations/maintenance) ·
  [运行时设置](https://loom.clickhouse.com/docs/operations/runtime-settings) ·
  [故障排查](https://loom.clickhouse.com/docs/operations/troubleshooting) ·
  [代码索引运维](https://loom.clickhouse.com/docs/operations/code-index-operations) ·
  [运行 N 个副本](https://loom.clickhouse.com/docs/operations/replicas)：多个相同的 Loom 位于同一个 URL 之后 ·
  [Postgres](https://loom.clickhouse.com/docs/operations/postgres)：Postgres 记忆权威存储 ·
  [Kubernetes](https://loom.clickhouse.com/docs/operations/kubernetes)：Helm chart，附带 EKS 和 kind 覆盖配置 ·
  [ClickHouse Cloud 与 Managed Postgres](https://loom.clickhouse.com/docs/operations/clickhouse-cloud)：基于这两项托管服务的 chart ·
  [将命名空间复制到另一个 Loom](https://loom.clickhouse.com/docs/operations/okf-sync) ·
  [将用量导出到数据仓库](https://loom.clickhouse.com/docs/operations/analytics-export)

<a id="3-connect-agents"></a>

## 3. 连接 agent

[集成](https://loom.clickhouse.com/docs/features/integrations) ·
[MCP 客户端](https://loom.clickhouse.com/docs/features/integrations/mcp-clients) ·
[Agent 指令](/docs/zh-CN/features/integrations/agent-instructions) ·
[Claude Code](/docs/zh-CN/features/integrations/claude-code) ·
[Codex](https://loom.clickhouse.com/docs/features/integrations/codex) · [Cursor](/docs/zh-CN/features/integrations/cursor) ·
[VS Code](/docs/zh-CN/features/integrations/vscode) ·
[框架](https://loom.clickhouse.com/docs/features/integrations/frameworks) ·
[Grep 垫片](/docs/zh-CN/features/integrations/grep-shim) ·
[Langfuse](/docs/zh-CN/features/integrations/langfuse) ·
[ClickStack](/docs/zh-CN/features/integrations/clickstack) ·
[OKF](/docs/zh-CN/features/integrations/okf)

<a id="4-sdk-and-api"></a>

## 4. SDK 与 API

[参考索引](https://loom.clickhouse.com/docs/reference) · [HTTP API](https://loom.clickhouse.com/docs/reference/http-api) ·
[MCP](https://loom.clickhouse.com/docs/reference/mcp) · [Python SDK](https://loom.clickhouse.com/docs/reference/python-sdk) ·
[TypeScript SDK](https://loom.clickhouse.com/docs/reference/typescript-sdk) · [环境变量](https://loom.clickhouse.com/docs/reference/environment) ·
[运维](https://loom.clickhouse.com/docs/reference/operations) · [配置](https://loom.clickhouse.com/docs/reference/configuration) ·
[工作进程](https://loom.clickhouse.com/docs/reference/workers) · [CLI](https://loom.clickhouse.com/docs/reference/cli) · [错误](https://loom.clickhouse.com/docs/reference/errors) ·
[状态](https://loom.clickhouse.com/docs/reference/status) · [数据模式](https://loom.clickhouse.com/docs/reference/schema) ·
[提取器契约](https://loom.clickhouse.com/docs/reference/extractor-contract)。各个版本之间，操作和字段会有变化；[未知字段和已移除字段](https://loom.clickhouse.com/docs/reference/http-api#unknown-and-removed-fields)说明了客户端如何处理服务器不再读取的字段。

<a id="5-namespaces-access-and-the-memory-model"></a>

## 5. 命名空间、访问与记忆模型

- [身份与命名空间](/docs/zh-CN/concepts/identities-and-namespaces)：元组、角色、授权和读取范围。
- [记忆](/docs/zh-CN/concepts/memory)：行、写入如何被判定、时间、历史、来源。
- [检索与排序](/docs/zh-CN/concepts/retrieval-and-ranking)：检索路径、融合、弃答、校准。

<a id="guides"></a>

## 指南

[agent 集成](https://loom.clickhouse.com/docs/guides/agent-integration) ·
[无头机器人](https://loom.clickhouse.com/docs/guides/headless-bots) ·
[令牌与授权](https://loom.clickhouse.com/docs/guides/tokens-and-grants) ·
[跟踪并恢复长时间运行](https://loom.clickhouse.com/docs/guides/trace-and-resume) ·
[优化命名空间](https://loom.clickhouse.com/docs/guides/optimize-namespace) ·
[调查类 agent 的记忆](https://loom.clickhouse.com/docs/guides/investigation-agent-memory) ·
[提取流水线](https://loom.clickhouse.com/docs/guides/extraction-pipeline) ·
[性能调优](https://loom.clickhouse.com/docs/guides/performance-tuning) · [调试](https://loom.clickhouse.com/docs/guides/debugging) ·
[从 Postgres 查询 Loom](https://loom.clickhouse.com/docs/guides/query-from-postgres) ·
[使用 Loom 教学](https://loom.clickhouse.com/docs/guides/teaching)

<a id="features"></a>

## 功能

- 平面：[命名空间与共享](https://loom.clickhouse.com/docs/features/namespaces-and-sharing) ·
  [统一搜索](https://loom.clickhouse.com/docs/features/unified-search) · [知识](https://loom.clickhouse.com/docs/features/knowledge) ·
  [实体图](https://loom.clickhouse.com/docs/features/entity-graph) ·
  [对话与会话](/docs/zh-CN/features/conversations-and-sessions) ·
  [运行](https://loom.clickhouse.com/docs/features/runs) · [任务与决策](https://loom.clickhouse.com/docs/features/tasks-and-decisions) ·
  [控制台](https://loom.clickhouse.com/docs/features/dashboard)
- 记忆：[写入](https://loom.clickhouse.com/docs/features/memory/writing) ·
  [搜索与提问](https://loom.clickhouse.com/docs/features/memory/search-and-ask) ·
  [冲突与拒绝](https://loom.clickhouse.com/docs/features/memory/conflicts-and-refusal) ·
  [提取](https://loom.clickhouse.com/docs/features/memory/extraction) ·
  [历史与来源](https://loom.clickhouse.com/docs/features/memory/history-and-provenance) ·
  [保留与删除](https://loom.clickhouse.com/docs/features/memory/retention-and-erasure) ·
  [流程与经验](https://loom.clickhouse.com/docs/features/memory/procedures-and-learnings) ·
  [工作记忆与档案](https://loom.clickhouse.com/docs/features/memory/working-memory-and-profiles)
- 可观测性：[审计](https://loom.clickhouse.com/docs/features/observability/audit) ·
  [成本与用量](https://loom.clickhouse.com/docs/features/observability/cost-and-usage) ·
  [遥测](https://loom.clickhouse.com/docs/features/observability/telemetry)
- 跟踪器：[概览](https://loom.clickhouse.com/docs/features/tracker/overview) ·
  [记录约定](https://loom.clickhouse.com/docs/features/tracker/record-contract)

<a id="6-code-index"></a>

## 6. 代码索引

[概览](/docs/zh-CN/features/code-index/overview) ·
[仓库](/docs/zh-CN/features/code-index/repositories) ·
[新鲜度](/docs/zh-CN/features/code-index/freshness) ·
[历史与 PR](https://loom.clickhouse.com/docs/features/code-index/history-and-prs) ·
[运维](/docs/zh-CN/features/code-index/operations) ·
[代码索引运维手册](https://loom.clickhouse.com/docs/operations/code-index-operations)

<a id="architecture"></a>

## 架构

[系统概览](https://loom.clickhouse.com/docs/architecture/system-overview) ·
[服务器布局](/docs/zh-CN/architecture/server-layout) ·
[ClickHouse](https://loom.clickhouse.com/docs/architecture/clickhouse) ·
[记忆架构](https://loom.clickhouse.com/docs/architecture/memory-architecture) ·
[存储权威](/docs/zh-CN/architecture/storage-authority) ·
[单元](https://loom.clickhouse.com/docs/architecture/cells) ·
[存储布局](https://loom.clickhouse.com/docs/architecture/storage-layout) ·
[代码索引架构](https://loom.clickhouse.com/docs/architecture/code-index-architecture) ·
[文档提取](/docs/zh-CN/architecture/document-extraction) ·
[文档来源](https://loom.clickhouse.com/docs/architecture/document-sources) ·
[LLM 与嵌入](/docs/zh-CN/architecture/llm-architecture) ·
[安全](https://loom.clickhouse.com/docs/architecture/security) ·
[助手设计](https://loom.clickhouse.com/docs/architecture/assistant) ·
[故障与恢复](https://loom.clickhouse.com/docs/architecture/failure-and-recovery) ·
[滚动升级](https://loom.clickhouse.com/docs/architecture/rolling-upgrades)

<a id="benchmarks"></a>

## 基准测试

[概览](/docs/zh-CN/benchmarks/overview) · [覆盖范围](/docs/zh-CN/benchmarks/coverage) · [方法论](/docs/zh-CN/benchmarks/methodology) · [运行](https://loom.clickhouse.com/docs/benchmarks/running) · [结果](https://loom.clickhouse.com/docs/benchmarks/results) · [添加用例](/docs/zh-CN/benchmarks/adding-a-case) · [Skill 评测](/docs/zh-CN/benchmarks/skill-eval)

<a id="development"></a>

## 开发

面向贡献者：[仓库指南](/docs/zh-CN/development/repository-guide) ·
[本地开发](https://loom.clickhouse.com/docs/development/local-development) ·
[测试](/docs/zh-CN/development/testing) · [代码生成](/docs/zh-CN/development/code-generation) ·
[迁移](https://loom.clickhouse.com/docs/development/migrations) ·
[发布流程](https://loom.clickhouse.com/docs/development/release-process) ·
[文档风格](https://loom.clickhouse.com/docs/development/documentation-style) ·
[整理循环设计](https://loom.clickhouse.com/docs/development/curation-loop-design) ·
[扩展 Loom](/docs/zh-CN/development/extending-loom) ·
[添加操作](/docs/zh-CN/development/adding-an-operation) ·
[添加 worker](/docs/zh-CN/development/adding-a-worker) ·
[添加表](/docs/zh-CN/development/adding-a-table) ·
[添加语言支持](https://loom.clickhouse.com/docs/development/adding-language-support) ·
[控制台设计](https://loom.clickhouse.com/docs/development/dashboard-design)。
[CONTRIBUTING.md](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md) 介绍了 pull request 的工作流程。

<a id="also"></a>

## 另请参阅

[术语表](https://loom.clickhouse.com/docs/glossary)：Loom 的术语，每个只定义一次。[常见问题](/docs/zh-CN/faq)：最先会遇到的问题，每个问题一段回答。[`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt)：为 agent 生成的文档索引；[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) 将说明 Loom 是什么以及如何开始使用的页面合并在一个文件中。
