FinAgentX is a remote banking system designed to revolutionize the loan application process. It specifically targets tier 2 and tier 3 cities in India, enabling users to apply for loans seamlessly through a web interface. The system leverages a powerful multi-agent AI architecture to automate data collection, underwriting, and decision-making, providing a streamlined and efficient experience for both customers and bank officials.
The project is divided into four main components, each handling a specific aspect of the application:
The core user interface for the banking portal. It provides the landing page and navigation to various services.
- Tech: HTML, CSS, JavaScript
- Key Files:
index.html: Main landing page for the bank.chat.html: Interface for chatting with the AI agent.status.html: Page for tracking loan application status.documents.html: Document upload and management interface.
A visual, interactive 3D avatar that acts as the customer service representative, enhancing user engagement.
- Tech: React, Vite, React Three Fiber (R3F), Socket.io-client
- Key Features:
- Real-time lip-sync and animation.
- Interactive 3D environment.
- Integration with the backend for dynamic responses.
The primary server handling real-time communication, API orchestration, and bridging the frontend with the AI logic.
- Tech: Node.js, Express, Socket.io
- Key Features:
- Handles WebSocket connections for the Avatar and Chat.
- Integrates with text-to-speech and speech-to-text services.
- Routes requests between the frontend and the AI agents.
- Dependencies:
google-generative-ai,groq-sdk,socket.io,express.
The intelligence layer powered by CrewAI, running autonomous agents for complex financial tasks.
- Tech: Python, Flask, CrewAI, LangChain
- Key Features:
- Underwriter Agent: Analyzes creditworthiness and risk.
- Verification Agent: Validates documents and user data.
- Loan Officer Agent: Makes final approval/rejection decisions.
- Dependencies:
crewai,flask,langchain_google_genai,python-dotenv.
To run FinAgentX locally, you need to set up and run all three server components (Node.js Backend, Python Backend, and Avatar Frontend).
- Node.js (v18 or higher)
- Python (v3.10 or higher)
- API Keys:
- Google Gemini API Key
- Groq API Key
- (Any other specific keys used in .env)
This service handles the AI agents.
- Navigate to the directory:
cd python_backend - Create a virtual environment (optional but recommended):
python -m venv venv # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Configure Environment Variables:
- Create a
.envfile inpython_backend/. - Add your keys:
GOOGLE_API_KEY=your_google_key
- Create a
- Start the server:
Runs on default Flask port (usually 5000).
python app.py
This service handles real-time socket communication.
- Navigate to the directory:
cd backend - Install dependencies:
npm install
- Configure Environment Variables:
- Create a
.envfile inbackend/if required by the code (checkserver.js).
- Create a
- Start the server:
Runs on port specified in server.js (e.g., 3000).
npm start
This serves the React application for the 3D Avatar.
- Navigate to the directory:
cd avatar - Install dependencies:
npm install
- Start the development server:
Runs on http://localhost:5173 (default Vite port).
npm run dev
- Open the Frontend files directly. You can typically just open
frontend/index.htmlin your browser. - For a better experience, use a live server extension (like VS Code Live Server) to serve the
frontenddirectory. - Ensure the frontend is configured to point to the correct backend URLs (check
script.jsor similar infrontendfor API endpoints).
- Landing Page: Open
index.html. Users are introduced to the banking platform. - Chat/Avatar: Navigate to the chat section. The 3D Avatar (served from port 5173) should load (likely via iframe or separate window).
- Interaction:
- User types or speaks to the agent.
- Node.js Backend receives the input -> forwards to Python Backend (CrewAI) or processes it directly.
- CrewAI Agents process the request (e.g., "I want a loan").
- Response is sent back to Node.js Backend -> Frontend/Avatar.
- Avatar speaks the response using lip-sync.
- Loan Application: The agents guide the user through document submission (
documents.html) and status checking (status.html).
The following flowchart illustrates the data flow and interaction between the system components:
graph TD
User((User))
subgraph Client [Frontend / Avatar]
UI[Web Interface]
Avatar3D[3D Avatar]
end
subgraph NodeServer [Node.js Backend]
SocketHandler[Socket.io Handler]
Master[Master Agent (LLM)]
Rules[Rule Engine]
Dispatcher[Dispatcher]
Sanction[Sanction Agent]
end
subgraph PythonServer [Python Backend]
FlaskAPI[Flask API :8000]
Crew[CrewAI Manager]
Sales[Sales Agent]
Verify[Verification Agent]
Underwrite[Underwriting Agent]
end
User <-->|Voice/Text| UI
UI <-->|WebSocket| SocketHandler
Avatar3D <-->|WebSocket| SocketHandler
SocketHandler -->|1. Text Input| Master
Master -->|2. Generate Plan| Rules
Rules -->|3. Validate Plan| Dispatcher
Dispatcher -->|Local Call| Sanction
Dispatcher -->|HTTP POST| FlaskAPI
FlaskAPI -->|Run Task| Crew
Crew --> Sales
Crew --> Verify
Crew --> Underwrite
Crew -->|Result| FlaskAPI
FlaskAPI -->|JSON Response| Dispatcher
Dispatcher -->|Synthesize Reply| SocketHandler
SocketHandler -->|Final Response/Audio| UI
Feel free to submit issues and enhancement requests.
[Your License Here]