How the standalone brand-side agent demo combines persona, memory, files, tools, and a stateless chat
The Agent Preview is a standalone demonstration of one brand-facing persona agent. A brand can describe an offer, attach supporting material, and negotiate against a fixed snapshot of the talent's preferences. It is designed to make the agent's behaviour easy to test without creating accounts, sending email, or writing real offers.
The preview is intentionally smaller than the production Z-Agent architecture. It does not run Planner, Recall, ZGuard, Arvist, or Offer-Gen. Instead, it puts one prepared memory snapshot directly in the persona's system prompt so the brand-side behaviour can be tested in isolation.
There is no server-side chat session. On each turn, useChat sends the current
conversation, the selected prompt, and any attachments to the API. The API
prepares model-compatible messages and streams the answer back. Reloading the
page creates a new conversation.
Four inputs have different responsibilities. Keeping them separate is the central design rule.
| Input | What it controls | Example |
|---|---|---|
| Persona | How the agent speaks and behaves | Short, direct, no salesmanship; ask one thing at a time |
| Memory | What the agent knows about the talent | Hard-no categories, cash floors, required product trial, Vegas-only shoots |
| Conversation | What the brand has said in this chat | Brand, product, deliverables, budget, usage, proposed equity |
| Tools and files | What the agent can inspect during this turn | A public product URL, PDF brief, image, or uploaded HTML file |
The persona answers how to speak. The memory answers what is true. Tools answer what the agent can do. A tool never replaces the persona, and the persona never invents a capability.
The preview does not load memory from the Zooly database. Its initial memory is
a JSON snapshot embedded below the --- MEMORY --- marker in the default
system prompt.
On every model call, the API combines:
The agent is instructed to treat memory facts as true, never quote or reveal the memory, and never invent a preference that is absent. The brand should hear the resulting commercial position, not the internal JSON or reasoning behind it.
This snapshot represents the output that a production talent-setup flow would eventually provide. In the complete architecture, durable memory seeds a room, the Planner maintains room memory, and Recall selects what a persona sees. The preview deliberately replaces that pipeline with one fixed document.
The system prompt gives the persona three jobs: agree, push back, or ask.
Agree means the terms are settled for review; it does not execute or sign a deal. The persona may negotiate within the talent's mandate, but every settled outcome remains pending final talent approval outside this standalone chat.
The order of checks matters:
The API uses a bounded multi-step run. A URL tool call completes one generation step, its result is added to the model context, and the model gets another step to produce the human-facing answer.
A URL is not silently fetched before generation. The API exposes a typed AI SDK
tool named scrapePublicUrl. Protected runtime instructions require the model
to call it before discussing a public URL.
The tool:
The model sees the tool result, not a claim that a page was opened. If the tool cannot access a page, the agent must say so and ask the brand to paste or attach the relevant content.
Files are not uploaded to Zooly storage. They are prepared in the browser and sent as AI SDK message parts for the current request.
| File type | Processing |
|---|---|
| Text, Markdown, CSV, JSON | Read in the browser, compacted, and supplied as text context |
| HTML | Parsed without executing scripts; visible and embedded template content is extracted |
| Sent as a native model file input | |
| Image | Converted from an AI SDK file part to a native multimodal image input |
The composer accepts up to four attachments. Text and HTML inputs may be up to 25 MB and are reduced to at most 60,000 characters of extracted context. Binary files may be up to 10 MB. The default model supports native file input and image vision, so an image does not need a separate OCR tool.
Appending ?prompt-editor=1 enables an internal editing mode. It is hidden from
ordinary preview visitors.
The editor supports two paths:
AI Assist keeps instructions and memory separate. Behavioural requests update the persona instructions. Explicit talent-fact requests, such as changing a minimum rate, can update the memory snapshot and show before-and-after values for review. Nothing is applied until the operator accepts the proposal.
The edited prompt is stored only in that browser's localStorage. Saving it
starts a new chat so old responses are never mixed with new instructions. The
prompt is not written to a Zooly account or database.
The preview intentionally does not:
Its purpose is behavioural validation: change the prompt or memory, start a new chat, replay the same offer, and compare the result.
| Responsibility | Location |
|---|---|
Preview page and useChat UI | apps/zooly-app/app/(pages)/agent-preview/mike-tyson/MikeTysonAgentPreview.tsx |
| Stateless chat endpoint and tool loop | apps/zooly-app/app/api/agent-preview/chat/route.ts |
| URL validation and readable-content extraction | packages/z-agent/srv/src/link-scrape.ts (shared with the real agents) |
| Persona and fixed memory snapshot | apps/zooly-app/lib/agent-preview-prompt.ts |
| AI-assisted prompt proposals | apps/zooly-app/app/api/agent-preview/prompt-generator/route.ts |
The public demo route is /agent-preview/mike-tyson. The hidden editor route is
/agent-preview/mike-tyson?prompt-editor=1.