VictorTaelin / uniichat
git clone https://github.com/VictorTaelin/uniichat.git
—
+518
stars, 24h · #25
+518
stars, 7 days · #117
+518
stars, 30 days · #539
518
★ total · +518% this week
50
forks · 38 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageTypeScript
LicenseApache-2.0
Created2026-10-19 (1d ago)
Last push1d ago
Watchers1
OwnerUser
Links
README excerpt
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 ------------ - **One chat, a memory tree.** Every message is summarized into one line, and neighboring lines are merged in pairs, again and again, into a binary tree. Each call sees a view of the whole chat, up to 128 KB: recent messages one line each, older ones covered by fewer, broader lines. Detail fades with age, but nothing is lost. - **Zoom.** The agent can open any line into the two it was made from, down to the original message. So its context never rots, and it never needs a "compaction" that throws the past away. - **Built in the background.** Summaries are written by a cheaper model (the compactor) as messages arrive. The view changes only at its end, so each call reads most of its input from the vendor's prompt cache. - **Every window is a view.** The server owns the chat. A browser tab, or `unii` in a terminal, shows it live; any of them can send a message, stop the work, or change the model. - **Agents and tools.** The agent runs a shell, reads and edits files, and can drive a Mac's screen, on any computer where `unii` is open (each is a device it can name). It can spawn subagents, which work in the background and report back as messages. - **Import.** Bring your past Claude and ChatGPT chats (Claude Code and Codex folders, or the websites' exports); they join the tree. 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_ `: - `site`: the server's origin, for sign-in link