Skip to content

blockvoltcr7/mem0-ai-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Mem01 AI Applications - OpenAI + Mem0 + Qdrant

A collection of advanced AI applications demonstrating persistent memory capabilities using OpenAI GPT models, Mem0 memory framework, and Qdrant vector database. These applications showcase how to build intelligent, memory-powered AI systems that remember user interactions across sessions.

πŸš€ YouTube Tutorial Demo

Youtube Tutorial Demo

πŸš€ Featured Applications

🧬 Health Coach AI - Peptide Therapy Assistant

Location: gradio-peptides-app/

A specialized AI health coach focused on peptide therapy education and guidance, featuring:

  • Memory-Powered Conversations: Remembers health profiles and chat history using Mem0 + Qdrant
  • Optional Health Profiles: Start chatting immediately or complete profile for personalized advice
  • Persistent Storage: Health data saved across sessions - no need to refill forms
  • 3 Demo Users: John (beginner), Jane (experienced), Jarvis (gut health focus)
  • Safety-First: Emphasizes medical supervision and evidence-based information

Tech Stack: Gradio + OpenAI GPT-4o-mini + Mem0 + Qdrant + Pydantic V2

πŸ“– View Full Documentation

πŸ₯ AI Prompt Engineering Tutor for Healthcare

Location: gradio-ai-tutor/

An educational AI tutor that teaches healthcare professionals effective prompt engineering for medical AI applications:

  • Progressive Learning: Builds on previous conversations and learning progress
  • Healthcare Domain Focus: Specialized in health AI prompt engineering best practices
  • User Isolation: Complete separation of learning sessions between users
  • Simple Interface: Clean, reliable Gradio UI for easy learning

Tech Stack: Gradio + OpenAI GPT-4o-mini + Mem0 + Qdrant + Pydantic

πŸ“– View Full Documentation

πŸ› οΈ Core Technologies

🧠 Memory Architecture

  • Mem0: Advanced memory management framework for AI applications
  • Qdrant: High-performance vector database for semantic search and memory storage
  • OpenAI GPT-4o-mini: Fast, intelligent language model for conversations
  • Persistent Memory: User interactions and profiles saved across sessions

πŸ”§ Development Stack

  • Frontend: Gradio for rapid web UI development
  • Data Validation: Pydantic V2 for robust data modeling
  • Package Management: UV for fast Python dependency management
  • Testing: Pytest with Allure reporting

πŸ“¦ Quick Start

Prerequisites

  • Python 3.8+
  • OpenAI API key
  • Qdrant vector database (local or cloud)

1. Environment Setup

# Clone the repository
git clone <repository-url>
cd mem01-ai-tutor

# Create virtual environment
uv venv
source .venv/bin/activate  # On Unix/macOS
# .venv\Scripts\activate     # On Windows

# Install dependencies  
uv pip install -r requirements.txt

2. Environment Configuration

Create a .env file in the project root:

# Required
OPENAI_API_KEY=your_openai_api_key_here

# Optional (defaults provided)
QDRANT_URL=http://localhost:6333
QDRANT_USE_HTTPS=false

3. Database Setup

Option A: Local Qdrant (Development)

# Using Docker (recommended)
docker run -p 6333:6333 qdrant/qdrant

# Using pip
pip install qdrant-client

Option B: Qdrant Cloud (Production)

  1. Sign up for Qdrant Cloud
  2. Create a cluster and get your URL
  3. Update .env with your cloud URL and set QDRANT_USE_HTTPS=true

4. Launch Applications

Health Coach AI (Peptide Therapy):

cd gradio-peptides-app
./run.sh
# Access: http://localhost:7861

AI Prompt Engineering Tutor:

cd gradio-ai-tutor
./run.sh
# Access: http://localhost:7860

πŸ—οΈ Project Structure

