A context-aware AI assistant that leverages geolocation data and local information to provide relevant answers to user queries.
GeoSearchQA enhances Large Language Models with geographic context awareness. It uses location data to tailor responses to users, making it ideal for travel recommendations, local business inquiries, and location-specific questions.
Key features:
- Location-aware responses using GPS or IP-based geolocation
- Integration with Llama models via Ollama
- Context building with local search results
- Docker-based deployment for easy setup
geo-mcp-llama/
├── app/
│ ├── api/ # API endpoints
│ │ └── routes.py # /api/v1/chat/completions
│ ├── context/ # Location + user context
│ │ ├── location.py # GPS/IP-based geolocation logic
│ │ └── favorites.py # User-defined favorite places
│ ├── core/ # Prompt building logic
│ │ └── prompt_builder.py # Constructs prompts with context
│ ├── model/ # Ollama client interface
│ │ └── ollama_client.py # Calls to Ollama API
│ ├── config.py # .env loader and app constants
│ └── main.py # FastAPI app launcher
├── .env # Environment variables
├── Dockerfile # App container
├── docker-compose.yml # Multi-container (API + Ollama)
├── Makefile # Build and run automation
└── requirements.txt # Python dependencies
Prequisites
- Docker & Docker Compose
git clone https://github.com/yourusername/geosearchqa.git
cd geosearchqa
cp .env.example .env # Then edit .env with your API keys
Use the included Makefile
for convenience:
make docker-build # Build the API and Ollama containers
make docker-run # Run both containers
Then pull the model inside the Ollama container:
docker exec -it geosearchqa-ollama-1 sh
ollama pull llama3:8b
exit
Or use another model, such as mistral:7b, by updating .env:
MODEL_NAME=mistral:7b
The main API endpoint is
POST /api/v1/chat/completions
curl -X POST http://localhost:8000/api/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "What are the best wine bars in Montmartre that serve orange wine and are open on Monday night?"}
],
"max_tokens": 150
}'
-
✅ Brave Search API integration with citation support (MCP-compliant)
-
✅ Voice command input and vocal response output
-
✅ Mobile interface + geolocated results on maps