Agent Studio Handbook
p.1
Product overview
Agent Studio is a multi-user Flask workspace for purpose-built AI assistants. Each agent has its own name, system prompt, model, response style and private conversation memory. One account can keep several agents side by side, and switching agents switches the prompt, history and linked documents without reloading the page.
Agent Studio Handbook
p.2
Agent configuration
An agent is three things: a name, a system prompt and a conversation thread. The prompt is edited in a dialog with a template picker and an optional prompt writer powered by Mistral. Model and style are chosen per message in the chat footer: Mistral Small 3.1 or GPT-OSS 120B, with creative, precise or fast generation settings.
Agent Studio Handbook
p.3
Conversation memory
Chat memory uses LangGraph's SQLite checkpointer. Every agent id is a thread id, so an agent reloads its own messages after a restart. Clearing a chat deletes that thread only. Agents share the same graph but never share history, and timestamps are stored in message metadata so the interface can replay old conversations.
Agent Studio Handbook
p.4
Retrieval pipeline
PDF upload extracts text with pypdf and splits it into 500-character chunks with 20 characters of overlap. Chunks are embedded locally with the ONNX build of intfloat/multilingual-e5-small, a 384-dimensional multilingual model, and stored in Chroma filtered by document id. At query time a multi-query retriever rewrites the question into alternative versions, retrieves up to four chunks per version and appends the de-duplicated set to the system prompt for that turn.
Agent Studio Handbook
p.5
Tools
Every agent has one tool: web_search. It uses DuckDuckGo and needs no API key. Human-in-the-loop middleware pauses the run before any search and asks the user to approve or reject each query. Document retrieval is not a tool: when an agent has linked PDFs, a multi-query retriever pulls the closest chunks for several rewrites of the question and adds the unique matches to the system prompt before the model runs. The app does not expose a code execution or calculator tool.
Agent Studio Handbook
p.6
Guardrails
Before a message reaches a model the app rejects empty or oversized input, applies a sliding-window rate limit of 20 requests per minute per account, and redacts email addresses and credit-card numbers from both directions. Model output is rendered with DOMPurify and Mermaid runs with its strict security level. Errors return a generic message and are logged without message content.
Agent Studio Handbook
p.7
Access and isolation
Sign-in uses Google OpenID Connect and an environment allowlist of email addresses; no passwords are stored. Every agent and document row carries the owner's email, and every query filters by the logged-in user. The public demo is a separate read-only route with no database writes and its own rate limit.
Agent Studio Handbook
p.8
Deployment
The app runs under gunicorn as a systemd service behind Caddy, which obtains and renews Let's Encrypt certificates. SQLite stores agents, documents and checkpoints. The service has a read-only filesystem apart from its instance directory, and secrets are injected with systemd credentials. One worker keeps the in-process rate limiter and model cache coherent.