How vpr184222/careflow-agent works
CareFlow Agent is a synthetic healthcare-operations workspace for policy questions and reviewer-gated case updates. An operator selects a case and submits a query; the API invokes a LangGraph agent that reads the case and retrieves policy evidence, then returns an extractive answer and, when requested, a pending proposal. A reviewer decision is persisted with the case change and audit event in one transaction. The graph follows the sampled API, agent, store and UI code; the README documents the Ollama option and broader workflow capabilities.
Main entry points: agent.py Execute tools · store.py Persistence and decisions · main.py HTTP API · App.tsx Case workspace
Components 14
Operator workspace
- Case workspace
frontend/src/App.tsx - HTTP API
backend/app/main.py
Agent workflow
- Agent run
backend/app/agent.py - Plan tools
backend/app/agent.py - Execute tools
backend/app/agent.py - Render answer
backend/app/agent.py
Policy evidence
- Policy documents
backend/data/policies - TF-IDF retrieval
backend/app/retrieval.py
Review and persistence
- Pending proposal
backend/app/agent.py - Persistence and decisions
backend/app/store.py - SQLite
backend/app/store.py
Other components
- Operator
- Reviewer
- Local Ollama
Connections 20
- Operator → Case workspace: uses
README.md - Reviewer → Case workspace: decides
README.md - Case workspace → HTTP API: requests
frontend/src/App.tsx - HTTP API → Agent run: runs agent
backend/app/main.py - HTTP API → Persistence and decisions: reads and decides
backend/app/main.py - Agent run → Plan tools: starts graph
backend/app/agent.py - Plan tools → Execute tools: dispatches tools
backend/app/agent.py - Plan tools → Render answer: routes without tools
backend/app/agent.py - Execute tools → Plan tools: replans
backend/app/agent.py - Execute tools → Render answer: routes results
backend/app/agent.py - Plan tools → Local Ollama: requests tool calls
backend/app/agent.py - Execute tools → Persistence and decisions: reads case
backend/app/agent.py - Execute tools → TF-IDF retrieval: searches policies
backend/app/agent.py - Policy documents → TF-IDF retrieval: loads documents
backend/app/retrieval.py - Execute tools → Pending proposal: creates proposal
backend/app/agent.py - Render answer → Pending proposal: reports pending
backend/app/agent.py - Agent run → Persistence and decisions: saves run
backend/app/agent.py - Persistence and decisions → SQLite: persists state
backend/app/store.py - Local Ollama → Plan tools: returns reply
backend/app/agent.py - Persistence and decisions → SQLite: commits decision and audit
backend/app/store.py