Skip to content
kvmtestPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

20 Commits

Folders and files

Repository files navigation

🌍 TopoVibe β€” the cultural-intelligence globe & MCP oracle

Fly a 3D globe, click any city, and see what it actually loves β€” every venue scored 0–100 by the Grounding Score, Qloo's taste graph underneath, an MCP server on top so any AI agent can query cultural ground truth.

Remove Qloo and TopoVibe is an empty basemap β€” cultural intelligence is not a feature, it is the product. TopoVibe runs as a CesiumJS globe for humans and a first-class MCP server for agents, answering the hackathon's brief literally: an agentic tool that only works because it knows what people love.

Built for the Qloo Agentic Hackathon Β· MIT License Β· Development brief

🌐 Live demo: topovibe.onrender.com · MCP: https://topovibe.onrender.com/mcp (see mcp.json) · Verified end-to-end with scripts/verify-deploy.mjs (7/7)

TopoVibe globe on Esri World Imagery

Austin Cultural DNA panel β€” signature tags, demographics, top places

Grounding Score markers + record-store heatmap over Austin (restored from a share link)


Why TopoVibe

AI agents are culturally blind: they recommend fluent, generic, popularity-ranked "agentic slop." Review sites measure popularity; LLMs hallucinate taste. TopoVibe grounds every answer in Qloo's taste graph (250M+ entities, billions of anonymized signals) β€” the LLM/agent never invents taste, it calls Qloo and narrates verified results. On top of raw answers, TopoVibe computes the Grounding Score (GS), a 0–100 proof-of-human authenticity index, rendered FLIR-style: loved analog venues glow hot red, viral tourist traps glow cold blue.

The Grounding Score

GS(venue) = 100 Γ— clamp(0.6Β·A + 0.4Β·T βˆ’ 0.3Β·N)
Component Meaning How computed (documented Qloo data only)
A β€” Affinity How strongly Qloo's graph associates this venue with the cohort Rank-normalized position in the /v2/insights result set (top β‰ˆ 1.0), blended with the venue's popularity field
T β€” Analog density Proof-of-human texture venue tag-URNs ∩ analog lexicon / lexicon size. The lexicon (8 keywords: vinyl, independent bookshop, ceramics, craft, quiet, heritage, record store, third place) is resolved to real tag URNs via /v2/tags at server startup
N β€” Viral noise Tourist-trap penalty /v2/trending acceleration β€” but /v2/trending does not support urn:entity:place (verified live against the hackathon API), so for venues N = 0 and n.unknown = true (pre-agreed kill-switch, shown in the UI, never hidden)

GS is withheld (gs: null, confidence: insufficient-data) when affinity results are empty or the lexicon failed to resolve. It is never interpolated. Every panel shows the three component bars β€” the score shows its work.

Features

The 7-hour MVP cut:

  • CesiumJS 3D globe on keyless Esri World Imagery, bundled demo cities (Austin Β· New York City Β· Tokyo), no geocoder dependency
  • Cultural DNA panel β€” click a city β†’ signature tags, demographics (age + gender affinity deltas), top 10 places
  • Cultural heatmap β€” one tag draped over one city as affinity-colored points (blue β†’ red), toggleable
  • Grounding Score markers β€” red/amber/blue/grey venue markers; click β†’ A/T/N breakdown panel
  • TopoVibe MCP server β€” 5 tools for AI agents over streamable HTTP
  • Share links β€” camera + city + tag round-trip through the URL hash
  • Honest data everywhere β€” coverage badges (live | cached | insufficient-data) on every panel, and the raw Qloo query echo behind every taste claim

Post-submission additions (from user feedback):

  • Any-city search β€” type any city; Qloo resolves the locality itself (no geocoder) and the globe flies there
  • Any-tag heatmaps β€” drape any keyword (resolved to a real tag URN via /v2/tags), not just the 3 presets
  • Venue detail β€” real photos, descriptions and websites from Qloo entity records in the breakdown panel
  • Clickable heat cells β€” every cell reports its affinity + popularity
  • Zoom +/- controls, DNA tag chips remain clickable shortcuts to heat + GS layers

Architecture

AGENTS (MCP)                         HUMANS (browser)
Claude/Cursor Β· agent loops          TopoVibe globe (static, Vite + CesiumJS)
        β”‚ HTTP + JSON-RPC (streamable)        β”‚ REST/JSON
