A production-grade, highly scalable, and intelligent AI Mentor platform built using FastAPI, Gemini Pro (Google GenAI), ChromaDB, and LangGraph. This project implements a strict modular architecture where the backend, frontend, asynchronous background workers, and the AI reasoning engine are completely decoupled.
The Codweb Lab AI Mentor Agent is designed to act as a 24/7 autonomous technical guide for students and IT professionals. Instead of just answering generic questions, it uses advanced RAG (Retrieval-Augmented Generation) and multi-agent reasoning to provide deep, context-aware mentorship.
Key Capabilities:
- 🧠 Technical Upskilling & Mentorship: Provides structured guidance, code reviews, and conceptual clarity for complex domains like Python, Data Analytics, Machine Learning, and Web Development.
- 📚 Context-Aware Document Reading (RAG): Users can upload technical PDFs, research papers, or documentation. The agent ingests this data into ChromaDB and answers highly specific queries based only on the provided context.
- 🛠️ Autonomous Debugging: Utilizing LangGraph, the agent doesn't just guess answers. It can autonomously execute tools, search for the latest documentation, and self-correct its logic before giving a final solution.
- 📈 Career & Learning Path Mapping: Helps professionals navigating career breaks or transitioning into new tech roles by generating step-by-step, customized learning roadmaps.
- ⚡ Lightning Fast Responses: By leveraging Redis caching and background Celery workers, it delivers sub-second responses for repeated architectural queries without hitting the LLM again.
- Backend: FastAPI, Python 3.11+
- Database: PostgreSQL (with Asyncpg driver), SQLAlchemy, Alembic
- AI & LLM: Google Gemini Pro (
gemini-1.5-pro), Langchain - Vector Store (RAG): ChromaDB
- Caching & Message Broker: Redis
- Background Jobs: Celery
- Agentic Workflows: LangGraph
- Frontend: Streamlit
- Infrastructure: Docker, Docker Compose, GitHub Actions (CI/CD)
This project is meticulously structured into 9 logical phases to ensure smooth, error-free development and to avoid early over-engineering:
- Objective: Establish the repository baseline and virtual environment.
- Details: Initialize
venv, install required packages viarequirements.txt(FastAPI, Langchain, Celery, etc.), and configure a robust.gitignoreto prevent sensitive or junk files from entering version control.
- Objective: Secure the backend foundation.
- Details: Establish a non-blocking asynchronous connection to PostgreSQL using
asyncpg. Create imperative SQLAlchemy ORM models (Users,Chats), manage structural migrations with Alembic, and secure all endpoints using asymmetric JWT tokens.
- Objective: Maintain code quality and automate regression testing.
- Details: Write atomic API tests using
pytestand configure GitHub Actions (ci.yml) to automatically trigger validation checks upon every code push.
- Objective: Inject document intelligence and semantic retrieval capabilities.
- Details: Integrate Google Gemini Pro as the core LLM. Build a Retrieval-Augmented Generation (RAG) engine by chunking uploaded PDFs and storing dense vector embeddings in ChromaDB.
- Objective: Offload heavy CPU tasks and accelerate query responses.
- Details: Introduce Celery to run PDF text extraction and embedding generation asynchronously. Deploy Redis to serve as both the Celery message broker and a high-speed caching layer for repetitive queries.
- Objective: Evolve the AI from a simple chatbot into an autonomous reasoning mentor.
- Details: Utilize LangGraph to build multi-step self-correcting memory loops, empowering the model to analyze context, decide on external tool execution pathways (e.g., web search), and synthesize comprehensive mentoring plans.
- Objective: Encapsulate the architecture for absolute environment parity.
- Details: Write a multi-stage
Dockerfileanddocker-compose.ymlto orchestrate the FastAPI service, PostgreSQL database, Redis cache, and Celery workers into a unified, isolated network.
- Objective: Construct a highly responsive chat dashboard.
- Details: Build a dynamic reactive chat interface in pure Python using Streamlit, avoiding frontend boilerplate while seamlessly communicating with the FastAPI backend via HTTP requests.
- Objective: Launch the platform globally.
- Details: Configure immutable cloud environments (e.g., AWS, Render), provision secure secret vaults for
.envvariables, and deploy the fully containerized production stack.
Follow these instructions to run the project locally on your machine:
1. Clone the repository:
git clone [https://github.com/your-username/ai-mentor-agent.git](https://github.com/your-username/ai-mentor-agent.git)2. Navigate to the project directory:
cd ai-mentor-agent
This project is open-sourced under the GNU AGPLv3 License.
You are free to use, modify, and distribute this software, provided that any derivative works or network services running this code are also open-sourced under the same AGPLv3 license.
🏢 Commercial Dual-Licensing: If your organization wishes to use AI Mentor Agent in a closed-source, proprietary, or commercial environment without the AGPLv3 obligations, a commercial license must be acquired. Please contact Codweb Lab for enterprise licensing and white-label deployments.