AI/ML

ChatMap

Multi-agent geospatial AI system

Personal

6 technologies
3 key decisions
4 results

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

Next.js + MapboxRouter AgentGeocoding AgentSemantic AgentMap Render AgentQdrantOllama (local LLM)

Key Technical Decisions

Key Technical Decisions

Assembly Instructions — 3 Steps
01

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.

02

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.

03

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

LangChainNext.jsOllamaQdrantPythonMapbox

Links