Files
api/services/batch-agent
Roberto Musso 55500cc818 feat(batch-agent): add Langfuse prompt management
- _get_system_prompt helper: fetches managed prompts from Langfuse
  with hardcoded fallback (same pattern as chat service)
- journey.py: journey_system prompt manageable via Langfuse
- agent_runner.py: batch_file_classifier, batch_processing,
  batch_cloud_processing prompts all manageable via Langfuse
- redis_consumer.py: link_prompt_to_trace for all three handlers
2026-03-23 22:30:36 +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.