AI-powered travel assistant API with conversational interface
Travel Assist is a personal assistant service that provides an API for conversations with an AI assistant specialized for travel. Originally developed as part of a technical challenge for a Software Engineer position, this project showcases modern AI integration patterns and RESTful API design.
Travel Assist offers a ChatGPT-like conversational interface through a RESTful API. The application manages multi-turn conversations with an AI assistant, storing conversation history and providing intelligent responses powered by OpenAI's language models.
- Conversational AI: Start new conversations, send messages, and retrieve conversation history
- Real-time Weather Information: Get current weather conditions and forecasts for any location
- Date and Time Queries: Ask about current date, time, and time zones
- Barcelona Holiday Information: Access information about holidays in Barcelona
- General AI Assistance: Leverage OpenAI's powerful language models for general queries
- Persistent Storage: All conversations are stored in MongoDB for retrieval
- HTTP-based API: Simple JSON-based API built with Twirp and Protocol Buffers
- Go
- OpenAI API
- MongoDB
- Twirp/Protobuf
To get a local copy up and running follow these simple steps.
- Go (v1.24 or later recommended)
- Docker (to run MongoDB container)
- Git and Make
- OpenAI API key (get one here)
- Go to the main page for this project: https://github.com/lu-jim/travel-assist
- Click the green Code button
- Copy the repository URL
- Open your terminal and change to your desired directory
git clone https://github.com/lu-jim/travel-assist.git
cd travel-assist
go mod download# Start MongoDB container
make up
# Set your OpenAI API key
export OPENAI_API_KEY=your_openai_api_key
# Run the server
make runThe server will start at localhost:8080.
To stop the application:
- Press
Ctrl+Cto stop the server - Run
make downto stop the MongoDB container
The application provides a simple HTTP-based API. You can interact with it using:
- HTTP Client: Use curl, Postman, or any HTTP client with the Postman collection
- CLI Tool: Use the included CLI tool for easy interaction
POST /twirp/rpc.ChatService/StartConversation- Start a new conversationPOST /twirp/rpc.ChatService/SendMessage- Send a message to an existing conversationPOST /twirp/rpc.ChatService/GetConversation- Retrieve a conversation by IDPOST /twirp/rpc.ChatService/ListConversations- List all conversations
The codebase includes comprehensive tests for the server and assistant functionality.
# Make sure MongoDB is running
make up
# Run all tests
go test ./...👤 Luis Fernando Jimenez
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
Special thanks to Acai Travel for the original project structure and technical challenge guidelines that formed the foundation of this application.