# databricks-industry-solutions/lakercm architecture

> Architecture diagram of the GitHub repository databricks-industry-solutions/lakercm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/databricks-industry-solutions/lakercm
- Repository: https://github.com/databricks-industry-solutions/lakercm
- Video tour (about a minute): https://gitdiagram.com/databricks-industry-solutions/lakercm/video

## Overview

LakeRCM is a Databricks revenue-cycle review accelerator. A document enters the lakehouse pipeline for extraction, code validation, and confidence scoring; uncertain cases reach the clinician-facing reviewer, where a LangGraph assistant can answer policy questions and cite sources. Reviewer decisions feed operational storage and analytics, while agent traces and scored feedback support evaluation and gated prompt improvement. The README documents pipeline and analytics stages whose implementation is not in the supplied tree; those relationships are cited to the README rather than presented as inspected source.

Main entry points: [`agent_app/agent/graph.py`](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/graph.py) (Agent graph), [`agent_app/main.py`](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/main.py) (Agent API), [`reviewer_app/frontend/src/App.jsx`](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/App.jsx) (Reviewer app), [`reviewer_app/routes/documents.py`](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/routes/documents.py) (Review routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Document intelligence"]
  node_document_source(("Document arrival"))
  node_document_pipeline["Parse and score"]
  node_code_validation["Code validation"]
end

subgraph group_review["Clinician review"]
  node_reviewer_ui["Reviewer app<br/>[App.jsx]"]
  node_extraction_review["Extraction review"]
  node_assistant_ui["In-document assistant"]
  node_review_api["Review routes<br/>[documents.py]"]
  node_chat_api["Chat route<br/>[chat.py]"]
end

subgraph group_agent["Agent and data services"]
  node_review_db[("Operational database<br/>[lakehouse_db.py]")]
  node_agent_app["Agent API<br/>[main.py]"]
  node_agent_graph["Agent graph<br/>[graph.py]"]
  node_agent_tools["Agent tools<br/>[tools.py]"]
  node_model_routing["Model routing<br/>[routing.py]"]
  node_llm_client["LLM client<br/>[llm.py]"]
  node_agent_config["Agent configuration<br/>[config.py]"]
  node_checkpointer["Conversation checkpoints<br/>[checkpointer.py]"]
  node_agent_store[("Agent memory store<br/>[store.py]")]
  node_policy_search["Policy retrieval<br/>[tools.py]"]
end

subgraph group_learning["Evaluation and learning"]
  node_analytics["Review analytics"]
  node_trace_feedback["Tracing and feedback<br/>[observability.py]"]
  node_eval_dataset["Evaluation datasets<br/>[dataset.py]"]
  node_eval_runner["Evaluation and scoring<br/>[run_eval.py]"]
  node_prompt_optimization["Prompt optimization<br/>[optimize.py]"]
end

node_clinician(("Clinician"))
node_lakehouse[("Unity Catalog")]
node_payer_policy[("Payer policies")]
node_model_service["Model service"]

node_document_source -->|"submits documents"| node_document_pipeline
node_document_pipeline -->|"extracts then validates"| node_code_validation
node_document_pipeline -->|"writes curated data"| node_lakehouse
node_code_validation -->|"routes uncertain cases"| node_reviewer_ui
node_clinician -->|"reviews cases"| node_reviewer_ui
node_reviewer_ui -->|"renders review"| node_extraction_review
node_reviewer_ui -.->|"opens assistant"| node_assistant_ui
node_extraction_review -.->|"submits decisions"| node_review_api
node_assistant_ui -.->|"sends chat"| node_chat_api
node_assistant_ui -->|"records proposals"| node_review_api
node_review_api -.->|"reads and writes reviews"| node_review_db
node_chat_api -->|"calls agent"| node_agent_app
node_agent_app -->|"runs graph"| node_agent_graph
node_agent_graph -->|"dispatches tools"| node_agent_tools
node_agent_graph -->|"uses model client"| node_llm_client
node_agent_graph -->|"persists state"| node_checkpointer
node_agent_graph -->|"uses memory store"| node_agent_store
node_agent_tools -->|"queries records"| node_review_db
node_agent_tools -.->|"retrieves passages"| node_policy_search
node_policy_search -->|"searches policies"| node_payer_policy
node_llm_client -->|"calls model endpoint"| node_model_service
node_agent_app -.->|"selects model tier"| node_model_routing
node_model_routing -->|"reads routing settings"| node_agent_config
node_review_api -->|"triggers refresh"| node_analytics
node_review_db -->|"syncs review data"| node_analytics
node_analytics -->|"feeds reporting"| node_lakehouse
node_agent_app -->|"traces turns"| node_trace_feedback
node_trace_feedback -.->|"supplies feedback"| node_eval_dataset
node_eval_dataset -.->|"provides examples"| node_eval_runner
node_eval_runner -->|"scores candidates"| node_prompt_optimization
node_prompt_optimization -.->|"proposes prompt updates"| node_model_service

click node_reviewer_ui "https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/App.jsx"
click node_extraction_review "https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/components/ExtractionComparison.jsx"
click node_assistant_ui "https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/components/ReviewerAssistant/ReviewerAssistantPane.jsx"
click node_review_api "https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/routes/documents.py"
click node_chat_api "https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/routes/chat.py"
click node_review_db "https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/services/lakehouse_db.py"
click node_agent_app "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/main.py"
click node_agent_graph "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/graph.py"
click node_agent_tools "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/tools.py"
click node_model_routing "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/routing.py"
click node_llm_client "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/llm.py"
click node_agent_config "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/config.py"
click node_checkpointer "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/services/checkpointer.py"
click node_agent_store "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/services/store.py"
click node_policy_search "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/tools.py"
click node_trace_feedback "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/services/observability.py"
click node_eval_dataset "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/eval/dataset.py"
click node_eval_runner "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/eval/run_eval.py"
click node_prompt_optimization "https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/eval/optimize.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_document_source,node_document_pipeline,node_code_validation toneBlue
class node_reviewer_ui,node_extraction_review,node_assistant_ui,node_review_api,node_chat_api,node_lakehouse,node_payer_policy toneAmber
class node_review_db,node_agent_app,node_agent_graph,node_agent_tools,node_model_routing,node_llm_client,node_agent_config,node_checkpointer,node_agent_store,node_policy_search toneMint
class node_analytics,node_trace_feedback,node_eval_dataset,node_eval_runner,node_prompt_optimization toneRose
class node_clinician,node_model_service toneIndigo
```

## Components

### Document intelligence

- **Document arrival**
- **Parse and score**
- **Code validation**

### Clinician review

- [Reviewer app](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/App.jsx): `reviewer_app/frontend/src/App.jsx`
- [Extraction review](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/components/ExtractionComparison.jsx): `reviewer_app/frontend/src/components/ExtractionComparison.jsx`
- [In-document assistant](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/frontend/src/components/ReviewerAssistant/ReviewerAssistantPane.jsx): `reviewer_app/frontend/src/components/ReviewerAssistant/ReviewerAssistantPane.jsx`
- [Review routes](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/routes/documents.py): `reviewer_app/routes/documents.py`
- [Chat route](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/routes/chat.py): `reviewer_app/routes/chat.py`

### Agent and data services

- [Operational database](https://github.com/databricks-industry-solutions/lakercm/blob/main/reviewer_app/services/lakehouse_db.py): `reviewer_app/services/lakehouse_db.py`
- [Agent API](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/main.py): `agent_app/main.py`
- [Agent graph](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/graph.py): `agent_app/agent/graph.py`
- [Agent tools](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/tools.py): `agent_app/agent/tools.py`
- [Model routing](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/routing.py): `agent_app/agent/routing.py`
- [LLM client](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/llm.py): `agent_app/agent/llm.py`
- [Agent configuration](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/config.py): `agent_app/config.py`
- [Conversation checkpoints](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/services/checkpointer.py): `agent_app/services/checkpointer.py`
- [Agent memory store](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/services/store.py): `agent_app/services/store.py`
- [Policy retrieval](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/agent/tools.py): `agent_app/agent/tools.py`

### Evaluation and learning

- **Review analytics**
- [Tracing and feedback](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/services/observability.py): `agent_app/services/observability.py`
- [Evaluation datasets](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/eval/dataset.py): `agent_app/eval/dataset.py`
- [Evaluation and scoring](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/eval/run_eval.py): `agent_app/eval/run_eval.py`
- [Prompt optimization](https://github.com/databricks-industry-solutions/lakercm/blob/main/agent_app/eval/optimize.py): `agent_app/eval/optimize.py`

### Other components

- **Clinician**
- **Unity Catalog**
- **Payer policies**
- **Model service**

## Connections

- Document arrival → Parse and score: submits documents
- Parse and score → Code validation: extracts then validates
- Parse and score → Unity Catalog: writes curated data
- Code validation → Reviewer app: routes uncertain cases
- Clinician → Reviewer app: reviews cases
- Reviewer app → Extraction review: renders review (evidence: `reviewer_app/frontend/src/App.jsx`)
- Reviewer app → In-document assistant: opens assistant
- Extraction review → Review routes: submits decisions
- In-document assistant → Chat route: sends chat
- In-document assistant → Review routes: records proposals (evidence: `reviewer_app/frontend/src/components/ReviewerAssistant/ReviewerAssistantPane.jsx`)
- Review routes → Operational database: reads and writes reviews
- Chat route → Agent API: calls agent (evidence: `reviewer_app/routes/chat.py`)
- Agent API → Agent graph: runs graph (evidence: `agent_app/main.py`)
- Agent graph → Agent tools: dispatches tools (evidence: `agent_app/agent/graph.py`)
- Agent graph → LLM client: uses model client (evidence: `agent_app/agent/graph.py`)
- Agent graph → Conversation checkpoints: persists state (evidence: `agent_app/agent/graph.py`)
- Agent graph → Agent memory store: uses memory store (evidence: `agent_app/agent/graph.py`)
- Agent tools → Operational database: queries records (evidence: `agent_app/agent/tools.py`)
- Agent tools → Policy retrieval: retrieves passages (evidence: `agent_app/agent/tools.py`)
- Policy retrieval → Payer policies: searches policies
- LLM client → Model service: calls model endpoint (evidence: `agent_app/agent/llm.py`)
- Agent API → Model routing: selects model tier (evidence: `agent_app/main.py`)
- Model routing → Agent configuration: reads routing settings (evidence: `agent_app/agent/routing.py`)
- Review routes → Review analytics: triggers refresh
- Operational database → Review analytics: syncs review data
- Review analytics → Unity Catalog: feeds reporting
- Agent API → Tracing and feedback: traces turns (evidence: `agent_app/main.py`)
- Tracing and feedback → Evaluation datasets: supplies feedback
- Evaluation datasets → Evaluation and scoring: provides examples
- Evaluation and scoring → Prompt optimization: scores candidates
- Prompt optimization → Model service: proposes prompt updates
