How mkatika37/credit-memo-assistant works
This is an AI mortgage credit-memo assistant: it automates memo assembly, not lending decisions. An underwriter submits an application through the Streamlit console; the API validates it, runs a bounded LangGraph assessment, checks the drafted memo, persists an audit record, and returns it for human review. The graph computes metrics and retrieves policy before triage, which may investigate missing or borderline cases or gather supporting documents. Portfolio policy-impact simulation is a separate capability. Relationships follow the documented workflow and shown source calls; some unsampled implementation details are represented only at subsystem level.
Main entry points: agent.py LangGraph workflow · main.py FastAPI service · policy_impact.py Policy impact simulation · app.py Streamlit console
Components 26
Underwriter console
- Streamlit console
frontend/app.py - Assessment and portfolio pages
frontend/pages_new_assessment.py - Policy impact page
frontend/pages_policy_impact.py - API client helpers
frontend/common.py
Credit assessment
- FastAPI service
app/main.py - LangGraph workflow
app/agent.py - Application ingest
app/nodes.py - Deterministic scoring
app/metrics.py - Risk assessment and triage
app/nodes.py - Case investigation
app/nodes.py - Memo drafting
app/nodes.py - LLM provider client
app/llm.py
Policy and evidence
- Policy retrieval
app/rag.py - Lending policy corpus
data/policies - Document evidence gathering
app/nodes.py - Loan evidence documents
data/documents
Controls and audit
- Input guardrails
app/guardrails.py - Human-review gate
app/nodes.py - Output grounding checks
app/guardrails.py - Audit and portfolio store
app/db.py - Request observability
app/observability.py - Evaluation suite
eval/run.py
Portfolio analysis
- Policy impact simulation
app/policy_impact.py - Policy thresholds
app/policy.py
Other components
- Underwriter
- Anthropic or OpenAI
Connections 32
- Underwriter → Streamlit console: uses
README.md - Streamlit console → Assessment and portfolio pages: navigates
frontend/app.py - Streamlit console → Policy impact page: navigates
frontend/app.py - Assessment and portfolio pages → API client helpers: calls
frontend/common.py - Policy impact page → API client helpers: calls
frontend/common.py - API client helpers → FastAPI service: sends requests
frontend/common.py - FastAPI service → Input guardrails: validates input
README.md - FastAPI service → LangGraph workflow: runs workflow
README.md - LangGraph workflow → Application ingest: dispatches
app/agent.py - Application ingest → Deterministic scoring: computes ratios
app/nodes.py - LangGraph workflow → Deterministic scoring: dispatches scoring
app/agent.py - LangGraph workflow → Policy retrieval: dispatches retrieval
app/agent.py - Policy retrieval → Lending policy corpus: retrieves chunks
README.md - LangGraph workflow → Risk assessment and triage: dispatches
app/agent.py - Risk assessment and triage → Case investigation: routes cases
app/agent.py - Case investigation → Deterministic scoring: reassesses via
app/nodes.py - Risk assessment and triage → Document evidence gathering: routes cases
app/agent.py - Document evidence gathering → Loan evidence documents: fetches evidence
README.md - LangGraph workflow → Memo drafting: dispatches
app/agent.py - Memo drafting → LLM provider client: drafts with
app/nodes.py - LLM provider client → Anthropic or OpenAI: invokes
app/llm.py - LangGraph workflow → Human-review gate: dispatches
app/agent.py - FastAPI service → Output grounding checks: checks memo
app/main.py - FastAPI service → Audit and portfolio store: persists audit
app/main.py - LangGraph workflow → Request observability: instruments nodes
app/agent.py - FastAPI service → Request observability: reports metrics
app/main.py - Policy impact page → Policy impact simulation: requests simulation
README.md - FastAPI service → Policy impact simulation: runs analysis
app/main.py - Policy impact simulation → Audit and portfolio store: loads portfolio
app/policy_impact.py - Policy impact simulation → Policy thresholds: applies changes
app/policy_impact.py - Policy impact simulation → LLM provider client: drafts report
app/policy_impact.py - Underwriter → Evaluation suite: can run evaluation
README.md