商业产业 Hacker News AI 2026-07-31T20:27 正文 ok 598 words

Show HN:如何构建并自托管代码审查 Agent

英文标题:🔶 Show HN: How to build and self-host a code review agent

Tilde 是一个用于构建云端部署 AI Agent 的 harness SDK,主打速度、可组合性与集中化管理。它将 Agent 能力拆分为 Tools、ChatKit 和 Memory 等组件,支持 MCP、Slack、GitHub、API、凭据管理及持久化记忆。作者以代码审查 Agent 为例,展示了如何通过 GitHub PR 提及触发、在沙箱中安全检出代码、分析 git diff 并回写行内评论和总结。开发者可直接部署官方示例,并通过 `tilde-state.yaml` 导入所需基础设施与集成配置。
打开原文相关 3 · 机会 1
media238.5 KB media357.7 KB

中文

Tilde 是一个用于构建云端部署 AI Agent 的 harness SDK,速度非常快。

我构建 Tilde 有两个原因:

  1. 我认为,为所有任务——无论简单还是高度复杂——创建单一的 Agent harness,会导致次优结果。
  2. 当时的 harness 和 AI Agent 库无法提供我想要的开发者体验、可移植性或可组合性。

一年多过去了,这个副项目仍在持续开发,第 1 点依然成立。另一方面,其他框架、库和 harness 已经取得了很大进展,但我仍然每天都会使用 Tilde 构建 Agent 来帮我自动化处理事务。在克服了多数软件工程师常见的陷阱——即“在准备好之前,总还有一个功能需要补上”——之后,我终于可以说服自己:它已经准备好了。

它能做什么?

我将优秀 harness 的核心能力拆分并组合为多个组件,你可以按需选择并赋予你的 Agent:

  1. **Tools:**启动 MCP 服务器并提供给 Agent 使用。你可以添加由 Tilde 管理的工具、接入自己的工具,或代理上游 MCP 服务器。如果 MCP 不足以满足需求,Tilde 还提供凭据管理、常见 SaaS 集成,以及通向上游服务的原始 HTTP1/2 反向代理。
  2. **ChatKit:**集成第三方聊天服务提供商,例如 Slack、GitHub 或 API。让你的 Agent 在你的工作场景中参与协作。你可以启用通过 GitHub、Slack 或 API 直接接收和发送消息,也可以接收这些服务的其他 webhook。
  3. **Memory:**创建并集中管理技能注册表、wiki 和持久化记忆。将这些能力作为工具提供给 Agent,使其能够自主保持信息更新。

Tilde 中的一切均基于云端,并由中心统一管理和授权控制。我目前已构建了一个可配合 Vercel AI SDK 使用的客户端库,未来预计将支持其他框架和语言。

一个实际示例

我使用 Tilde 构建的第一批 Agent 之一,是一个代码审查 Agent。我是一名软件工程师,而我们往往习惯于把自己自动化到失业,所以,为什么不呢。

这里有几个关键要求:

  1. 我希望能在 GitHub PR 中提及该 Agent,以触发一次审查。
  2. Agent 必须能够在沙箱中安全地检出代码。
  3. 我不希望向 Agent 或 Agent 能访问到的沙箱暴露凭据。
  4. Agent 随后应能基于某种系统提示词,循环执行、推理并分析 git diff。
  5. 最后,应在 PR 中回复行内评论以及一条总结消息。

下面是我希望实现的基本架构:

代码审查 Agent 架构

简而言之,以下是你可以自行部署的最终示例:https://github.com/trytilde/examples/tree/main/code-review-bot

借助 Tilde,我实际上只需要专注于上图中的第 7 点,Tilde 的 SDK 会处理其余所有事情。

几分钟后,大功告成!一个可正常运行且安全的 Agent,就可以立即部署到 Vercel 和 Tilde,并可在任何地方远程使用。

额外加分项:你会注意到,上述 GitHub 示例仓库中有一个 tilde-state.yaml 文件。你可以注册一个 Tilde 账户,进入设置页面并导入该文件,以配置所需的 Tilde 基础设施和集成。之后,系统会要求你配置 GitHub 与 Modal 沙箱设置。这正是我为尽可能提升系统可移植性而设计的方式。

可通过阅读我们的文档开始使用,或者让你的 Agent 读取我们的 llms.txt。

我投入了大量时间和精力构建这个平台,但在文档方面投入较少——预计未来几天文档将进行更新。

English / 原文

Tilde is a harness SDK for building cloud deployed AI agents, extremely fast.

I built Tilde for 2 reasons:

  1. that creating a single agent harness for all tasks both simple and highly complex would lead to sub-optimal outcomes.
  2. That harness's & AI agent libraries at the time didn't give me the developer experience, portability or composability that I wanted

Over a year later into building this side project, point 1 is still true. On the other hand other frameworks, libraries and harnesses have come a long way but I still find myself reaching daily to Tilde to build agents to automate things for me. Having worked through the common pitfall most software engineers make, namely that "there's always one more feature before it's ready" - I can finally convince myself that it's ready.

What does it do?

I've taken out the meat of what makes a good harness, and composed it into components you can pick and choose to give to your agent:

  1. Tools: Spin up MCP servers to give to your agent. Add Tilde managed tools, bring your own or proxy upstream MCP servers. Tilde provides credential management, common SaaS integrations and raw HTTP1/2 reverse proxies to upstream services if MCP isn't enough
  2. ChatKit: Integrations with third party chat providers (Slack, Github or via API). Let your agents engage where you work. You can enable receiving and sending messages from Github, Slack or direct via API as well as other webhooks from these services.
  3. Memory: Create and centrally manage skills registries, wiki's and persistent memories. Surface these functions as tools to your agents to autonomously keep up to date.

Everything in Tilde is cloud based & centrally managed & permissioned. I've currently built a client-side library to work with Vercel's AI SDK but expect other frameworks and languages to be supported in future.

A practical example

One of the first agent's I built with Tilde was a code-review agent. I'm a software engineer and we tend to have a habit of automating ourselves out of work so what the heck.

There were a few key requirements:

  1. I want to tag the agent in Github PRs to trigger a review
  2. The agent must be able to securely checkout the code in a sandbox
  3. I don't want to expose credentials to the agent or the sandbox where the agent can reach to
  4. The agent should then be able to loop, reason and analyse the git diff based on some sort of system prompt
  5. Finally, comment back on the PR both inline and a summary message

Here's a basic architecture of what I was going for:

code review agent architecture

TLDR; here's the final example you can deploy yourself: https://github.com/trytilde/examples/tree/main/code-review-bot

With Tilde, I could essentially just focus on point 7 in the above diagram and the Tilde's SDK took care of everything else.

A few minutes later & voila! A functioning, secure agent that I could instantly deploy to Vercel & Tilde for remote usage anywhere.

For bonus points : You'll notice a tilde-state.yaml file in the example github repo above. You can spin up a Tilde account, head to your settings and import it there to setup the required Tilde infrastructure and integrations. From there it'll ask you to configure your Github & Modal sandbox settings. This is how I've designed the system to be as portable as possible.

Get started by reading our docs here or pointing your agent to our llms.txt .

I've spent a lot of time and energy into building the platform but less so on the docs - expect them to get a refresh in the coming days.