Agentic-RAG-Platform

ADR-004: Custom agent state machine (not LangGraph)

Context

We need to orchestrate an agentic RAG loop: classify → plan → retrieve (possibly multiple times) → validate → generate → verify citations. This requires a stateful loop with termination conditions, loop detection, and timeouts.

Problem

Choose between building a custom state machine, using LangGraph, or using another orchestration framework (e.g., CrewAI, AutoGen).

Options considered

Option A: Custom state machine

Option B: LangGraph

Option C: CrewAI / AutoGen

Decision

Option A: Custom state machine.

Rationale

Trade-offs

Consequences

What happens if this component fails?

How would we replace it later?