VictorTaelin/uniichat

AI Engineering

A self-hostable persistent AI agent chat that summarizes long conversations into a zoomable memory tree instead of compacting them away.

587
59
TypeScript
Apache-2.0
5 days old

If the endless "new chat" reset and context compaction in AI assistants bother you, UniiChat is worth a look, but treat it as an experiment rather than a finished product: the author says AI agents wrote and reviewed nearly all of it and warns to expect bugs.

The problem

You want one ongoing assistant that knows what you discussed last week, without pasting context back in or watching a long thread get truncated. Today the friction is at the boundary of every conversation: you start fresh, re-explain background, or accept that older detail will be dropped when the window fills. UniiChat replaces the resettable chat with a single conversation stored on the server, where older messages are condensed and can be expanded again on demand. The result is a chat you can keep using for a long time and a context that degrades in resolution rather than disappearing.

What's different

The mechanism is a binary memory tree. Every message becomes a one-line summary, neighboring lines merge in pairs repeatedly, and each model call sees a view of the whole chat up to 128 KB in which recent lines are detailed and older ones are broader. The agent can "zoom" into any line to recover the two it was merged from, down to the original message, so it never needs a compaction pass that discards the past. Summaries are written in the background by a cheaper "compactor" model, and the view changes only at a turn boundary so most input can hit the vendor's prompt cache. The trade-off is structural: recall is only as good as those summaries plus the agent's decision to zoom, and every message adds background compactor work and cost that is separate from the main conversation.

The server owns the chat, and browsers or the unii terminal are just live views onto it; any of them can send, stop work, or switch models. The agent can run a shell, read and edit files, and spawn background subagents, and you can import past Claude and ChatGPT chats into the same tree. That makes it closer to an agent runtime than a chat client, with the attendant surface area.

Who should try it

Good fit: developers comfortable with Bun and API keys who want a long-lived personal agent with file and shell access and a memory model they can inspect in the source. The design notes are embedded as header comments in each file, starting with Memory.ts and Server.ts, so it suits someone who intends to read and modify the code. Poor fit: anyone wanting a polished hosted chat or a turnkey team product, or anyone unwilling to manage API keys, backups and updates themselves. The hosted version is the documented alternative if you do not want to run a server.

Requirements and limitations

You need Bun and an Anthropic API key by default; an OpenAI-only setup is possible by changing the vendors, pick and compactor config, but the defaults assume Anthropic. Sign-in normally needs a mail key such as RESEND_API_KEY; without one the server prints the sign-in link to its output, so local use is still possible. Chats live as JSON lines under ~/.unii/users/<id> and, as the README puts it, they are the memory: back them up. On a Mac, screen control requires compiling Computer.swift, which needs swiftc plus Screen Recording and Accessibility permissions.

Ongoing upkeep matters too: unii checks for updates once a day by default, sending version, OS and CPU type, which can be disabled with UNII_NO_TELEMETRY=1. Multi-worker deployments need a proxy honoring the x-unii-worker header, and billing is only wired for the hosted service. See the project instructions for setup and config details.

HotRepo's take

HotRepo first recorded this repository on 2026-10-24 and logged 587 total stars at #7 on the NEW-REPOSITORY board (新项目榜, not the overall board) on 2026-10-25. That is a two-date snapshot of a five-day-old project, not a daily growth series, so persistence cannot yet be judged. Before relying on it, check how unii handles machine-side screen control and permissions—the README's own bug warning applies most clearly to features that touch the host.

Written by AI from the project's README, updated October 25, 2026. The project's own docs are the source of truth.