A comprehensive AI-powered appointment booking system built with FastAPI, featuring multi-database architecture, agentic RAG, and graph-based intelligence.
- Natural Language Processing: Book appointments using conversational language
- Function Calling: OpenAI/Anthropic LLM integration with intelligent function execution
- Multi-turn Conversations: Context-aware dialogue management
- Smart Recommendations: Graph-based personalized suggestions
- PostgreSQL: Transactional data (appointments, customers, services)
- Neo4j: Relationship graphs (preferences, recommendations, service dependencies)
- Vector Database: Knowledge embeddings (Pinecone/ChromaDB/Weaviate)
- Redis: Caching and background task queues
- Semantic Search: Vector-based knowledge retrieval
- Graph Intelligence: Relationship-aware information processing
- Context Enrichment: Dynamic knowledge integration
- Intelligent Agents: Autonomous information gathering and processing
- Webhook Support: Real-time message processing
- Interactive Keyboards: Quick actions and responses
- Conversation State Management: Persistent user sessions
- Rich Media Support: Text, buttons, and inline responses
- AWS: ECS Fargate + RDS + ElastiCache
- Google Cloud: Cloud Run + Cloud SQL + Memorystore
- Azure: Container Instances + Database + Redis Cache
- Kubernetes: Universal deployment across any cloud
git clone https://github.com/yourusername/appointment-manager.git
cd appointment-manager
aws configure
./deployment/aws/deploy.sh prodgit clone https://github.com/yourusername/appointment-manager.git
cd appointment-manager
gcloud auth login
./deployment/gcp/deploy.sh prod YOUR_PROJECT_IDgit clone https://github.com/yourusername/appointment-manager.git
cd appointment-manager
cp .env.example .env
# Edit .env with your API keys
docker-compose up -d┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Telegram │───▶│ FastAPI │───▶│ LLM Service │
│ Bot │ │ Backend │ │ (OpenAI) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ Intelligent │
│ Agent │
└──────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ PostgreSQL │ │ Neo4j │ │ Vector DB │
│ (Transact) │ │ (Graph) │ │ (RAG) │
└──────────────┘ └──────────────┘ └──────────────┘
- Telegram Bot Token (from @BotFather)
- OpenAI API Key or Anthropic API Key
- Cloud Provider Account (AWS/GCP/Azure)
- Neo4j AuraDB (recommended) or self-hosted Neo4j
- Vector Database (Pinecone recommended)
- Docker & Docker Compose
- Python 3.11+
- Cloud CLI (AWS CLI / gcloud / Azure CLI)
- kubectl (for Kubernetes deployments)
# Core Application
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
OPENAI_API_KEY=your_openai_api_key
BUSINESS_NAME="Your Business Name"
# Databases
POSTGRES_HOST=localhost
NEO4J_URI=bolt://localhost:7687
REDIS_HOST=localhost
# Vector Database
VECTOR_DB_PROVIDER=pinecone
PINECONE_API_KEY=your_pinecone_api_key
# See .env.example for complete configurationGET /health- System health checkGET /- API information
POST /api/v1/appointments- Book appointmentGET /api/v1/appointments/customer/{id}- Get customer appointmentsPOST /api/v1/appointments/availability- Check availability
POST /api/v1/knowledge/search- Search knowledge basePOST /api/v1/knowledge/documents/upload- Upload documents
GET /api/v1/graph/customers/{id}/recommendations- Get recommendationsPOST /api/v1/graph/customers/{id}/preferences- Update preferences
POST /webhook/{secret}- Telegram webhook endpoint
# Install dependencies
pip install -r requirements.txt
# Run tests
pytest app/tests/ -v
# Run with coverage
pytest app/tests/ --cov=app --cov-report=html# Health check
curl http://localhost:8000/health
# API documentation
open http://localhost:8000/docs./deployment/aws/deploy.sh prod./deployment/gcp/deploy.sh prod PROJECT_IDkubectl apply -f deployment/kubernetes/The included GitHub Actions workflow provides:
- Automated testing and linting
- Security scanning
- Multi-cloud deployment
- Environment-specific deployments
See Deployment Guide for detailed instructions.
- Application:
/health - Database:
/api/v1/graph/health - Knowledge Base:
/api/v1/knowledge/health
- Structured JSON logging
- Cloud-native log aggregation
- Request/response tracing
- Error tracking and alerting
- Response time monitoring
- Database performance tracking
- LLM usage analytics
- Business metrics (bookings, cancellations)
- API key management via cloud secret stores
- Telegram webhook verification
- Rate limiting and abuse prevention
- Encryption at rest and in transit
- Secure database connections
- Secret management best practices
- GDPR compliance considerations
- VPC/VNET isolation
- Security groups and firewall rules
- Private database access
- HTTPS/TLS everywhere
# Customize business rules in app/core/config.py
BUSINESS_TIMEZONE = "UTC"
DEFAULT_APPOINTMENT_DURATION = 60 # minutes
BOOKING_ADVANCE_DAYS = 30
CANCELLATION_HOURS = 24The system supports these intelligent functions:
check_availability()- Real-time slot checkingbook_appointment()- Smart appointment creationsearch_knowledge_base()- RAG-powered informationrecommend_services()- Graph-based suggestionsget_customer_preferences()- Personalization data
Upload business documents via API:
curl -X POST "/api/v1/knowledge/documents/upload" \
-F "files=@business-policies.pdf" \
-F "document_type=policy"- AWS: ECS service auto-scaling
- GCP: Cloud Run automatic scaling
- Kubernetes: Horizontal Pod Autoscaler (HPA)
- PostgreSQL: Read replicas and connection pooling
- Neo4j: Clustering and read replicas
- Redis: Clustering for high availability
- Vector database indexing
- Graph query optimization
- LLM response caching
- Database query optimization
# Clone repository
git clone https://github.com/yourusername/appointment-manager.git
cd appointment-manager
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env
# Edit .env with your configuration
# Start services
docker-compose up -d
# Run application
uvicorn app.main:app --reloadapp/
├── main.py # FastAPI application
├── core/ # Core configuration and database
├── services/ # Business logic services
├── api/ # API route handlers
├── models/ # Database and API schemas
└── utils/ # Utility functions
deployment/
├── aws/ # AWS deployment files
├── gcp/ # Google Cloud deployment
├── azure/ # Azure deployment
└── kubernetes/ # Kubernetes manifests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
- Quick Start Guide - Get running in 30 minutes
- Deployment Guide - Comprehensive deployment instructions
- CLAUDE.md - Development guidance for Claude Code
- API Documentation - Interactive API docs
- GitHub Issues: Bug reports and feature requests
- Discussions: Community support and questions
- Documentation: Comprehensive guides and examples
- Cloud deployment consulting
- Custom feature development
- Enterprise support contracts
- Training and workshops
| Cloud Provider | Development | Production | Enterprise |
|---|---|---|---|
| AWS | $50-100/month | $200-500/month | $500-1000+/month |
| Google Cloud | $30-80/month | $150-400/month | $400-800+/month |
| Azure | $40-90/month | $180-450/month | $450-900+/month |
Costs vary based on usage, region, and specific configuration
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI: Modern Python web framework
- Telegram Bot API: Messaging platform integration
- OpenAI/Anthropic: LLM providers
- Neo4j: Graph database technology
- Cloud Providers: AWS, GCP, Azure infrastructure
Choose your preferred deployment method:
# AWS (Recommended for Enterprise)
./deployment/aws/deploy.sh prod
# Google Cloud (Recommended for Startups)
./deployment/gcp/deploy.sh prod YOUR_PROJECT_ID
# Kubernetes (Multi-cloud)
kubectl apply -f deployment/kubernetes/Your intelligent appointment booking bot will be live in minutes! 🎯