Files
api/services/batch-agent
Roberto Musso 333bba6fdd feat(batch-agent): extract Batch Agent Service (Step 3)
- agent_runner: local directory + cloud agent orchestration via Redis
- 5 domain agents: filesystem, task, note, project, timeline
- integrations: Gmail, MS Graph (Outlook + Teams)
- journey: guided chatbot conversation to build prompt_template
- routes: REST endpoints (catalog, can-create, trigger)
- redis_consumer: subscribes to batch:request:* pattern
- ws_context: Redis-based execute_on_client for tool round-trip
- Dockerfile with 300s timeout for long-running batch jobs
2026-03-23 07:19:02 +01:00
..

Batch Agent Service

Owns: agent_runner, journey builder, filesystem_agent, integrations (Gmail, MS Graph).

Tables owned

  • local_agent_configs
  • cloud_agent_configs
  • agent_run_logs

Endpoints

  • GET /agents/catalog
  • POST /agents/can-create
  • POST /agents/trigger
  • GET /agents/{id}/history

Redis channels

  • Subscribe: batch:request:{user_id}
  • Publish: ws:out:{user_id} (journey replies + tool calls)
  • BRPOP: tool:result:{call_id} (30s timeout)
  • SET+EX: journey:{user_id} (session state, TTL 1800s)

TODO

  • Integrate Langfuse tracing (reuse services/chat/app/tracing.py pattern — trace_span(), get_langfuse_callback(), prompt management). Each batch agent run should create a trace with input/output, link prompts, and pass the LangChain CallbackHandler to LLM calls.