Skip to content

kram2006/Internship_mini_projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

InternshipProjects - Travel Assistant & Safety Guardrails

Complete collection of 7 internship projects (D1-D7) focused on:

  • πŸ—ΊοΈ Travel Assistant APIs using Google Gemini
  • πŸ”— RAG (Retrieval Augmented Generation) systems
  • 🧠 Memory-enhanced conversational AI
  • πŸ›‘οΈ Safety Guardrails & PII Detection

πŸ“ Project Structure

InternshipProjects/
β”œβ”€β”€ D1/ - Travel Assistant (Basic Gemini API)
β”œβ”€β”€ D2/ - Travel Assistant (Prompt Engineering)
β”œβ”€β”€ D3/ - Travel Assistant (LangGraph State Management)
β”œβ”€β”€ D4/ - Travel RAG Assistant (Qdrant Vector DB)
β”œβ”€β”€ D5/ - Memory-Enhanced Travel Assistant (Mem0 + Redis)
β”œβ”€β”€ D6/ - Advanced Travel RAG (Caching + Monitoring)
β”œβ”€β”€ D7/ - Safety Guardrails (PII Detection + Toxic Content)
β”œβ”€β”€ TREE.md - Complete file structure
β”œβ”€β”€ API_SAFETY_GUIDE.md - Important safety information
└── .gitignore - Git configuration (sensitive files excluded)

πŸ”’ IMPORTANT: API SAFETY

This repository has been cleaned for GitHub upload with MAXIMUM safety:

βœ… Deleted:

  • ❌ All .env configuration files (API keys)
  • ❌ All __pycache__/ Python cache
  • ❌ All *.pyc compiled files
  • ❌ All *.zip submission files
  • ❌ All .cache/ directories
  • ❌ All output.txt logs

βœ… Preserved:

  • βœ… All source code (.py files)
  • βœ… All Jupyter notebooks (.ipynb)
  • βœ… Documentation (README.md in each project)
  • βœ… Dependency lists (requirements.txt)
  • βœ… Project structure

πŸ” NO API KEYS are stored in this repository.


πŸš€ Quick Start (Development Only)

1. Clone Repository

git clone https://github.com/YOUR_USERNAME/InternshipProjects.git
cd InternshipProjects

2. Choose a Project

cd D1/travel-assistant  # or any D2-D7

3. Create Environment File

cp .env.example .env  # If it exists
# Edit .env and add your API keys

4. Install Dependencies

pip install -r requirements.txt

5. Enable API (Optional - For Local Development)

Edit main.py and change:

API_DISABLED = True  # Change to False

6. Run Application

# For FastAPI projects
python main.py

# For Jupyter notebooks
jupyter notebook D*_assignment.ipynb

πŸ“š Project Details

D1: Travel Assistant - Basic

  • Goal: Learn Google Gemini API with FastAPI
  • Key Concepts: LLM prompting, rate limiting
  • Models: Gemini 2.5 Flash (FREE)
  • Cost: $0 (within free tier)

D2: Travel Assistant - Prompt Engineering

  • Goal: Master prompt templates and engineering
  • Key Concepts: PromptTemplate, chain prompting
  • Models: Gemini 2.5 Flash
  • Cost: $0 (within free tier)

D3: Travel Assistant - LangGraph

  • Goal: Implement state machines for agent workflows
  • Key Concepts: State graphs, agent routing
  • Models: Gemini 2.5 Flash
  • Cost: $0 (within free tier)

D4: Travel RAG - Vector Database

  • Goal: Build retrieval-augmented generation system
  • Key Concepts: Embeddings, Qdrant, vector search
  • Services: Gemini + Qdrant (open-source)
  • Cost: $0 (open-source Qdrant)

D5: Memory-Enhanced Travel Assistant

  • Goal: Add persistent memory to conversations
  • Key Concepts: Mem0 service, Redis caching, user sessions
  • Services: Gemini + Mem0 + Redis
  • Cost: ⚠️ Mem0 may have costs

D6: Advanced Travel RAG

  • Goal: Production-grade RAG with monitoring
  • Key Concepts: Hybrid search, caching, metrics, tracing
  • Services: Embeddings + Qdrant + Redis + Prometheus + Langfuse
  • Cost: ⚠️ Langfuse may have costs

