Skip to content

About

AI agents, trained by the minds that move the world.

Topics

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 MentorAgents

Your personal mentors, anytime. Anywhere.

A Production-ready RAG, LLM and LLMOps system

MentorAgents is an AI-powered platform where users interact with agents modeled after legendary real-world expertsβ€”like Naval Ravikant and Warren Buffett.
Ask questions, get tailored guidance, and learn from the best minds β€” anytime, anywhere.

MentorAgents Architecture

License: MIT Python FastAPI MongoDB


πŸ“‹ Table of Contents


✨ Key Features

  • 🎯 Legendary Mentor AI Agents: Chat with AI versions of famous investors and thought leaders
  • 🧠 Intelligent Memory System: Both short-term and long-term memory capabilities using MongoDB
  • πŸ“š RAG-Powered Knowledge: Vector database containing comprehensive mentor profiles and wisdom
  • ⚑ Real-time Conversations: Fast and responsive chat interface powered by FastAPI
  • 🎨 Personalized Insights: Get tailored advice based on your specific questions and context
  • πŸ“Š Evaluation & Monitoring: Built-in evaluation system with LLMOps observability

πŸ›  Tech Stack

Backend

Technology Purpose
FastAPI High-performance Python web framework
LangGraph Advanced AI agent orchestration with memory management
LangChain LLM integration and RAG implementation
MongoDB Persistent storage for memory and state management
Vector Database Semantic search for mentor knowledge retrieval
Groq Fast LLM inference
Sentence Transformers Text embeddings for RAG
OPIK LLM Ops and evaluation
Knowledge base Wikipedia, PDF, Youtube, Twitter

Frontend (Coming Soon)

  • React - Modern frontend framework
  • Interactive UI - Gamified chat experience

πŸ— Architecture Components

  1. πŸ€– AI Agent Layer: LangGraph manages intelligent conversations with mentor personalities
  2. 🧠 Memory Management:
    • Short-term memory for conversation context
    • Long-term memory for user preferences and history
  3. πŸ“– Knowledge Retrieval: RAG system pulls relevant mentor insights from vector database
  4. πŸ”Œ API Layer: FastAPI provides high-performance backend services
  5. πŸ’Ύ Data Persistence: MongoDB stores conversation history and agent states

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • 🐍 Python 3.11+
  • πŸ“¦ Node.js 16+ (for future frontend)
  • πŸƒ MongoDB instance
  • πŸ”‘ Groq API key

πŸ”§ Backend Setup

  1. πŸ“₯ Clone the repository

    git clone https://github.com/shubhamprajapati7748/mentoragents.git
    cd mentoragents/backend
  2. πŸ“¦ Install dependencies

    # Using uv (recommended)
    uv install
    
    # Or using pip
    pip install -e .
  3. βš™οΈ Environment Configuration

    cp .env.example .env
    # Edit .env with your API keys and configuration
  4. 🧠 Initialize Long-term Memory

    # Save mentors to MongoDB
    python src/mentoragents/tools/save_mentors_into_mongodb.py
    
    # Create long-term memory
    python src/mentoragents/tools/create_long_term_memory.py
  5. πŸš€ Run the backend

    uvicorn mentoragents.main:app --reload --host 127.0.0.1 --port 8080
    • 🌐 API: http://127.0.0.1:8080
    • πŸ“– API Docs: http://127.0.0.1:8080/docs

πŸ§ͺ Optional: Evaluation & Testing

# Generate evaluation dataset
python src/mentoragents/tools/generate_evaluation_data.py

# Evaluate agent performance
python src/mentoragents/tools/evaluate_langraph_agent.py

# Clean up (if needed)
python src/mentoragents/tools/delete_long_term_memory.py

πŸ€– Mentor Profiles

Our growing library of legendary mentors includes:

Mentor Expertise Specialization
Naval Ravikant Entrepreneurship Philosophy, Angel Investing
Warren Buffett Investing Value Investing, Business Analysis
Ray Dalio Finance Macro Investing, Economic Cycles
Charlie Munger Investing Mental Models, Rational Thinking
Benjamin Graham Finance Value Investing, Financial Analysis
And many more... Various Expanding mentor library

πŸ’¬ How It Works

graph TD
    A[User Question] --> B[Choose Mentor]
    B --> C[AI Agent Processing]
    C --> D[Memory Retrieval]
    D --> E[RAG Knowledge Search]
    E --> F[Generate Response]
    F --> G[Update Memory]
    G --> H[Personalized Advice]
Loading
  1. 🎯 Choose Your Mentor: Select from available mentor personalities
  2. ❓ Ask Your Question: Type your question or describe your challenge
  3. πŸ€– Get Personalized Advice: The AI agent retrieves relevant knowledge and provides mentor-style guidance
  4. πŸ’¬ Continue the Conversation: Build on previous discussions with persistent memory

🧠 Memory System

Memory System

Memory Types

  • πŸ”„ Short-term Memory: Maintains conversation context within sessions
  • πŸ’Ύ Long-term Memory: Remembers user preferences, past topics, and learning progress
  • πŸ“š Knowledge Base: Continuously updated mentor profiles and experiences

πŸ”§ Configuration

Key configuration options in backend/src/mentoragents/core/config.py:

# RAG Settings
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
CHUNK_SIZE = 1000
RETRIEVAL_LIMIT = 5

# Database Settings
MONGODB_COLLECTION = "mentors"

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Getting Started

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add amazing feature')
  4. πŸš€ Push to the branch (git push origin feature/amazing-feature)
  5. πŸ”„ Open a Pull Request

Areas for Contribution

  • πŸ€– New mentor personalities
  • πŸ“š Knowledge base expansion
  • 🎨 Frontend development
  • πŸ§ͺ Testing and evaluation
  • πŸ“– Documentation improvements

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • 🦜 LangChain and LangGraph communities for AI agent frameworks
  • 🧠 The mentors whose wisdom inspired this project
  • πŸ’» Open source contributors making AI accessible
  • 🌟 The amazing Python and AI/ML community

πŸ“§ Contact & Support

Questions? Ideas? Let's connect!

πŸ“§ Email: shubhamprajapati7748@gmail.com

πŸ™ GitHub: shubhamprajapati7748


Ready to learn from the best? Start your mentorship journey today! πŸš€

About

AI agents, trained by the minds that move the world.

Topics

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages