AI-Native Travel Platform powered by Microservices, Spring AI, Event-Driven Architecture, and Cloud-Native Technologies.
Build smarter trips.
Find compatible travel companions.
Interact with an intelligent AI assistant that understands context, plans before responding, and remembers user preferences.
SafarSaathi is a production-grade distributed travel platform designed to demonstrate modern backend engineering practices by combining:
- π€ Artificial Intelligence
- βοΈ Cloud-Native Microservices
- π‘ Event-Driven Architecture
- π Secure Authentication
- π§ Long-Term AI Memory
- π Production-Ready System Design
Unlike traditional travel applications, SafarSaathi includes an AI-native orchestration service capable of:
- Understanding conversation context
- Planning before responding
- Executing multiple backend tools
- Merging platform data
- Remembering long-term user preferences
- Delivering personalized travel assistance
The project focuses on solving real engineering challenges such as distributed system design, AI orchestration, scalability, observability, and cloud deployment instead of simple CRUD operations.
- AI Chat Assistant
- Context-Aware Conversations
- Conversation History
- Entity Resolution
- Rule-Based Planning Engine
- LLM Planning Engine
- Multi-Tool Execution
- Prompt Enrichment Pipeline
- Long-Term Memory
- Intelligent Memory Extraction
- Personalized AI Responses
- User Management
- Trip Management
- Companion Discovery
- Companion Requests
- Companion Matching
- Real-Time Notifications
- API Gateway
- Service Discovery
- JWT Authentication
- Event-Driven Communication
- Kafka Messaging
- Cloud-Native Architecture
- Production-Ready Package Structure
Client
β
βΌ
βββββββββββββββββββββββ
β API Gateway β
β (8081) β
βββββββββββ¬ββββββββββββ
β
ββββββββββββββββ¬βββββββββββββββββΌβββββββββββββββββ¬ββββββββββββββββ
β β β β β
βΌ βΌ βΌ βΌ βΌ
Auth Service User Service Trip Service Companion Service AI Service
(9000) (9030) (9040) (9050) (9060)
β β β β β
ββββββββββββββββ΄βββββββββββββββββ΄βββββββββββββββββ΄ββββββββββββββββ
β
βΌ
Notification Service
β
βΌ
Kafka
β
βΌ
PostgreSQL
- API Gateway
- Eureka Discovery Server
- Auth Service
- User Service
- Trip Service
- Companion Service
- Notification Service
- AI Service
The AI Service is designed as an orchestration layer rather than a simple chatbot.
Instead of directly sending user messages to the LLM, SafarSaathi first understands the conversation, plans the required actions, executes backend tools, enriches the prompt with platform data, and finally generates a grounded response.
User
β
βΌ
Conversation Context
β
βΌ
Entity Resolution
β
βΌ
Rule-Based Planner
β
βΌ
LLM Planner
β
βΌ
Execution Plan
β
βΌ
Tool Execution
β
βΌ
Context Merger
β
βΌ
Prompt Enrichment
β
βΌ
Gemini
β
βΌ
AI Response
β
βΌ
Memory Engine
β
βΌ
Long-Term Memory
- Context Awareness
- Conversation State
- Entity Resolution
- Rule-Based Planning
- LLM Planning
- Tool Calling
- Prompt Enrichment
- Long-Term Memory
- Intelligent Memory Extraction
- Personalized Responses
SafarSaathi follows a distributed microservices architecture where every service has a single responsibility and communicates securely through the API Gateway.
| Service | Description | Status |
|---|---|---|
| API Gateway | Centralized routing, JWT validation, request filtering | |
| Eureka Server | Service registration & discovery | |
| Auth Service | Authentication & JWT management | |
| User Service | User profiles & preferences | |
| Trip Service | Trip planning & management | |
| Companion Service | Companion discovery & matching | |
| Notification Service | Kafka-based notification processing | |
| AI Service | AI orchestration, planning & memory |
- Java 21
- Spring Boot 3.3
- Spring Security
- Spring Data JPA
- Spring Cloud Gateway
- Spring Cloud Netflix Eureka
- Spring AI
- Google Gemini
- Spring AI
- LLM Planning
- Rule-Based Planning
- Tool Calling
- Context Awareness
- Long-Term Memory
- Apache Kafka
- PostgreSQL
- MySQL
- Docker
- Docker Compose
- Kubernetes
- Helm
- GitHub Actions
- AWS (Planned)
- Maven
- Git
- GitHub
SafarSaathi
β
βββ api-gateway/
β
βββ discovery-server/
β
βββ auth-service/
β
βββ user-service/
β
βββ trip-service/
β
βββ companion-service/
β
βββ notification-service/
β
βββ ai-service/
β
βββ docker/
β
βββ kubernetes/
β
βββ docs/
β
βββ README.md
The API Gateway acts as the single entry point for all incoming requests.
- JWT Authentication
- Request Routing
- Authentication Filter
- Route Management
- Centralized Entry Point
- Spring Cloud Gateway
Responsible for dynamic service registration and discovery.
- Service Registration
- Service Discovery
- Dynamic Instance Resolution
- Spring Cloud Netflix Eureka
Handles authentication and authorization across the platform.
- User Registration
- Login
- JWT Generation
- JWT Validation
- Role-Based Authorization
- Secure Authentication Flow
- Spring Security
- JWT
- PostgreSQL
Responsible for managing user profiles and preferences.
- User Profile Management
- Profile Updates
- Travel Preferences
- User Lookup
GET /users/profile
GET /users/profile/{id}
PUT /users/profileManages travel plans created by users.
- Create Trips
- Update Trips
- Delete Trips
- Trip Details
- Trip Timeline
- Destination Management
- Budget Information
POST /api/v1/trips
GET /api/v1/trips
GET /api/v1/trips/{id}
PUT /api/v1/trips/{id}
DELETE /api/v1/trips/{id}Responsible for connecting compatible travelers.
- Companion Profile
- Companion Preferences
- Send Requests
- Accept Requests
- Reject Requests
- Companion Recommendations
POST /api/v1/companions
GET /api/v1/companions
PUT /api/v1/companions/{id}
DELETE /api/v1/companions/{id}POST /api/v1/companions/requests
POST /api/v1/companions/requests/{id}/accept
POST /api/v1/companions/requests/{id}/reject
GET /api/v1/companions/requests/received
GET /api/v1/companions/requests/sentConsumes Kafka events and delivers notifications to users.
- Kafka Consumer
- Notification Persistence
- Read Notifications
- Unread Notifications
- Mark as Read
GET /api/v1/notifications
GET /api/v1/notifications/unread
PUT /api/v1/notifications/{id}/readThe AI Service is the intelligence layer of SafarSaathi.
Unlike traditional chatbot integrations, the AI Service follows an orchestration-first architecture where every user request is analyzed, planned, enriched with platform data, and then forwarded to the LLM.
The AI is capable of understanding conversation context, reasoning over platform data, and remembering long-term user preferences to provide personalized travel assistance.
- Conversational AI powered by Google Gemini
- Multi-turn conversations
- Conversation persistence
- Context-aware responses
- Conversation History
- Conversation Context
- Conversation State
- Conversation Persistence
- Follow-up Question Handling
The AI automatically understands the current conversation before generating a response.
Context includes:
- Previous Messages
- Active Conversation
- Current User
- Resolved Entities
- User Memories
The AI identifies important entities from user conversations such as:
- Trips
- Destinations
- Companion References
- User References
These entities are reused across future conversation turns.
Before calling the LLM, SafarSaathi first creates an execution plan.
Instead of directly asking Gemini,
the AI first decides:
- Which backend tools should execute
- What information is required
- How responses should be merged
This dramatically reduces hallucinations and improves response quality.
The platform also includes an LLM-powered planning layer capable of generating execution plans dynamically.
This architecture allows future support for:
- Dynamic Planning
- AI Travel Concierge
- Multi-Agent Systems
- Retrieval-Augmented Generation (RAG)
without redesigning the system.
Current tools include:
- User Tool
- Trip Tool
- Companion Tool
Each tool retrieves platform data before the final prompt is generated.
Before the LLM is called,
the prompt is enriched using:
- Conversation History
- Conversation State
- Platform Data
- Resolved Entities
- User Memories
The LLM therefore receives significantly richer context than a normal chatbot.
SafarSaathi includes persistent AI memory.
The AI automatically remembers meaningful user preferences such as:
- Travel Style
- Food Preferences
- Transportation Preferences
- Language Preferences
- Destination Preferences
These memories are reused in future conversations to deliver personalized travel recommendations.
The Memory Engine automatically:
- Extracts user preferences
- Validates extracted memories
- Stores long-term memories
- Updates existing memories
- Makes future AI responses personalized
No manual profile updates are required.
Every AI request follows a structured orchestration pipeline.
User Request
β
βΌ
Conversation Context Resolver
β
βΌ
Conversation State
β
βΌ
Entity Resolution
β
βΌ
AI Planner
β
βΌ
Execution Plan
β
βΌ
Tool Execution
β
βΌ
Context Merger
β
βΌ
Prompt Enrichment
β
βΌ
Google Gemini
β
βΌ
AI Response
β
βΌ
Memory Engine
β
βΌ
Persistent Memories
SafarSaathi follows an event-driven architecture using Apache Kafka.
Instead of tightly coupling services,
important business events are published to Kafka topics and consumed asynchronously.
- Companion Request Received
- Companion Request Accepted
- Companion Request Rejected
Companion Service
β
βΌ
Publish Event
β
βΌ
Kafka Topic
β
βΌ
Notification Service
β
βΌ
Persist Notification
β
βΌ
Expose Notification APIs
- Loose Coupling
- Better Scalability
- Asynchronous Processing
- Fault Isolation
- Improved System Reliability
Authentication is centralized using JWT Authentication.
User Login
β
βΌ
Auth Service
β
βΌ
Generate JWT
β
βΌ
API Gateway
β
βΌ
Authentication Filter
β
βΌ
Forward Request
β
βΌ
Microservices
- JWT Authentication
- Role-Based Authorization
- API Gateway Authentication Filter
- User Context Propagation
- Secure Service Communication
- API Gateway
- Eureka Discovery Server
- JWT Authentication
- Auth Service
- User Service
- Trip Service
- Companion Service
- Notification Service
- AI Chat
- Conversation Management
- Context Awareness
- Entity Resolution
- Rule-Based Planner
- LLM Planner
- Tool Calling Framework
- Context Merger
- Prompt Enrichment
- Long-Term Memory
- Intelligent Memory Extraction
- Microservices
- Event-Driven Communication
- Kafka Integration
- Docker
- Kubernetes
- AWS Deployment
- Monitoring
- CI/CD
- AI Service v2