Automating Private Credit Deal Analysis with LLMs and RAG
riskspan · Finance · 2025 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Private credit investment analysis
Riskspan needed to reduce private-credit deal analysis from weeks of document review and Excel modeling to days while handling confidential, non-standard deal documents and waterfall logic.
Constraints:
- private credit deals are custom and non-standard
- critical information lives across PDFs, emails, amendments, and notes
- single deals can include 17-20 amendments
- documents are too large for a single Claude context
- investment waterfall models require generated code and human review
Architecture
Riskspan built an AWS-based GenAI workflow that extracts deal information from scanned PDFs, emails, handwritten notes, and amendments; uses embeddings and RAG through Bedrock because Claude cannot ingest all source material at once; has Claude dynamically generate code for waterfall investment logic; runs generated code in serverless infrastructure; passes outputs into existing legacy APIs; and keeps a human in the loop for final validation.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR deal-document-ingestion[Deal document ingestion] --> embedding-and-rag-layer[Embedding and RAG layer] embedding-and-rag-layer --> claude-code-generator[Claude code generator] claude-code-generator --> serverless-code-runner[Serverless code runner] serverless-code-runner --> legacy-api-layer[Legacy API layer] legacy-api-layer --> human-review[Human review]
Components
| Component | Role | Interacts with |
|---|---|---|
Deal document ingestion |
Collects scanned PDFs, emails, handwritten notes, amendments, and other deal materials. | Embedding and RAG layer |
Embedding and RAG layer |
Retrieves relevant context because the full deal corpus exceeds the LLM context window. | Deal document ingestion, Claude code generator |
Claude code generator |
Generates code for investment waterfall logic from retrieved deal context. | Embedding and RAG layer, Serverless code runner |
Serverless code runner |
Executes generated waterfall-model code cost-effectively. | Claude code generator, Legacy API layer |
Legacy API layer |
Integrates generated forecasts into Riskspan's existing customer-facing platform. | Serverless code runner, Human review |
Human review |
Validates outputs before deal analysis is finalized. | Legacy API layer |
Data flow
Deal documents are ingested from PDFs, emails, notes, and amendments. Extraction tools and embeddings make relevant context retrievable through Bedrock RAG. Claude generates waterfall-model code from retrieved facts, serverless infrastructure executes the code, and legacy APIs deliver results inside Riskspan's existing customer experience.
4 supporting quotes
Why this architecture
RAG is required because deal files exceed a single context window and contain confidential information across many formats. Code generation is necessary because each private-credit waterfall can be bespoke, and serverless execution keeps per-deal cost low. Existing APIs preserve customer workflow continuity instead of replacing the platform.
3 supporting quotes
Models used: Claude · Bedrock embeddings/RAG
Scale
- Riskspan runs trillions of dollars of assets through its platform.“We run trillions of dollars of assets on a daily basis. We run very granular loan-level analysis, like 45 million loans across, you know,”transcript, stated
- The company analyzes about 45 million loans across more than 70 asset classes.“like 45 million loans across, you know, 70-plus asset classes. And again, to reiterate, we've been on it with AWS”transcript, stated
- Private credit is described as a $14 trillion market with $9 trillion in untapped opportunity.“It's 14T with a trillion, and with a lot of data. So, what are the challenges? Can you walk us through this because you talked about”transcript, stated“on that $9-trillion uncapped opportunity, instead of reinventing the wheel and building yet another system that didn't solve the problem.”transcript, stated
- A deal can involve 17-20 amendments.“There are 17 to 20 amendments that occur, which makes it very difficult to extract all the information in a structured format”transcript, stated
- Processing time dropped from three to four weeks to about three to five days.“taking the processing time for a deal structure evaluation from three to four weeks to about three to five days”transcript, stated
- Cost per deal dropped to less than $50 including human review.“and the cost, you know, was like less than $50, including the human in the loop being involved. - So, pretty impressive”transcript, stated
Alternatives considered (roads not taken)
Manual analyst review and Excel modeling
Rejected because: The baseline took weeks and required extracting data into Excel models.
Give all documents directly to Claude
Rejected because: The document corpus was too large for Claude to process directly.
Replace legacy APIs
Rejected because: Riskspan kept the legacy API layer to deliver a seamless experience across investments.
Patterns
rag-retrieval (retrieval)
Embeddings and RAG retrieve relevant deal context from large, heterogeneous private-credit documents.
tool-use-orchestration (workflow)
The workflow coordinates extraction tools, Bedrock retrieval, Claude code generation, serverless execution, and legacy APIs.
human-in-the-loop-gate (workflow)
Human review remains included in the per-deal cost and validation path.
cost-aware-routing (operations)
Serverless execution and automation reduced per-deal cost to less than $50.
structured-output-contract (data)
Generated code models waterfall investment logic in a form legacy APIs can execute and present.
Tradeoffs
Use RAG with Claude
Chose retrieval over large deal corpora over single-prompt full-document analysis.
Rationale: The document volume was too large for direct model input.
Generate executable waterfall code
Chose Claude-generated code run serverlessly over manual Excel model creation.
Rationale: Custom deal logic still needed executable financial modeling, but automation made it faster and cheaper.
Keep legacy APIs
Chose integrate generated forecasts into existing APIs over replace the customer platform.
Rationale: Legacy APIs already delivered the seamless multi-investment customer experience.
Gotchas (what bit them)
Private credit context exceeds LLM context windows.
Root cause: Deals include many document types and amendments, creating too much data for Claude directly.
Resolution: Riskspan used embeddings and RAG through Bedrock.
Deal data is confidential and heterogeneous.
Root cause: Inputs include scanned PDFs, unstructured emails, handwritten notes, and amendments.
Resolution: The system extracts from heterogeneous sources while preserving confidentiality requirements.
Evaluation
Riskspan reports business outcome metrics: processing time, customer onboarding speed, scalability, and cost reduction.
Metrics: deal processing time · customer onboarding speed · scalability · per-deal processing cost · market opportunity
3 supporting quotes
Outcomes
- Deal structure evaluation dropped from three to four weeks to three to five days.
- Customer onboarding became 87% faster.
- The system delivered a reported 10x scalability improvement.
- Per-deal cost dropped by 90x to less than $50 including human review.
Riskspan reports trillions of dollars in assets, 45 million loans, 70 asset classes, and a $9T private-credit opportunity.