uniichat README

项目的 README,来自 github.com/VictorTaelin/uniichat。合并为一个 markdown 文件:README.md。

UniiChat

▶ Watch the announcement video

This repo is vibe-coded. AI agents wrote nearly all of it, and AI agents reviewed it. Read it, run it and fork it as such: expect bugs.

UniiChat is an AI agent with one chat that never ends. There is no "new chat" button: you talk to the same agent for days, weeks, years, and it remembers. The hosted version is at https://uniichat.com. This is its source, to run your own server on your own API keys.

How it works

The design is in the header comment of each file. Start with Memory.ts (the tree and the view), Server.ts (the chat, turns, workers) and AskAI.ts (model calls and the cache).

Run it

You need Bun and an Anthropic API key (or an OpenAI one, below).

export ANTHROPIC_API_KEY=sk-ant-...
bun Server.ts                    # http://127.0.0.1:8788, data in ~/.unii

Then open http://127.0.0.1:8788 and type your email. With no mail key set, the server prints the sign-in link in its output: open it. Or chat from a terminal:

bun Term.ts http://127.0.0.1:8788

It asks for your email, the server prints a link, and the page it opens asks for the code the terminal shows. bun Term.ts help lists the rest.

Other commands:

bun run test                     # the tests, each file on its own
bun run web                      # rebuilds web/app.js from web/src
bun build --compile Term.ts --outfile unii
                                 # one `unii` executable; `unii serve`
                                 # runs the server it carries

Your chats live in ~/.unii/users/, one JSON line per message (main/) and per summary (tree/). They are the memory: back them up.

Config

~/.unii/config.json (optional; the dir is $UNII_DIR). Each key may also be set as the variable UNII_<KEY>:

Keys are read from the environment: ANTHROPIC_API_KEY, OPENAI_API_KEY, RESEND_API_KEY (to email sign-in links; none: they print), APNS_KEY.

With only an OpenAI key, set vendors, pick and compactor to openai-api models, e.g. UNII_VENDORS=openai-api UNII_PICK=openai-api:gpt-6.1-sol:medium:slow UNII_COMPACTOR=openai-api:gpt-6-luna:high:slow.

A self-hosted server is free: it bills no one, shows no prices, and calls only the model vendors. Billing.ts is the one place a hosted server plugs in its billing (uniichat.com sells credits; this repo has none).

The unii terminal

web/install.sh (served at /install.sh) runs the official installer, which installs the released unii executable. unii alone opens uniichat.com; unii <url> opens any server. Run with UNII_COMPUTER=1 on a Mac, the agent may use its screen (it compiles Computer.swift with swiftc; macOS asks for Screen Recording and Accessibility).

Telemetry: once a day the unii terminal asks bend-lang.com's /check for the latest version (Term.ts update_check), sending its version, OS and CPU type, no account and no id; it also says whether this computer has ever self-hosted (set for good the first time it runs unii serve or opens a server other than uniichat.com). It is the one call a self-hosted UniiChat makes to us. UNII_NO_TELEMETRY=1 turns it off.

License

Apache-2.0 (LICENSE). Copyright 2026 Higher Order Company.

uniichat (VictorTaelin/uniichat)

正在搜索数据库…

这是什么?UniiChat 是一个可自行部署的 AI 智能体,你可以在一段永不结束的对话中与它交流。它没有“新建对话”按钮,并借助内置的记忆树,跨越数天、数周甚至数年记住所有内容。
这是聊天应用,还是我要基于它开发的框架?它是一个可自行部署的服务端应用:你运行基于 TypeScript 和 Bun 的后端,任意数量的客户端(浏览器标签页或 'unii' 终端)都可以连接进来,作为同一段持续对话的实时视图。
我该怎么把它跑起来?克隆代码仓库,运行 'bun Server.ts' 启动服务端;或运行 'bun Term.ts' 在终端里聊天。你也可以用 'bun build --compile Term.ts --outfile unii' 编译出独立的 'unii' 可执行文件。
运行它需要安装 Bun 并拥有 Anthropic API 密钥吗?需要。默认情况下,你需要安装 Bun 并拥有 Anthropic API 密钥;如果想改用 OpenAI 密钥,可以重新配置 vendor、pick 和 compactor 设置来切换。
它稳定到可以当作我的日常智能体来用吗?README 本身就提醒,整个项目是“vibe coding”写成的,几乎全部代码都由 AI 智能体编写并审阅,因此应当预期会有漏洞。
它在 Windows 和 Linux 上也能用吗,还是只支持 macOS?由于它基于 Bun 运行,因此可以在 macOS、Linux 和 Windows 上使用;只有可选的 Mac 屏幕控制功能仅限 macOS。
我的聊天数据会离开我的电脑吗?你的聊天记录以 JSON 行格式保存在本地的 ~/.unii/users/ 目录中。自行部署的服务端唯一的对外请求,是每天向 bend-lang.com 发送一次版本检查,不包含账户或 ID,并且可以关闭。
记忆树到底是怎么工作的?每条消息都会被概括成一行,相邻的行会两两不断合并,形成一棵二叉树。因此每次调用时,最近的消息保持完整细节,较早的消息则被压缩成更宽泛的摘要。没有任何内容会被删除,智能体还可以“放大”任一摘要,回溯到它所对应的原始消息。
我能导入以前的 ChatGPT 或 Claude 对话吗?可以。UniiChat 能够导入 Claude Code 和 Codex 的文件夹,或导入 Claude 与 ChatGPT 网站的导出文件,导入后的内容会并入记忆树。
智能体能控制我的 Mac 屏幕吗?可以。在 macOS 上使用 UNIICOMPUTER=1 运行时,智能体就能操控屏幕。它会通过 swiftc 编译 Computer.swift,macOS 会提示你授予“屏幕录制”和“辅助功能”权限。
有没有托管版本,让我不必自己运行服务端?有。uniichat.com 就是托管版本,通过出售额度(credits)计费;自行部署的服务端则免费,只会调用你所配置的模型供应商。
有哪些类似的项目?brigade, Raven, ruflo, OptMem, aichat, whirl, Athena-Public, pi-optchat
大小
0.2 MB
星标
678
更新
提交Oct 19
时长
30天
提交 · 90 天