HUB
Sign inSign up

straightchlorine/wke-web

By straightchlorine

•Updated 1 day ago

[frontend] Any Wikipedia topic as a cited, token-budgeted dossier pinned to one article revision.

Image
Web servers
0

752

straightchlorine/wke-web repository overview

Wikipedia Knowledge Explorer

Live application⁠

Turns a Wikipedia topic into a dossier pinned to one article revision, cut to a token budget.

⁠Architecture

  • wke-api serves REST, MCP and /llms.txt and runs the job worker, the watcher, the trending job and the nightly refresh job, which keeps stored dossiers from expiring and asks for a rebuild when the article was edited. It does not import torch.
  • wke-ml embeds and clusters sections and, on request, summarises. Without it the API groups sections by article structure instead.
  • wke-web is a React single-page app served by nginx.
  • Redis holds the job queue, the dossier cache and the Wikimedia call budget.

A cold build costs three Wikimedia calls and a warm read costs none.

⁠What it does

  • Builds a dossier from an article title, pinned to the revision current at build time
  • Clusters sections by embedding similarity and cites every passage to that revision
  • Packs the result to 2000, 8000 or 32000 tokens
  • Serves a web page, Markdown, JSON, /llms.txt and an MCP server
  • Shows yesterday's most-read topics as a concept graph on the home page
  • Adds model summaries only with ?summaries=true, each labelled as model output

⁠Running locally

You need Docker with Compose; without Docker also uv⁠, pnpm⁠ and just⁠.

cp backend/api/.env.example backend/api/.env
# set WKE_CONTACT_EMAIL: a mailbox or an https URL, sent in the Wikimedia User-Agent
docker compose -f docker-compose.dev.yml --profile ml up --build

Open http://localhost:8080⁠, not :5173 or a container address: the CORS settings name localhost:8080. Leave --profile ml out to run without wke-ml.

curl -s -X POST http://localhost:8080/api/v1/dossiers \
  -H 'content-type: application/json' -d '{"title": "Alan Turing"}'
curl -s 'http://localhost:8080/api/v1/dossiers/1208.md?budget=8000'   # once built

Without Docker, just up starts Redis, wke-ml, wke-api, the watcher and a web preview (Linux; run pnpm install in frontend/app once), and just down stops them. The per-service commands are in the READMEs under backend/ and frontend/app/.

⁠Tests

cd backend/api && uv run pytest --cov=wke --cov-fail-under=85
cd backend/ml && uv run pytest
cd frontend/app && pnpm run verify && pnpm run verify:e2e

The backend tests replay recorded Wikimedia responses and run offline.

⁠API and MCP

The REST contract is backend/api/openapi.yaml⁠; endpoints and settings are in backend/api/README.md⁠.

Entry pointPath
Build or read a dossierPOST /api/v1/dossiers, GET /api/v1/dossiers/{page_id}[.md]
Poll a buildGET /api/v1/jobs/{job_id}
ModelsGET /llms.txt, /mcp with search_topics, get_dossier, get_trending

⁠Licence

MIT⁠ for code.

Third-party material keeps its own licence (fonts, model weights, Wikipedia text); see NOTICE⁠.

Article text served through WKE is from English Wikipedia under CC BY-SA 4.0.


To the only God, be honour and glory for ever and ever.

Tag summary

Content type

Image

Digest

sha256:88f79bc36…

Size

12.8 MB

Last updated

1 day ago

docker pull straightchlorine/wke-web