β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            TopoVibe SERVER (Node.js, Express)             β”‚
β”‚  server/qloo.js       broker: X-Api-Key server-side only, β”‚
β”‚                       GET-only, 6h TTL cache, validity    β”‚
β”‚  server/validity.js   param ↔ filter.type matrix          β”‚
β”‚  server/grounding.js  Grounding Score engine (A/T/N)      β”‚
β”‚  server/routes.js     /api/dna Β· /api/heatmap Β·           β”‚
β”‚                       /api/grounding Β· /api/resolve Β·     β”‚
β”‚                       /api/health                         β”‚
β”‚  server/mcp.js        MCP endpoint: 5 tools               β”‚
β”‚  server/cache.js      TTL cache + demo pre-cache loader   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚ GET, query string, X-Api-Key
β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Qloo API β€” https://hackathon.api.qloo.com          β”‚
β”‚       /search Β· /v2/tags Β· /v2/insights Β· /v2/trending   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick start

git clone <repo-url> && cd topovibe
npm install                      # Windows sandbox note: use --ignore-scripts if esbuild's postinstall is blocked
cp .env.example .env             # paste your Qloo hackathon key into QLOO_API_KEY
npm run selfcheck                # MUST be green before anything else
npm run dev                      # globe at http://localhost:4173 (API proxied)

Click Austin β†’ DNA panel. Click a preset (🍝 🎸 β˜•) β†’ heatmap + GS venue markers. Click a marker β†’ the score shows its work.

Demo mode (never touches the network)

npm run precache                 # burn quota once: 3 cities Γ— 3 presets β†’ cache/precache.json (git-ignored)
npm run dev                      # demo flows now serve with coverage=cached

Production

npm run build                    # Vite build β†’ dist/
npm start                        # Express serves dist/ + API + MCP on PORT (4173)

TopoVibe MCP β€” the agentic surface

5 tools, streamable HTTP, per-IP rate limit (30/min). Every response embeds the raw Qloo query echo for auditability; errors are named and actionable.

Tool Args Returns
resolve_entities query, types? [{name, entity_id, subtype, popularity}]
resolve_tags keyword [{tag_id, name, subtype}]
get_insights filterType, signals{}, filters{}, take?, page? ranked entities (validity-checked against the Qloo matrix)
get_taste_profile locationQuery signature tags + demographics + top places
get_grounding_score city, tag or city, entityIds[] [{entity, gs, components, confidence}]

Wire any MCP client with mcp.json:

{ "mcpServers": { "topovibe": { "type": "streamable-http", "url": "http://localhost:4173/mcp" } } }

Inspect interactively: npx @modelcontextprotocol/inspector β†’ connect β†’ http://localhost:4173/mcp.

REST API (the only endpoints β€” no others exist)

Endpoint Wraps Used by
GET /api/health self-check boot banner
GET /api/resolve?q=&types= /search entity pickers
GET /api/dna?city= urn:tag + urn:demographics + urn:entity:place DNA panel
GET /api/heatmap?city=&tag= urn:heatmap heat layer
GET /api/grounding?city=&tag= insights + tags + GS engine GS markers

Qloo rules this codebase enforces (and verifies)

  1. Base URL is QLOO_BASE_URL, default https://hackathon.api.qloo.com β€” startup self-check fails loudly otherwise.
  2. Auth is X-Api-Key header β€” never Bearer, never query param. The key lives only in .env (git-ignored) and is read from the environment at runtime.
  3. /v2/insights is GET with query-string params only.
  4. filter.type values are full URNs; PLACE-style shorthand is rejected with a named error.
  5. IDs are resolved before signaling (/search, /v2/tags) β€” never invented.
  6. Location modes: signal.location.query, signal.location, filter.location.query, filter.location.radius.
  7. The validity matrix (server/validity.js) strips + logs invalid params client-side β€” the API ignores them silently, we refuse to.
  8. Legacy /recs and /recommendations throw QlooForbiddenEndpoint without a network call.

