Generic Swedish construction resources, bilingual: typical and conservative A1–A3, A4, A5.1, transports. Danish BR is a second Catalog (dkbr), file-only. Agents call REST/MCP; humans open GET / after make run. This Pages site is not that console. Cite Boverket. Not affiliated with Boverket.
git clone https://github.com/mong-x/klimatsearch.git && cd klimatsearch && make run
1$ curl -sS '…/api/search?q=spånskiva&lang=sv' 2{ 3 "source": "Boverket Klimatdatabas", 4 "results": [{ 5 "id": "6000000000", 6 "catalog": "boverket", 7 "name_sv": "Spånskiva", 8 "a1a3": 0.39, 9 "conversions": { "kg/m³": 700 }, 10 "match_source": "fts", 11 "details": "/api/resources/boverket:6000000000" 12 }] 13}
1$ curl -sS '…/api/resources/boverket:6000000000' 2{ 3 "id": "6000000000", 4 "catalog": "boverket", 5 "name_sv": "Spånskiva", 6 "a1a3": 0.39, 7 "category": "Byggskivor", 8 "source": "Boverket Klimatdatabas", 9 "origin": "https://klimatdatabasen.boverket.se/detaljer/10/6000000000" 10} 11# GET …/api/resources/boverket:6000000000/origin → 302 to origin
stdlib ServeMux, CGO SQLite, goose migrations, official MCP Go SDK. Kind e2e on every main push. 1.0 How it works →
k=60. match_source is retrieval fts | vector | both; rerank is a separate flag on the Hit.(catalog_id, resource_id). Catalogs: boverket (JSON API) and dkbr (file; DatasetVersion BR18/BR25). br25 aliases dkbr. REST databases= filters Catalogs — not a citation.search_climate_data, get_resource_details, compare_resources on /mcp (streamable) and /mcp/sse./healthz and /api/* are ungated. The hosted build we run adds Guard via -tags hosted.html/template on the running process: Query, Data, Ingest, Webhooks, Lab. Open http://127.0.0.1:8080/ after make run. This Pages site is marketing only.After make run, open GET /. Same Engine as REST and MCP.
1.1 Console →
| GET | What it is |
|---|---|
| / | Query — catalogs, vector, rerank, rank, REST/MCP inspector |
| /data | SQLite coverage, Resources, embeddings |
| /ingest | Preview a CSV/xlsx, map columns, Apply (file stashed 30 min) |
| /compare | Two Resource IDs |
| /connect | Lab — /healthz, mcp.json, curl |
| /webhooks | Add and edit Slack, Discord, and JSON destinations |
On the process: GET /webhooks. Edit URL, events, secret, enabled. Env KLIMAT_WEBHOOK_URL is extra, not a replacement.
1.2 Notify →
| Event | When |
|---|---|
| catalog.changed | Ingest upserted a Resource whose ContentHash changed |
| catalog.unreachable | Boverket JSON and Excel both fail |
| ingest.failed | Boot or weekly ingest errors |
| Destination | Body |
|---|---|
| Slack hooks.slack.com | {"text":"klimatsearch catalog.unreachable …"} |
| Discord discord.com/api/webhooks | {"content":"…"} |
| Anything else | JSON Event; optional HMAC X-Klimat-Signature |
Same Guard on /api/*, /mcp, and /admin/*.
2.0 API →
| Method | Path |
|---|---|
| GET | /healthz |
| GET | /openapi.yaml |
| GET | /docs |
| GET | /api/search?q=&vector=&rerank=&lang=sv|en&databases= |
| GET | /api/resources/{id}?lang= |
| GET | /api/resources/compare?a=&b=&unit= |
| POST | /admin/ingest/file?catalog=dkbr |
| POST | /admin/ingest/preview |
| POST | /admin/resources |
| Tool | Does |
|---|---|
| search_climate_data | Query names and descriptions; optional databases[] |
| get_resource_details | One Resource by prefixed or bare id |
| compare_resources | A1–A3 of two Resources in one unit |
| Build | What you get |
|---|---|
| make build | Self-hosted. No Unkey, no mpp-go. API is ungated. |
| make build-hosted | Our process. MPP Payment (402) and Unkey Bearer. |
From the official Klimatdatabas 02.07.000 JSON view and this repo’s tests. 3.0 Specs →
| Fact | Value |
|---|---|
| Resources in 02.07.000 | ~230 bilingual rows (208 products with typical A1–A3, 22 energy/fuel) |
| Embedding | F2LLM-v2-80M, 320-d, last-token pool, L2; Fake in CI |
| RRF k | 60 |
| Go | 1.27, CGO, -tags fts5 |
| License | Apache-2.0 for software; cite Boverket for data |
Data is from Boverket Klimatdatabas. You must cite Boverket as the source. This project is not affiliated with Boverket. Production weights for the hosted process are documented in docs/LAUNCH.md — they are not in git.