This simple RAG (Retrieval Augmented Generation) golang based example using google gemini. The application allows you to add documents and query them using natural language, powered by Gemini's language model.
- Go 1.23 or later
- Docker and Docker Compose
- Google Cloud Project with Gemini API access
-
Get a Google Gemini API key from Google AI Studio
-
set the api key as an environment variable
export GEMINI_API_KEY=your_api_key_here
- Start the Weaviate vector database:
docker-compose up -d
- Build run the application
make run
The server provides the following endpoints:
curl -X POST http://localhost:8000/add/ \
-H "Content-Type: application/json" \
-d '{"documents": [{"text": "Your document text here"}]}'
curl -X POST http://localhost:8000/query/ \
-H "Content-Type: application/json" \
-d '{"content": "Your question here"}'