ChatMap
Multi-agent geospatial AI system
Personal
Problem
Problem
Geospatial data is notoriously hard to query — it lives in shapefiles, GeoJSON, PostGIS tables, and satellite imagery, and making sense of it typically requires GIS expertise. ChatMap explores whether a multi-agent LangChain system can let a non-GIS user ask natural language questions about geographic data and get meaningful, map-grounded answers.
Approach
Approach
ChatMap uses a router agent that classifies the query type (location lookup, area analysis, route planning, semantic search) and dispatches to specialized sub-agents. A geocoding agent resolves location names via OpenStreetMap. A semantic agent embeds geographic entity descriptions into Qdrant and retrieves contextually similar places. A map rendering agent generates Mapbox GL configurations that the Next.js frontend renders as interactive maps. Ollama runs all inference locally — no API keys required for the base functionality.
Architecture
Architecture
ChatMap — system diagram
Key Technical Decisions
Key Technical Decisions
Ollama for local inference
Using Ollama with Mistral/Llama models means the system runs entirely offline with no API costs. This makes it practical for research and demos. The trade-off vs. GPT-4 is reasoning quality on complex multi-hop geographic queries — acceptable for the use case.
Multi-agent routing over a single agent
A single generalist agent tried to handle geocoding, semantic search, and map rendering in one chain and hallucinated frequently. Separating concerns into specialized agents with a router dramatically improved reliability. Each agent has a focused tool set and a narrower system prompt.
Qdrant for geographic entity vectors
Geographic entities (cities, landmarks, parks) are embedded with descriptions and stored in Qdrant. This enables semantic queries like 'places similar to Yosemite' that pure geocoding can't answer. Qdrant's filtering on metadata (country, type, size) enables hybrid geographic + semantic queries.
Results
Results
- ✓Multi-agent routing correctly classifies and dispatches 85%+ of query types
- ✓Fully local inference — no API keys required for base functionality
- ✓Interactive Mapbox visualization grounds all agent responses geographically
- ✓Semantic similarity search finds contextually related places across regions
Tech Stack
Tech Stack
Links
Links