Build a Comet-style agentic browser
~25 min TypeScript PythonWhat you’re building: A browser that navigates and answers in place.
Primitives you’ll use: Computer, Sandbox, Agent and harness, Qdrant vectors, Deployment (App Engine)
Agent prompt
Start with your coding agent
Choose what you are building. The brief names the product it is modelled on, maps it onto MIOSA, and lists the exact commands. Copy it into OSA, Claude Code, Codex, or Cursor.
Template coming soon1 What are you building?
Leave it empty and your agent will propose 3 names, pick one, and use it for resources, the domain and branding.
3 Configure
Reference product
Comet, by Perplexity (https://www.perplexity.ai/comet): an agentic browser that navigates, extracts and answers in place.
How it works: A browser with an assistant built in: it reads the current page, navigates for the user and answers with sources.
Key capabilities:
An assistant inside the browser
Navigates and extracts on its own
Answers about the current page
Cited answers
Build an app LIKE Comet. It is not affiliated with Perplexity: do not copy its name, branding or assets. Open https://www.perplexity.ai/comet first, confirm the capabilities above, and note anything this brief missed.
How it maps onto MIOSA
Searches and reads sources -> a MIOSA sandbox running fetch/extract jobs (a computer when pages need a real browser)
Retrieval over what it read -> managed Qdrant (`QDRANT_URL`) for chunk embeddings
Answers with citations -> agent runs (`miosa prompt`, client.runs) streaming events that answer only from retrieved chunks and return source ids
Serves the answer UI or API -> a MIOSA deployment (`miosa deploy create`), immutable and versioned
A real browser the agent drives -> a MIOSA computer (persistent Linux desktop with a browser)
Goal
Build an app like Comet on MIOSA, as a multi-tenant product sold to my customers. Each customer is isolated in its own workspace; I meter usage and bill them.
Product name: propose 3 product names, pick one, and use it for resource names, the domain and branding. Until you pick, <product-name> stands for it in the commands below.
Scale: a prototype.
Set up
npm i -g @miosa/cli
miosa login && miosa whoami
miosa api-key create <product-name>-key --preset agent
export MIOSA_API_KEY="msk_u_..."
miosa org
miosa connections add models # your own model provider key
Resources
Sandbox: the agent's isolated Linux workspace
miosa create <product-name>-box --template agent-python --wait
Computer: a persistent Linux desktop with a browser
miosa computer create <product-name>-desktop
Agents and harnesses: what a run can use
miosa agent harnesses
Managed Qdrant (vectors)
miosa api POST /databases -d '{"name":"<product-name>-index","engine":"qdrant"}'
Deployment: a stable, versioned URL
miosa deploy create --from-sandbox <product-name>-box --name <product-name> --wait
Data and storage
Qdrant holds chunk embeddings; the payload carries url, title, chunk id and fetched_at so every answer can cite a saved page.
Keep threads and answers in your own datastore, with their citations.
Auth and tenancy
Your organization is the platform; customers never get a MIOSA account, they sign into YOUR product. One workspace per customer, created as they onboard, isolates their machines, runs and data.
miosa workspace create <product-name>-customer-1
Tag every machine and run with the customer id in `metadata`, and never query across customers. Meter usage per customer with GET /api/v1/usage and set who pays with PUT /api/v1/bill-to (/docs/platform/usage-and-billing).
Agent loop
Harness: OSA is MIOSA's own harness and works with any model provider you connect, including your own model.
Model: Anthropic (Claude). Calls use my own provider key (`miosa connections add models`); MIOSA platform keys are never used.
Sessions: one chat per project or conversation, so the agent keeps its context. The first `miosa prompt` on a sandbox uses `--new-chat` (a chat id is printed); every later turn passes `--chat <chat-id>`. `--reuse chat` keeps one new machine per chat so files persist.
Streaming: follow a run with `miosa run follow <run-id>` or client.runs.streamEvents(run.id), and steer or stop it with `miosa run steer` and `miosa run interrupt`.
Retrieval comes first, generation second: the model sees only retrieved chunks and must cite them. The harness runs in the pipeline sandbox so fetching and extraction code is isolated.
Steps
1. Create the vector index.
miosa api POST /databases -d '{"name":"<product-name>-index","engine":"qdrant"}'
Check: QDRANT_URL and QDRANT_API_KEY are available to the pipeline.
2. Create the pipeline sandbox that fetches, extracts and indexes pages.
miosa create <product-name>-box --template agent-python --wait
Check: The sandbox is running and can fetch a public URL.
3. Create the computer the assistant browses with: pages that need a real browser (logins, scripts) are read there.
miosa computer create <product-name>-desktop
Check: computer.screenshot() shows a page the assistant opened.
4. Retrieve: for a question, call a search source you bring (a search API) or crawl a defined corpus, fetch the pages, and extract clean text with url, title and fetched_at.
Check: Every stored page has a URL and a fetch time.
5. Chunk, embed and upsert into Qdrant with the url, title and chunk id in the payload.
Check: The chunk count in Qdrant matches what you extracted.
6. Answer: give the model ONLY the retrieved chunks and instruct it to answer from them, citing chunk numbers; if the chunks do not contain the answer it must say so.
miosa prompt --computer <product-name>-desktop --harness osa --model <anthropic-model-id> --chat <chat-id> "Answer the question using only the provided chunks; cite them as [n]"
Check: Every claim carries a citation that resolves to a saved page; an unanswerable question gets "I could not find this".
7. Follow-ups: keep a thread id and the last turns, and rewrite the follow-up into a standalone query before retrieval.
Check: "And what about its price?" retrieves about the right product.
8. Publish the answer UI: stream the answer text first, then the citations.
miosa deploy create --from-sandbox <product-name>-box --name <product-name> --dir /workspace --port 3000 --run-command "npm start" --wait
Check: The public_url answers a question end to end.
Limits and costs
Respect robots.txt and rate limits when crawling; cache fetched pages so repeated questions do not refetch.
Bound retrieval: a fixed number of chunks per answer keeps latency and cost predictable.
Prototype: keep it to one machine at the default size, skip replicas and custom hostnames you do not need, and delete everything when you are done.
Acceptance checks
Answers cite sources and the citations resolve to saved pages.
A question the index cannot answer is declined, not invented.
Each customer is isolated in its own workspace and usage is metered against them.
Everything it created can be deleted with nothing left running.
What your choices added
- Build a product. a workspace per customer, per-customer metering and bill-to
- Agent suggests a name. proposes 3 product names and picks one; commands use <product-name>
- Harness: OSA. dispatches with `miosa prompt --harness osa`
- Model: Anthropic. your own provider key
- Prototype. one small machine, no extras, easy to delete
What you're building
an agentic browser that navigates, extracts and answers in place Modelled on Comet, by Perplexity.
A browser with an assistant built in: it reads the current page, navigates for the user and answers with sources.
Primitives you'll use: Computer · Sandbox · Agent and harness · Qdrant vectors · Deployment (App Engine)
- An assistant inside the browser
- Navigates and extracts on its own
- Answers about the current page
- Cited answers
Source: www.perplexity.ai/comet. Comet is a trademark of Perplexity; this guide is not affiliated with or endorsed by them.
What you need on MIOSA
Each row is one thing to create before you start. The number matches the step that uses it.
- Organization and API key Scopes every call; a workspace key is all a worker needs.
miosa api-key create app-key --preset agentDocs - Computer A persistent Linux desktop for browser, mouse, and screenshot work.
miosa computer create app-desktopDocs - Sandbox The isolated Linux workspace the agent writes code and runs commands in.
miosa create app-box --template nextjs --waitDocs - Qdrant vectors Managed vector store for search and embeddings, injected as QDRANT_URL.
miosa api POST /databases -d '{"name":"app-index","engine":"qdrant"}'Docs - A workspace per customer Isolates each customer’s machines, deployments, and data as they onboard.
miosa workspace create customer-1Docs - Branding and white-label Your name and slug on previews, deployments, and the desktop; customers never see MIOSA.
miosa orgDocs - Usage metering and bill-to Usage per customer, and which account pays for new machines.
miosa org billDocs - Agent and harness Turns a prompt into work: pick the harness and model a run uses.
miosa agent harnessesDocs - Deployment (App Engine) Publishes the app to an immutable, versioned URL with rollback.
miosa deploy create --from-sandbox app-box --name app --waitDocs
Architecture
How it maps onto MIOSA
Searches and reads sources -> a MIOSA sandbox running fetch/extract jobs (a computer when pages need a real browser)
Retrieval over what it read -> managed Qdrant (`QDRANT_URL`) for chunk embeddings
Answers with citations -> agent runs (`miosa prompt`, client.runs) streaming events that answer only from retrieved chunks and return source ids
Serves the answer UI or API -> a MIOSA deployment (`miosa deploy create`), immutable and versioned
A real browser the agent drives -> a MIOSA computer (persistent Linux desktop with a browser)
Data and storage
Qdrant holds chunk embeddings; the payload carries url, title, chunk id and fetched_at so every answer can cite a saved page.
Keep threads and answers in your own datastore, with their citations.
Auth and tenancy
Your organization is the platform; customers never get a MIOSA account, they sign into YOUR product. One workspace per customer, created as they onboard, isolates their machines, runs and data.
miosa workspace create comet-customer-1Tag every machine and run with the customer id in `metadata`, and never query across customers. Meter usage per customer with GET /api/v1/usage and set who pays with PUT /api/v1/bill-to (/docs/platform/usage-and-billing).
Agent loop
Harness: OSA is MIOSA's own harness and works with any model provider you connect, including your own model.
Model: Anthropic (Claude). Calls use my own provider key (`miosa connections add models`); MIOSA platform keys are never used.
Sessions: one chat per project or conversation, so the agent keeps its context. The first `miosa prompt` on a sandbox uses `--new-chat` (a chat id is printed); every later turn passes `--chat <chat-id>`. `--reuse chat` keeps one new machine per chat so files persist.
Streaming: follow a run with `miosa run follow <run-id>` or client.runs.streamEvents(run.id), and steer or stop it with `miosa run steer` and `miosa run interrupt`.
Retrieval comes first, generation second: the model sees only retrieved chunks and must cite them. The harness runs in the pipeline sandbox so fetching and extraction code is isolated.
Steps
Create the vector index.
miosa api POST /databases -d '{"name":"comet-index","engine":"qdrant"}'Check: QDRANT_URL and QDRANT_API_KEY are available to the pipeline.
Create the pipeline sandbox that fetches, extracts and indexes pages.
miosa create comet-box --template agent-python --waitCheck: The sandbox is running and can fetch a public URL.
Create the computer the assistant browses with: pages that need a real browser (logins, scripts) are read there.
miosa computer create comet-desktopCheck: computer.screenshot() shows a page the assistant opened.
Retrieve: for a question, call a search source you bring (a search API) or crawl a defined corpus, fetch the pages, and extract clean text with url, title and fetched_at.
Check: Every stored page has a URL and a fetch time.
Chunk, embed and upsert into Qdrant with the url, title and chunk id in the payload.
Check: The chunk count in Qdrant matches what you extracted.
Answer: give the model ONLY the retrieved chunks and instruct it to answer from them, citing chunk numbers; if the chunks do not contain the answer it must say so.
miosa prompt --computer comet-desktop --harness osa --model <anthropic-model-id> --chat <chat-id> "Answer the question using only the provided chunks; cite them as [n]"Check: Every claim carries a citation that resolves to a saved page; an unanswerable question gets "I could not find this".
Follow-ups: keep a thread id and the last turns, and rewrite the follow-up into a standalone query before retrieval.
Check: "And what about its price?" retrieves about the right product.
Publish the answer UI: stream the answer text first, then the citations.
miosa deploy create --from-sandbox comet-box --name comet --dir /workspace --port 3000 --run-command "npm start" --waitCheck: The public_url answers a question end to end.
Limits and costs
Respect robots.txt and rate limits when crawling; cache fetched pages so repeated questions do not refetch.
Bound retrieval: a fixed number of chunks per answer keeps latency and cost predictable.
Prototype: keep it to one machine at the default size, skip replicas and custom hostnames you do not need, and delete everything when you are done.
Acceptance checks
Answers cite sources and the citations resolve to saved pages.
A question the index cannot answer is declined, not invented.
Each customer is isolated in its own workspace and usage is metered against them.
Everything it created can be deleted with nothing left running.