This project is a full-stack AI Loan Sales Platform designed to streamline the loan application process using a conversational AI, document processing, and a robust backend. The platform leverages a multi-agent system to guide users, process their documents via OCR, and manage the loan application workflow.
- Conversational AI: A multi-agent system (MasterAgent, SalesAgent, UnderwritingAgent, etc.) guides users through the loan application process.
- Document Upload and OCR: Users can upload necessary documents, which are then processed using OCR for data extraction.
- User Authentication: Secure user login and registration.
- Loan Application Management: Track the status and details of loan applications.
- Modular Backend: Built with FastAPI, providing a clear separation of concerns.
- Modern Frontend: Developed with Next.js and React for a dynamic user experience.
The project follows a client-server architecture:
- Frontend: A Next.js application built with React, responsible for the user interface and interacting with the backend API.
- Backend: A FastAPI application developed in Python, handling business logic, database interactions, AI agent orchestration, and document processing. It uses PostgreSQL as its database.
- Database: PostgreSQL for storing application data.
- Containerization: The backend services are containerized using Docker and managed with Docker Compose.
Follow these steps to set up and run the project locally:
- Docker and Docker Compose
- Node.js and npm (for frontend)
- Python 3.9+ (for backend development, though Docker is preferred for running)
- Navigate to the
backenddirectory:cd loan-ai-app/backend - Create a
.envfile based on.env.exampleand fill in the necessary environment variables, especiallyANTHROPIC_API_KEY.cp .env.example .env
- Build and run the Docker containers:
This will start the FastAPI backend and the PostgreSQL database. The backend will be accessible at
docker-compose up --build
http://localhost:8000.
- Navigate to the
frontenddirectory:cd loan-ai-app/frontend - Install the dependencies:
npm install
- Start the development server:
The frontend application will be accessible at
npm run dev
http://localhost:3000.
- Access the frontend application in your browser at
http://localhost:3000. - Register a new user account or log in if you already have one.
- Follow the conversational AI prompts to start a loan application.
- Upload required documents when prompted. The system will use OCR to extract information.
- Monitor the status of your loan application through the dashboard.
ANTHROPIC_API_KEY: Your API key for the Anthropic AI service, crucial for the conversational agents.DATABASE_URL: Connection string for the PostgreSQL database (e.g.,postgresql://user:password@db:5432/dbname).- Other variables as specified in
.env.examplefor database credentials and application settings.
NEXT_PUBLIC_BACKEND_URL: The URL of your backend API (e.g.,http://localhost:8000).