How montanogilberto/loanagents_smartloans works
SmartLoans is an AI service exposed through FastAPI, with loan negotiation as its documented primary workflow: a borrower or lender messages the assistant, the service uses backend REST data to ground a reply, and the reply returns to the chat. The repository also contains POS support, ticket extraction, identity/evidence validation, and other lending agents. The README documents the negotiation boundary; source-index references reveal additional module dependencies, but unsampled endpoint wiring is not assumed here.
Main entry points: main.py FastAPI service · orchestrator/agent.py Loan orchestrator · pos_clients_support/agent.py POS client support · backend_api.py Backend REST client
Components 30
API and configuration
- FastAPI service
main.py - Environment settings
config/settings.py
Lending agents
- Loan orchestrator
agents/orchestrator/agent.py - Risk assessment
agents/risk/agent.py - Loan recommendation
agents/recommendation/agent.py - Borrower perspective
agents/borrower/agent.py - Lender perspective
agents/lender/agent.py - Negotiation reply
agents/negotiation/agent.py - Contract preparation
agents/contract/agent.py - Account and legal support
agents/support/agent.py
POS assistance
- POS client support
agents/pos_clients_support/agent.py - POS income support
agents/pos_income_support/agent.py - POS expense support
agents/pos_expenses_support/agent.py - POS accounting support
agents/pos_accounting_support/agent.py - POS rewards support
agents/pos_rewards_support/agent.py
Retrieval and actions
- Graph retrieval
retrieval/graph.py - Hybrid retrieval
retrieval/hybrid.py - Keyword search
retrieval/keyword_search.py - Semantic search
retrieval/semantic_search.py - Action contracts
retrieval/contracts.py - Pending actions
tools/pending_actions.py
Business workflows
- Identity and evidence checks
agents/id_document/agent.py - Face validation
agents/face_validation/agent.py - Transfer evidence validation
agents/evidence_validation/agent.py - Ticket extraction
agents/ticket_extraction/proposal.py - Supplier and product matching
agents/ticket_extraction/matching.py - Ticket reconciliation
agents/ticket_extraction/reconcile.py - Backend REST client
tools/backend_api.py
Other components
- Borrower or lender
- SmartLoans backend API
Connections 24
- Borrower or lender → FastAPI service: sends message
README.md - FastAPI service → Loan orchestrator: runs pipeline
- Loan orchestrator → Risk assessment: runs first
agents/orchestrator/agent.py - Loan orchestrator → Loan recommendation: runs next
agents/orchestrator/agent.py - Loan orchestrator → Borrower perspective: runs next
agents/orchestrator/agent.py - Loan orchestrator → Lender perspective: runs next
agents/orchestrator/agent.py - Loan orchestrator → Negotiation reply: synthesizes reply
agents/orchestrator/agent.py - FastAPI service → Backend REST client: uses REST client
main.py - Backend REST client → SmartLoans backend API: calls REST API
README.md - FastAPI service → Contract preparation: accepted conversation
main.py - FastAPI service → Account and legal support: routes support
main.py - FastAPI service → POS client support: routes POS support
main.py - POS client support → Graph retrieval: uses retrieval
agents/pos_clients_support/agent.py - POS client support → Hybrid retrieval: uses retrieval
agents/pos_clients_support/agent.py - POS client support → Backend REST client: uses backend tools
agents/pos_clients_support/agent.py - POS client support → Pending actions: proposes actions
agents/pos_clients_support/agent.py - Semantic search → Keyword search: fetches documents
retrieval/semantic_search.py - Keyword search → SmartLoans backend API: fetches OpenAPI
retrieval/keyword_search.py - Pending actions → Action contracts: uses contracts
tools/pending_actions.py - Ticket extraction → Supplier and product matching: matches records
agents/ticket_extraction/proposal.py - FastAPI service → Identity and evidence checks: handles validation
- FastAPI service → Face validation: handles validation
- FastAPI service → Transfer evidence validation: handles validation
- FastAPI service → Ticket extraction: handles extraction
main.py