D7: Safety Guardrails

  • Goal: Implement multi-layer safety filters
  • Key Concepts: PII detection, toxicity filtering, prompt injection
  • Services: Presidio + Guardrails Hub + Gemini
  • Cost: $0 (all components free/open-source)

πŸ› οΈ Technology Stack

Core LLM

  • Google Gemini 2.5 Flash - FREE tier, fast inference

Frameworks

  • FastAPI - Web API framework
  • LangChain - LLM integration
  • LangGraph - Agent state management
  • Guardrails Hub - Safety validation

Data & Storage

  • Qdrant - Vector database (open-source)
  • Redis - Caching and sessions
  • Mem0 - Persistent memory service

Monitoring

  • Prometheus - Metrics collection
  • Langfuse - LLM trace monitoring

Security

  • Presidio - PII detection (Microsoft)
  • Pydantic - Data validation

πŸ“‹ Requirements

Each project has its own requirements.txt:

Common:

  • Python 3.8+
  • FastAPI
  • Pydantic
  • LangChain
  • Google-Generativeai

Optional (for advanced projects):

  • Qdrant-client
  • Redis
  • Mem0
  • Prometheus-client
  • Langfuse

πŸ” API Keys Needed (For Running)

⚠️ CRITICAL: Never commit API keys to Git!

# Create .env file (DO NOT COMMIT)
GOOGLE_API_KEY=your_key_here
MEM0_API_KEY=your_key_here  # Only for D5
QDRANT_API_KEY=your_key_here  # Only for D4, D6

Get Free API Keys:


πŸ“– Documentation

  • API_SAFETY_GUIDE.md - ⭐ Read this first!
  • TREE.md - Complete file structure
  • Each D/README.md* - Project-specific documentation
  • Jupyter notebooks - Code examples with explanations

πŸ§ͺ Testing Without APIs

Run code without making actual API calls:

# Test imports
python -c "import langchain, fastapi; print('βœ… OK')"

# Check project structure
python -c "import os; print([d for d in os.listdir('.') if d.startswith('D')])"

# View notebook structure
jupyter nbconvert --to script D1/travel-assistant/D1-assignment.ipynb --stdout | head -50

βš™οΈ Configuration

Environment Variables Template

Create .env file in project root:

# API Keys
GOOGLE_API_KEY=sk-...
MEM0_API_KEY=...
QDRANT_API_KEY=...

# Server
API_PORT=8001
API_HOST=0.0.0.0

# Database
REDIS_HOST=localhost
REDIS_PORT=6379
QDRANT_URL=http://localhost:6333

# Monitoring (Optional)
LANGFUSE_API_KEY=...
PROMETHEUS_PORT=8000

# Safety (Optional)
PRESIDIO_API_KEY=...

πŸ”„ Development Workflow

  1. Explore: Read Jupyter notebooks first
  2. Understand: Review README.md in each project
  3. Setup: Create .env with API keys
  4. Run: Execute main.py or start API
  5. Test: Use provided test_api.py files
  6. Learn: Check comments in source code

πŸ› Troubleshooting

ImportError: No module named 'langchain'

pip install -r requirements.txt

GOOGLE_API_KEY not configured

# Create .env file with real API key
echo "GOOGLE_API_KEY=your_key_here" > .env

Port already in use

# Change API_PORT in .env
API_PORT=8002

Rate limit errors

  • Wait a few minutes (free tier has 10 req/min limit)
  • Use delays between API calls

πŸ“œ License

This is an educational internship project repository.


✨ Features Demonstrated

βœ… LLM API Integration (Google Gemini) βœ… FastAPI Web Framework βœ… Prompt Engineering & Templates βœ… State Machine Workflows (LangGraph) βœ… Vector Database Integration (Qdrant) βœ… Caching Strategies (Redis, Semantic Cache) βœ… Memory Services (Mem0) βœ… Safety & Guardrails (Presidio, Toxic Detection) βœ… Monitoring & Metrics (Prometheus, Langfuse) βœ… PII Detection & Masking βœ… Rate Limiting & Error Handling βœ… Jupyter Notebook Documentation


πŸ“ž Support

For issues or questions:

  1. Check the README in specific project folder
  2. Review API_SAFETY_GUIDE.md
  3. Check API documentation for each service
  4. Refer to Jupyter notebooks for examples

Status: βœ… Ready for GitHub Upload
Date: January 28, 2026
Safety Level: 🟒 MAXIMUM (APIs disabled by default)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors