An intelligent chat system for grant identification and evaluation, designed to help sales representatives and customers find and assess funding opportunities.
Develop an intelligent chat system that allows sales representatives and clients to:
- Identify available grants
- Evaluate eligibility for specific projects
- Determine the suitability of grants
- Maximize possible financing returns
- Interact naturally with queries about grants
The system consists of the following main components:
- Interactive chat interface
- Developed in React with Material Tailwind
- Responsive design
- Authentication system
- Markdown rendering for rich responses
- FastAPI containerized services
- Integration with Fandit grants API
- LangGraph state machine for conversation flow
- ETL system for data management
- Intermediate database for efficient filtering
- Bedrock: AI engine for natural language processing
- DynamoDB: High-speed database for chat history
- Aurora: MySQL database for grant information
- EC2: Instances for service deployment
-
Intelligent Chat Interface
- Natural language interaction
- Contextualized responses
- Automatic eligibility assessment
- Conversation history
-
Data Management
- Integration with Fandit API
- Intermediate database for efficient filtering
- Automatic information updates via ETL
- TTL-based expiration for conversation data
-
Grant Analysis
- Filtering by region, company type, and budget
- Detailed grant information
- Eligibility criteria matching
- Grant comparison
-
Session Management
- Concurrent user sessions
- Conversation persistence
- Automatic cleanup of inactive sessions
- Chat history retrieval
- User authentication
- Natural language interaction
- Advanced filtering system
- Intermediate database
- Query processing
- Conversation management
- High availability
- Optimized performance
- Responsive design
- Data security
- Scalability
- Frontend: React, Material Tailwind, Markdoc
- Backend: Python, FastAPI, LangGraph
- AI: AWS Bedrock
- Databases: Aurora MySQL, DynamoDB
- ETL: Custom Python pipeline
- Authentication: Context-based with JWT
- Containers: Docker
- Deployment: Docker Compose
- AWS Account
- Docker and Docker Compose
- Node.js and npm
- Python 3.9+
- Git
-
Clone the repository
git clone https://github.com/AI-School-F5-P3/ChatbotGrants.git cd ChatbotGrants -
Configure environment variables
# In backend directory cp .env.example .env # Edit .env with your credentials # In etl_fandit directory cp .env.example .env # Edit .env with your Fandit API credentials
-
Start the services
docker-compose up -d
ChatbotGrants/
βββ README.md # This documentation
βββ docker-compose.yml # Main Docker composition file
βββ requirements.txt # Root level dependencies
β
βββ backend/ # Backend Python code
β βββ aws_connect.py # AWS services connection module
β βββ Dockerfile # Backend container definition
β βββ dynamodb.py # DynamoDB integration for chat history
β βββ grants_bot.py # Core chatbot logic using LangGraph
β βββ main.py # FastAPI application with endpoints
β βββ requirements.txt # Backend dependencies
β βββ tools_aurora.py # Database operations for grants
β
βββ frontend/ # React application
β βββ Dockerfile # Frontend container definition
β βββ package.json # Frontend dependencies
β βββ public/ # Static assets
β β βββ img/ # Image assets
β βββ src/ # Source code
β βββ components/ # UI components
β βββ context/ # React contexts
β βββ pages/ # Application pages
β βββ services/ # API services
β βββ assets/ # Styles and images
β
βββ etl_fandit/ # ETL system for Fandit API
βββ clase_apifandit.py # Fandit API client
βββ db_setup.py # Database initialization
βββ etl_fandit.py # Main ETL process implementation
βββ Dockerfile # ETL container definition
βββ requirements.txt # ETL dependencies
βββ README.md # ETL documentation
βββ tests/ # ETL test directory
- Endpoint:
https://ayming.api.fandit.es/api/v2 - Update frequency: Daily
- Grant filters supported:
- is_open
- start_date
- end_date
- provinces
- communities
- action_items
- activities
- region_types
/start_session: Initialize a chat session/chat: Process messages/end_session/{user_id}: End a user session/save_chat: Save conversation to DynamoDB/get_chat_messages: Get messages for a conversation/get_user_conversations/{user_id}: List user conversations
-
User Input
- Natural language query
- Basic information collection
- Grant selection
-
Processing
- Query analysis
- Database search
- Eligibility evaluation
- LangGraph state transitions
-
Response
- Relevant grants
- Suitability analysis
- Recommendations
- Rich text formatting
- System logs
- Backend logs
- ETL process logs
- DynamoDB TTL enforcement
- API quota control
- Database backups
- Inactive session cleanup
- Frontend Development
- Backend Development
- DevOps
- Business Team
For support and inquiries:
- Create an issue in the repository
- Contact the development team
- Consult internal documentation
This is a public educational project.
