{"wiki":{"id":143,"slug":"pa-c0","entity_type":"droid","entity_id":"pa-c0","title":"PA-C0 — Reply Drafter","prose_md":"## About\n\nPA-C0 is Carol's voice. Every WhatsApp message and web-chat reply that Carol sends passes through this droid. It takes the full conversation context — system prompt, chat history, tool results, and service routing — and generates a natural, warm reply in Carol's tone.\n\n## How it works\n\n1. **Builds the prompt** — assembles conversation history, user message, and any attachment context into a structured LLM prompt\n2. **Calls the LLM** — sends the prompt through the active provider (currently DeepSeek) with Carol's system prompt\n3. **Handles failures** — if the primary LLM fails, falls back to OpenAI for a degraded but still-useful response\n4. **Parses and returns** — cleans the response and returns it to the caller (agent_loop.py)\n\n## Where it fits\n\nPA-C0 is droid #1 in Carol's reply pipeline. It runs synchronously in the hot path — the user is waiting while it works. It does NOT decide *what* to say (that's PA-C12's routing job) or *whether* to say it (that's QG-01's quality gate). It just drafts the words.\n\n| Upstream | Downstream |\n|---|---|\n| agent_loop (orchestration) | PA-C11 (reviewer, decommissioned — pass-through) |\n| PA-C12 (service router) | QG-01 (quality guard, strips artifacts before send) |\n\n## Owner\n\nCarol (agt_008) — Sales agent, Carolverse OS's WhatsApp and web presence.","namesake_json":"{}","profile_pic_path":"/static/avatars/droid/pa-c0.png","source_hash":"","status":"active","last_generated_at":null,"created_at":"2026-07-07 18:20:14","updated_at":"2026-07-07 18:24:07"},"facts":{"id":"pa-c0","name":"Carol Intent Drafter","machine_name":"","owner":"agt_008","function":"Generates Carol's WhatsApp and web chat replies via LLM. The hot-path droid that drafts every user-facing response in Carol's voice, incorporating system prompt, conversation history, tool results, and service routing context.","process_type":"scheduled","schedule":"","process_name":"","avatar_color":"#94a3b8","created_for":"Carol needs a dedicated reply-generation droid that handles the LLM call, response parsing, and error fallback. Before PA-C0, reply logic was scattered across message_handler.py and agent.py, making it hard to tune Carol's voice independently from the rest of the processing pipeline.","purpose":"PA-C0 is the primary reply generator for Carol. Every message Carol sends to a user flows through this droid. It takes the full context (system prompt, conversation history, service routing decision from PA-C12, and any tool results) and produces a natural, conversational reply that sounds like Carol.","duties":"- Build the full user prompt from conversation history and the latest message\n- Call the LLM with Carol's system prompt and tool-augmented context\n- Handle LLM failures gracefully with OpenAI fallback\n- Parse and clean the LLM response before returning it to the caller\n- Enable tool-use for image-attachment messages via Read access","constraints":"- Must complete within 120s (300s with image attachments)\n- Runs synchronously in the hot path — latency directly impacts user experience\n- Does NOT decide what to say — only generates the text. Routing decisions are made upstream by PA-C12.","status":"running","gender":"","archetype":"","building_block":"conversation","service_override":null,"enabled":1,"task_key":"sales.conversation_served","model_free":0},"page":{"type":"droid","page_class":"main","class_label":"Main page","kind_label":"Droid","kind_gloss":"","listed":true}}