Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

README.md

21 lines1.0 KB

1# Persisted subagents
2​
3This is the blog desk from the subagents example, plus a saved chat.
4​
5Refresh the page. The messages and the subagent cards come back. Refresh while a run is still streaming. The same run continues. Paste the key again, then send another message. The next agent still sees the saved notes.
6​
7The researcher calls a Wikipedia tool and shows its reasoning. A refresh keeps the reasoning, the tool call, and the tool result on its card.
8​
9The saved copy lives in this dev server process. Restart the server and the chat is gone.
10​
11## Run it
12​
131. From the repo root, run `pnpm install`.
142. Run `pnpm --filter subagents-persisted dev`.
153. Open http://localhost:3105.
164. Paste an OpenRouter key from https://openrouter.ai/keys.
175. Send a prompt. Refresh the page.
18​
19The key stays in memory only. After a refresh, the page asks for it again. The server reads the key only from the page. It does not read `OPENROUTER_API_KEY`.
20​
21This example has no login. Every visitor shares one thread. A real app must make sure that the caller owns the thread.