1. What LangChain provides

LangChain is not the workflow engine. In ClaimFlow AI, LangChain is used to connect:

claim context + model + tools + structured output

LangChain helps with:

model calling
tool definitions
structured action schemas
agent-style planning
controlled tool orchestration

LangChain should not replace:

Prisma database
review queue
validation rules
RAG citation guardrails
business workflow state
human review decisions

2. Model

The model is the reasoning layer.

In ClaimFlow AI, the model answers:

Given this claim state, what should happen next?

Examples:

Missing FIR number → request missing evidence
Weak policy evidence → escalate to human
Repair estimate alone → mark needs more evidence
Review already pending → no action

The model should suggest actions, not directly approve or reject claims.


3. Context

Context is the claim state passed to the model.

In ClaimFlow AI, context comes from buildAgentContext(runId).

It includes: