Quick Start

Three examples to get you going — from fully automatic to fully manual.

Minimal — AI handles everything
POST /api/search { "query": "tel aviv this week" }
With timezone + LLM re-ranking
POST /api/search { "query": "paris tonight", "timezone": "America/New_York", "rerank": true }
Fully manual — no AI, fastest
POST /api/search { "query": "earthquake", "expand": false, "extractMeta": false, "strategy": "embed_time", "timePreset": "last_30d", "topK": 50 }

Metadata Extraction

POST /api/extract Claude extracts structured metadata
Uses Claude to extract strategy, time preset, location (with timezone), and media type from a natural language query.
Request Body
ParameterTypeDescription
query requiredstringNatural language query
timezonestringIANA timezone for context
Example response
{ "strategy": "embed_time_coord", "timePreset": "yesterday", "type": null, "location": { "country": "Palestine", "city": "Gaza", "lat": 31.5, "lng": 34.47, "radiusKm": 50, "timezone": "Asia/Gaza" } }
200 OK 400 Missing query
POST /api/expand Claude enriches queries with keywords
Adds 5–15 contextually relevant keywords to improve vector search recall. Original words kept at the start.
Request Body
ParameterTypeDescription
query requiredstringQuery to expand
Example response
{ "expanded": "tel aviv this week Israel protests IDF military Mediterranean" }
200 OK 400 Missing query

Embedding & Query

POST /api/embed Generate 768-dim text embedding
Generates a 768-dimensional vector using Google Gemini gemini-embedding-001.
Request Body
ParameterTypeDescription
text requiredstringText to embed
200 OK 400 Missing text
POST /api/query Raw Pinecone vector query
Queries the Pinecone vector index directly with a vector and optional metadata filter.
Request Body
ParameterTypeDescription
vector requirednumber[]768-dim embedding
host requiredstringPinecone host (from /api/resolve-host)
topKintegerMax results (default 100)
filterobjectPinecone metadata filter
200 OK 400 Missing vector/host
GET /api/resolve-host Get Pinecone index host URL
Returns the Pinecone index host URL. Required for /api/query.
Response
{ "host": "corpus-v1-abc1234.svc.us-east1-gcp.pinecone.io" }
200 OK

Geocoding

GET /api/geocode?q={place} Place name → coordinates
Looks up coordinates for a place name via OpenCage. Returns up to 5 results.
Query Parameters
ParameterTypeDescription
q requiredstringPlace name to geocode
Example
GET /api/geocode?q=Tel%20Aviv
200 OK 400 Missing q

Performance

StepDurationNotes
AI extraction1–2sClaude call. Parallel with expansion.
AI expansion1–2sClaude call. Parallel with extraction.
Embedding200–400msGemini API
Pinecone query300–800msDepends on topK and filter
Firestore fetch300–600msOnly if rerank=true
LLM rerank2–5sOnly if rerank=true

Total without rerank: ~2–4s. With rerank: ~5–9s. Set expand: false and extractMeta: false for ~1s latency.

Priority Order

When multiple sources provide the same parameter:

Parameters
Manual (request body) AI extraction Default
Time resolution
startMs/endMs timePreset (manual) timePreset (AI) "all"
Timezone
AI-detected location tz timezone (request) "UTC"
Error Handling
StatusCause
400Missing required parameter
405Wrong HTTP method
500Internal error (Pinecone, Claude, Gemini, or Firestore)

AI steps fail gracefully — a failed extraction uses defaults, a failed expansion embeds the raw query, a failed rerank returns null. The search still returns results.

Memories API

Persistent memory endpoints for storing and retrieving contextual information across sessions. These endpoints are planned and not yet available.

Planned User Memories

Store and retrieve per-user memory context — preferences, past queries, behavioral patterns. Enables personalized search results and AI responses that improve over time.

POST /api/memories/user · GET /api/memories/user/:id

Planned City Memories

Aggregate knowledge about specific cities — trending topics, recurring events, notable locations, local context. Powers location-aware search enrichment and city-specific AI behavior.

POST /api/memories/city · GET /api/memories/city/:name

Planned Location Memories

Fine-grained coordinate-based memories — what has happened at specific GPS coordinates over time. Enables hyper-local search context and spatial pattern recognition.

POST /api/memories/location · GET /api/memories/location?lat=&lng=&radius=

Planned Event Memories

Temporal event tracking — significant events detected across the corpus with time, location, and topic clustering. Supports event-aware search and timeline queries.

POST /api/memories/event · GET /api/memories/events?from=&to=