Verified-against-live-API notes (things the docs don't tell you)

  • /v2/tags requires filter.query (a bare ?query= 400s with a helpful error listing valid filters).
  • /v2/trending filter.type accepts only actor, artist, brand, movie, person, podcast, tv_show β€” not urn:entity:place (hence n.unknown for venues).
  • filter.location.query hard-filters places to a locality; signal.location.query alone can drift out-of-town (an Austin record-store query leaks San Antonio venues).
  • Demographics coverage is sparse: niche tags return empty; the DNA panel falls back through top tags β†’ top places and says insufficient-data honestly when all fail.
  • The indie-music keyword tag yields no place heat grid; demo presets use place-genre tags (verified dense in all three demo cities).

Honest-data & ethics rules (enforced in code review)

  1. No taste claim without a Qloo query echo behind it.
  2. GS withheld, never interpolated, on insufficient data.
  3. People are not a query type β€” no person-tracking affordances.
  4. No PII collected; no accounts.
  5. Coverage badge on every panel: live | cached | insufficient-data.

Deployment

One service serves everything (static client + REST + MCP) β€” so one host covers the whole app:

  • Render free instance (used for this submission) β€” render.yaml Blueprint: Render β†’ New β†’ Blueprint Instance β†’ repo kvmtest/topovibe β†’ set QLOO_API_KEY when prompted β†’ Deploy. Render injects PORT itself; the service listens on it. Free instances sleep after ~15 min idle β€” point a free uptime ping (e.g. UptimeRobot, 5-min interval) at /api/health to keep it warm for judges. Manual alternative: New β†’ Web Service β†’ build npm install && npm run build β†’ start npm start.
  • AWS Elastic Beanstalk (planned for the final version) β€” upload a source bundle (git archive of tracked files β€” no secrets, no cache), Node.js 22 platform, set env var QLOO_API_KEY. EB runs npm install and npm start, which auto-builds the client on first boot (scripts/start.mjs).
  • AWS App Runner β€” apprunner.yaml included, but note: App Runner stopped accepting new customers (AWS notice, April 30, 2026); existing-customer accounts can still use it.
  • Fly.io β€” fly launch (Node 20+, port 4173), fly secrets set QLOO_API_KEY=....

After deploying, point mcp.json at https://<your-host>/mcp.

Kill-switches engaged during the build (brief Β§9 β€” honest list)

Kill-switch Status
MCP SDK trouble β†’ plain REST Not needed β€” @modelcontextprotocol/sdk streamable HTTP works; verified headlessly via raw JSON-RPC (initialize β†’ tools/list β†’ 5 tools/call β†’ 429 rate limit).
Sparse trending β†’ N=0 + unknown flag ENGAGED β€” /v2/trending has no urn:entity:place support; every venue shows n.unknown = true.
Sparse heatmap city β†’ backup city Not needed β€” Austin/NYC/Tokyo grids are dense for all 3 presets. Two tags were swapped instead (indie-music keyword β†’ live-music-venue; specialty-coffee β†’ coffee-shop genre).
Deploy trouble β†’ flawless local run Available; npm start after npm run build is the judged fallback.

Repo layout

topovibe/
β”œβ”€β”€ LICENSE                     # MIT + attribution note
β”œβ”€β”€ README.md Β· mcp.json Β· render.yaml
β”œβ”€β”€ .env.example                # QLOO_API_KEY, QLOO_BASE_URL, PORT, DEMO_CITIES
β”œβ”€β”€ package.json Β· vite.config.js Β· index.html
β”œβ”€β”€ src/                        # CLIENT (Vanilla JS + CesiumJS + Vite)
β”‚   β”œβ”€β”€ main.js                 # boot: viewer, basemap, wire modules
β”‚   β”œβ”€β”€ globe.js                # Cesium init (Esri), fly-to
β”‚   β”œβ”€β”€ cities.js               # bundled demo-city list (keyless search)
β”‚   β”œβ”€β”€ layers/insights.js      # GS-colored venue markers
β”‚   β”œβ”€β”€ layers/heatmap.js       # urn:heatmap β†’ affinity-colored points
β”‚   β”œβ”€β”€ panels/dna.js           # Cultural DNA panel
β”‚   β”œβ”€β”€ panels/grounding.js     # GS badge + A/T/N bars
β”‚   └── share.js                # scene ⇄ URL hash
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ index.js                # Express boot, static, startup self-check
β”‚   β”œβ”€β”€ qloo.js                 # broker (X-Api-Key, GET-only, cache, validity)
β”‚   β”œβ”€β”€ validity.js             # param ↔ filter.type matrix
β”‚   β”œβ”€β”€ grounding.js            # Grounding Score engine
β”‚   β”œβ”€β”€ routes.js               # /api/* REST (+ shared builders for MCP)
β”‚   β”œβ”€β”€ mcp.js                  # MCP server (streamable HTTP), 5 tools
β”‚   └── cache.js                # TTL cache + demo pre-cache loader
└── scripts/
    β”œβ”€β”€ selfcheck.mjs           # one /v2/insights ping β€” green at minute 0
    β”œβ”€β”€ precache.mjs            # warms cache for 3 demo cities Γ— 3 presets
    β”œβ”€β”€ probe.mjs / probe-raw.mjs / probe-entity.mjs   # API shape discovery
    └── phase1/4/5-check.mjs    # acceptance checks

Attribution & legal

  • TopoVibe is a clean-room build, inspired by the open-source "God's Eye View" project (MIT) β€” no God's Eye View code, assets, or data were copied.
  • Qloo: hackathon key, valid only on hackathon.api.qloo.com, subject to rate/monthly quotas, expires post-judging. Responses are cached privately per Qloo terms; nothing cached is committed (cache/ is git-ignored). Production use requires a commercial Qloo agreement.
  • Basemap: Esri World Imagery per Esri terms; attribution rendered on-globe.
  • Demo geography: Austin Β· New York City Β· Tokyo (the cities Qloo's own docs use in examples).

License

MIT β€” see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages