{"wiki":{"id":145,"slug":"carol-agent","entity_type":"droid","entity_id":"carol-agent","title":"Carol Agent — Main Daemon Loop","prose_md":"## About\n\nCarol Agent is the top-level daemon that keeps Carol alive on WhatsApp. It's the single process (port 7111) that receives Meta webhooks, validates them, queues inbound messages, and orchestrates all of Carol's background workers. If this process stops, Carol goes silent.\n\n## Responsibilities\n\n### Webhook handling\n- Receives Meta WhatsApp webhooks at `POST /api/webhook`\n- Validates signatures against the app secret\n- Deduplicates messages and queues them for batch processing\n\n### Background workers\nLaunches and manages 8 worker threads that run continuously:\n\n| Worker | Droid | What it does |\n|---|---|---|\n| Proactive planner | PA-C1 | Generates tomorrow's outreach plan at 21:00 daily |\n| Profile builder | PA-C3 | Suggests profile-gap hints hourly |\n| Web researcher | PA-C4 | Searches public info on users weekly |\n| EOD reporter | PA-C5 | Composes end-of-day summary |\n| Distiller | PA-C6 | Curates conversation facts |\n| Tool follow-up | PA-C8 | Sends pending tool-request follow-ups at 10:00 |\n| Scorer | PA-C9 | Scores conversations every 15 min |\n| Profiler | PA-C10 | Infers user interests every 20 min |\n\n### Internal relay\nExposes `POST /api/messages/Carol` for Agentbook-to-WhatsApp agent messaging.\n\n## Owner\n\nCarol (agt_008) — Sales agent, Carolverse OS's WhatsApp and web presence.","namesake_json":"{}","profile_pic_path":"/static/avatars/droid/carol-agent.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":"carol-agent","name":"Carol Main Agent Loop","machine_name":"","owner":"agt_008","function":"Carol's main agent daemon loop (port 7111). The webhook receiver, message queue dispatcher, proactive worker orchestrator, and internal relay endpoint. Owns the top-level server process that keeps Carol alive and responding on WhatsApp.","process_type":"daemon","schedule":"","process_name":"","avatar_color":"#94a3b8","created_for":"Carol originally ran as a monolithic WhatsApp agent. carol-agent was separated as the top-level daemon during the modular architecture migration, owning the process lifecycle and webhook handling while delegating reply generation to PA-C0, routing to PA-C12, and quality to QG-01.","purpose":"carol-agent is the top-level daemon that runs Carol's WhatsApp presence. It receives Meta webhooks, validates them, queues inbound messages, dispatches background workers (proactive planner, profile builders, conversation scorers), and exposes the internal relay API for agent-to-agent messaging. It is the single process that must stay running for Carol to be reachable.","duties":"- Receive and validate Meta WhatsApp webhooks\n- Queue inbound messages for batch processing\n- Run background worker threads (PA-C1 proactive planner, PA-C3 profile builder, PA-C4 web researcher, PA-C5 EOD reporter, PA-C6 distiller, PA-C9 scorer, PA-C10 profiler)\n- Expose internal relay endpoint for Agentbook-to-WhatsApp messaging\n- Manage per-user conversation databases and shared memory logging\n- Provide OpenAI fallback when the primary LLM is unavailable","constraints":"- Must bind to port 7111 — Meta webhook URL is configured to this port\n- Runs as the 'carol' OS user for process isolation\n- Background workers must not block the main webhook loop\n- Conversation databases are per-user, stored under users/ directory","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}}