mem01-ai-tutor/
β”œβ”€β”€ πŸ“ gradio-peptides-app/          # Health Coach AI for peptide therapy
β”‚   β”œβ”€β”€ app.py                       # Main Gradio application (31KB)
β”‚   β”œβ”€β”€ README.md                    # Detailed documentation
β”‚   β”œβ”€β”€ run.sh                       # Launch script
β”‚   └── test_gradio_peptides.py      # Application tests
β”œβ”€β”€ πŸ“ gradio-ai-tutor/              # AI Prompt Engineering Tutor
β”‚   β”œβ”€β”€ app.py                       # Main Gradio application (15KB)
β”‚   β”œβ”€β”€ README.md                    # Detailed documentation
β”‚   └── run.sh                       # Launch script
β”œβ”€β”€ πŸ“ tests/                        # Comprehensive test suite
β”œβ”€β”€ πŸ“ docs/                         # Project documentation
β”œβ”€β”€ πŸ“ scripts/                      # Utility scripts
β”œβ”€β”€ πŸ”§ requirements.txt              # Python dependencies
β”œβ”€β”€ πŸ”§ requirements.in               # Dependency definitions
β”œβ”€β”€ πŸ”§ .env.example                  # Environment template
└── πŸ“š README.md                     # This file

🎯 Key Features Demonstrated

Memory Management

  • Persistent Conversations: Chat history saved across sessions
  • User Isolation: Complete data separation between users
  • Context-Aware Responses: AI remembers previous interactions
  • Profile Storage: User data persisted in vector database

Advanced AI Capabilities

  • Domain Specialization: Applications focused on specific use cases
  • Safety-First Design: Responsible AI with appropriate disclaimers
  • Adaptive Responses: Different advice based on user profiles/progress
  • Evidence-Based: Grounded in factual information

Production-Ready Architecture

  • Scalable Database: Qdrant vector storage for large-scale deployment
  • Modern UI: Gradio for rapid, responsive web interfaces
  • Robust Validation: Pydantic models for data integrity
  • Comprehensive Testing: Full test coverage with detailed reporting

πŸ§ͺ Testing & Development

Running Tests

# Run all tests with Allure reporting
pytest --alluredir=allure-results -v

# Generate and serve test report
allure serve allure-results

Application-Specific Tests

# Test Health Coach AI
pytest gradio-peptides-app/test_gradio_peptides.py -v

# Test AI Tutor (manual)
python gradio-ai-tutor/app.py

Memory Isolation Testing

Each application includes comprehensive tests to verify:

  • User data separation
  • Memory persistence across sessions
  • Proper conversation history management
  • Profile storage and retrieval

πŸš€ Deployment Options

Local Development

Both applications include run scripts for immediate local deployment:

./run.sh  # In each application directory

Cloud Deployment

The repository includes configurations for:

  • Railway: railway.json, Dockerfile.railway
  • Render: render.yaml, deployment scripts
  • Docker: Multi-stage Dockerfiles for production

πŸ” Use Cases & Applications

Healthcare AI Development

  • Prompt Engineering Training: Learn effective healthcare AI prompting
  • Patient Education: Specialized health coaching applications
  • Medical AI Safety: Best practices for responsible health AI

Memory-Powered AI Systems

  • Persistent Conversations: Building AI that remembers users
  • Profile Management: Storing and retrieving user preferences
  • Context-Aware Responses: Intelligent, personalized interactions

Gradio Application Development

  • Rapid Prototyping: Fast UI development for AI applications
  • User Authentication: Simple user identification systems
  • Data Validation: Robust input handling with Pydantic

⚠️ Important Notes

Medical Disclaimer

The Health Coach AI application is for educational purposes only. Peptides like BPC-157 are not FDA-approved for human use. Always consult qualified healthcare professionals before starting any therapy.

API Usage

These applications use OpenAI's API which incurs costs. Monitor your usage and set appropriate limits.

Data Privacy

  • User conversations are stored in your Qdrant database
  • No data is shared between users
  • Consider data retention policies for production use

🀝 Contributing

Contributions are welcome! Areas of interest:

  • Additional AI application examples
  • Enhanced memory management patterns
  • New deployment configurations
  • Improved testing coverage
  • Documentation improvements

Development Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Commit your changes (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

πŸ“š Additional Resources

Documentation

Related Projects

πŸ“„ License

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


πŸš€ Ready to build memory-powered AI applications? Start with either the Health Coach AI or AI Tutor, and explore how Mem0 + Qdrant create intelligent, persistent AI experiences!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages