Skip to content

AI-powered conversational agents built with Python FastAPI and Google Gemini AI

Notifications You must be signed in to change notification settings

Amdev-5/ai-conversational-agents

Repository files navigation

AI Conversational Agents Portfolio

A collection of two production-ready AI-powered conversational agents built with Python FastAPI and Google Gemini AI. These projects demonstrate full-stack development, AI integration, and modern web technologies.

AI Agents Python FastAPI JavaScript

Projects

1. Company Research Assistant

An AI agent that researches companies and generates comprehensive account plans.

Features:

  • AI-powered company research using Google Gemini
  • 8-section account plan generation
  • Interactive chat for follow-up questions
  • Real-time progress tracking
  • Voice and chat modes

Use Cases:

  • Sales teams researching prospects
  • Business development planning
  • Market intelligence gathering
  • Competitive analysis

View Project →


2. Interview Practice Partner

An AI agent that conducts mock interviews and provides detailed feedback.

Features:

  • 6 different interview roles (Software Engineer, Sales, Product Manager, Data Scientist, Retail, Marketing)
  • Dynamic, adaptive questioning
  • Comprehensive performance feedback
  • Interview transcripts
  • Voice and chat modes

Use Cases:

  • Interview preparation
  • Professional development
  • Skills assessment
  • Communication practice

View Project →


Tech Stack

Backend

  • Python 3.8+ - Programming language
  • FastAPI - Modern async web framework
  • Google Gemini AI - AI language model (gemini-2.0-flash-lite-001)
  • Uvicorn - ASGI server
  • Pydantic - Data validation
  • python-dotenv - Environment management

Frontend

  • HTML5/CSS3 - Structure and styling
  • Vanilla JavaScript - No frameworks, pure JS
  • Web Speech API - Voice recognition and synthesis
  • Fetch API - HTTP communication

Architecture Pattern

  • Three-Layer Architecture: Frontend → Backend API → AI Service
  • RESTful API Design
  • Session-based State Management
  • Async/Await Patterns

Quick Start

Prerequisites

  • Python 3.8 or higher
  • Google Gemini API key (Get free key)
  • Modern web browser (Chrome/Edge for full voice support)

Setup Both Projects

# Clone the repository
git clone https://github.com/yourusername/ai-conversational-agents.git
cd ai-conversational-agents

# Setup Company Research Assistant
cd company-research-assistant/backend
pip install -r requirements.txt
echo "GOOGLE_API_KEY=your_key_here" > .env
python serve_frontend.py &

# Setup Interview Practice Partner
cd ../../interview-practice-partner/backend
pip install -r requirements.txt
echo "GOOGLE_API_KEY=your_key_here" > .env
python serve_frontend.py &

# Access the applications
# Company Research: http://localhost:8000
# Interview Practice: http://localhost:8001

Project Structure

ai-conversational-agents/
├── company-research-assistant/
│   ├── backend/
│   │   ├── main.py                  # FastAPI application
│   │   ├── serve_frontend.py        # Server with static files
│   │   ├── requirements.txt         # Dependencies
│   │   └── .env                     # API key (not in repo)
│   ├── frontend/
│   │   ├── templates/
│   │   │   └── index.html          # UI
│   │   └── static/
│   │       └── app.js              # JavaScript
│   ├── .gitignore
│   └── README.md
│
├── interview-practice-partner/
│   ├── backend/
│   │   ├── main.py                  # FastAPI application
│   │   ├── serve_frontend.py        # Server with static files
│   │   ├── requirements.txt         # Dependencies
│   │   └── .env                     # API key (not in repo)
│   ├── frontend/
│   │   ├── templates/
│   │   │   └── index.html          # UI
│   │   └── static/
│   │       └── app.js              # JavaScript
│   ├── .gitignore
│   └── README.md
│
├── HOW_AGENTS_WORK.md              # Technical documentation
└── README.md                       # This file

Key Features

Both Projects Include:

Dual Mode Support

  • Chat Mode: Text-based conversation
  • Voice Mode: Speech-to-text and text-to-speech

Modern UI

  • Responsive design
  • Clean, professional interface
  • Real-time updates
  • Visual feedback

AI Integration

  • Google Gemini 2.0 Flash Lite
  • Context-aware conversations
  • Intelligent response generation
  • Natural language understanding

Production-Ready

  • Error handling
  • Input validation
  • Session management
  • API documentation
  • Browser compatibility

Technical Highlights

Backend Architecture

  • Async Endpoints: Non-blocking I/O for better performance
  • Type Safety: Pydantic models for request/response validation
  • Auto Documentation: OpenAPI/Swagger docs at /docs
  • CORS Enabled: Cross-origin resource sharing configured
  • Session Management: In-memory storage for demo purposes

Frontend Architecture

  • Vanilla JavaScript: No framework dependencies
  • Event-Driven: Responsive UI updates
  • Web APIs: Native browser features for voice
  • Modular Code: Clear separation of concerns
  • Progressive Enhancement: Works without voice in all browsers

AI Integration

  • Prompt Engineering: Carefully crafted prompts for quality responses
  • Context Management: Conversation history maintained
  • Error Handling: Graceful degradation on API issues
  • Rate Limiting: Prevents API abuse

API Documentation

Both projects include interactive API documentation:

Company Research Assistant:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Interview Practice Partner:

  • Swagger UI: http://localhost:8001/docs
  • ReDoc: http://localhost:8001/redoc

Browser Compatibility

Full Support (Chat + Voice):

  • ✅ Google Chrome (Recommended)
  • ✅ Microsoft Edge
  • ✅ Opera

Chat Only:

  • ⚠️ Safari (Voice features limited)
  • ⚠️ Firefox (Voice requires manual config)

Environment Variables

Each project requires a .env file in its backend/ directory:

GOOGLE_API_KEY=your_google_gemini_api_key_here

Get your free API key at Google AI Studio.

Documentation

Development

Running in Development Mode

# Company Research Assistant
cd company-research-assistant/backend
uvicorn main:app --reload --port 8000

# Interview Practice Partner
cd interview-practice-partner/backend
uvicorn main:app --reload --port 8001

Testing

Both projects can be tested through:

  1. Interactive UI (open HTML files)
  2. API documentation (/docs endpoints)
  3. Direct API calls (curl, Postman, etc.)

Skills Demonstrated

This portfolio showcases:

  • Full-Stack Development: Frontend, backend, and AI integration
  • Modern Python: Async programming, type hints, FastAPI
  • JavaScript: ES6+, async/await, Web APIs
  • AI Integration: Prompt engineering, context management
  • API Design: RESTful principles, documentation
  • UX Design: Responsive interfaces, error handling
  • Voice Technology: Web Speech API implementation
  • Best Practices: Code organization, security, performance

Use Cases

Company Research Assistant

  • Sales prospecting
  • Business development
  • Market research
  • Competitive intelligence
  • Account planning

Interview Practice Partner

  • Job interview preparation
  • Communication skills practice
  • Performance feedback
  • Professional development
  • Skills assessment

License

MIT License - Free to use for learning and portfolio purposes.

Acknowledgments


Ready to explore? Check out the individual project READMEs for detailed setup and usage instructions!

About

AI-powered conversational agents built with Python FastAPI and Google Gemini AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published