lendctl-ai
v0.2.2
Published
Autonomous lending decision agent powered by LendCtl CLI suite
Downloads
841
Maintainers
Readme
LendCtl AI
🏦 Autonomous Lending Decision Agent — Ask lending questions in plain English. Get instant, compliant decisions.
npm install -g lendctl-ai
lendctl-ai ask 'Can I qualify for a $400k mortgage with $90k income and 720 credit?'⚠️ Note: Use single quotes around questions with
$signs to prevent shell variable expansion.
✅ Fully Standalone
v0.2.2+: All 8 calculators run as pure JavaScript — no external CLI dependencies. Just npm install and go.
Features
- 🤖 Natural Language Interface — Ask lending questions like you'd ask a loan officer
- 📋 Autonomous Planning — Decomposes complex questions into calculations
- ✅ Self-Validation — Verifies calculations and compliance automatically
- 📊 8 Built-in Calculators — Income, credit, mortgage, auto, personal, card, compliance, audit
- 📝 Audit Trail — Every decision logged for regulatory compliance
- 🔌 Multi-Channel — CLI, REST API, WhatsApp, Telegram
Quick Start
# Install globally
npm install -g lendctl-ai
# Set your OpenAI API key
export OPENAI_API_KEY=sk-...
# Ask a question (use single quotes for $ signs!)
lendctl-ai ask 'I make $85,000/year with a 720 credit score. Can I afford a $350,000 house?'
# Interactive chat
lendctl-ai chat
# Start API server
lendctl-ai serveExample
$ lendctl-ai ask 'I make $85,000/year and want to buy a $350,000 home with 10% down. I have a 720 credit score and $400/month in car payments.'Output:
╔═══════════════════════════════════════════════════════════╗
║ LendCtl AI - Autonomous Lending Decision Agent ║
╚═══════════════════════════════════════════════════════════╝
📋 Question: I make $85,000/year and want to buy...
📝 Report:
**Summary**: ✅ You likely qualify for this mortgage
**Key Numbers**:
- Gross Monthly Income: $7,083
- Est. Housing Payment: $2,100 (PITI)
- Front-end DTI: 29.6%
- Back-end DTI: 35.3%
- LTV: 90% (PMI required)
**Analysis**:
Your debt-to-income ratios are within acceptable limits for conventional
financing. With a 720 credit score, you qualify for competitive rates.
The 10% down payment means you'll need PMI until you reach 20% equity.
**Recommendation**:
Approved for conventional financing. Consider:
1. Increasing down payment to 20% to eliminate PMI
2. Shopping multiple lenders for best rate with your credit profile
**Compliance Notes**:
- QM Safe Harbor: ✓ (DTI under 43%)
- ATR: Income and debts verified
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Session: lendctl-abc123
Iterations: 1 | Time: 4823msBuilt-in Calculators
All calculations run locally — no external CLI tools required.
| Calculator | Description |
|------------|-------------|
| finctl | Income analysis, DTI calculation |
| creditctl | Credit score analysis, risk tier, rescore simulation |
| mortctl | Mortgage qualification, LTV, PMI, amortization |
| autoloanctl | Auto loan calculations, GAP insurance recommendations |
| persctl | Personal loan eligibility, debt consolidation analysis |
| cardctl | Credit limit estimation, balance transfer analysis |
| compctl | QM/ATR validation, TRID timing, adverse action notices |
| auditctl | In-memory audit trail, compliance exports |
API Server
Start the server:
lendctl-ai serve --port 5055Query endpoint:
curl -X POST http://localhost:5055/api/v1/query \
-H "Content-Type: application/json" \
-d '{
"question": "Can I qualify for a 400k mortgage with 90k income?",
"model": "gpt-4o",
"stream": false
}'Response:
{
"sessionId": "lendctl-abc123",
"success": true,
"iterations": 1,
"totalDurationMs": 4823,
"plan": {
"understanding": "User wants to know if they qualify for a $400,000 mortgage...",
"steps": [...]
},
"results": [...],
"validation": {
"isValid": true,
"issues": []
},
"report": "**Summary**: ✅ You likely qualify..."
}Architecture
User Query → Planner (LLM) → Executor (Calculators) → Validator → Reporter
↓
┌──────────────────────┐
│ Built-in Tools │
│ finctl · creditctl │
│ mortctl · autoloanctl│
│ persctl · cardctl │
│ compctl · auditctl │
└──────────────────────┘Configuration
| Variable | Description | Default |
|----------|-------------|---------|
| OPENAI_API_KEY | OpenAI API key (required) | - |
| ANTHROPIC_API_KEY | Anthropic API key (optional) | - |
| PORT | API server port | 5055 |
Evaluation
Run the test suite:
lendctl-ai eval
# Run subset
lendctl-ai eval --sample 5Related
- LendCtl Skill — AI agent skill with 6 workflows
- finctl — Standalone income & DTI CLI
- creditctl — Standalone credit analysis CLI
- mortctl — Standalone mortgage underwriting CLI
License
Apache-2.0 © Satyan Avatara
Built with ❤️ by Avatara Consulting
