How amilheir/wikigraph works
WikiGraph is a self-growing Wikipedia GraphRAG chatbot. A browser submits a question to the Flask WSGI API, which queues it in IRIS; the polling service dispatches it to the chat orchestrator. Retrieval searches the graph and scoped vectors first, and a weak match can trigger one-page Wikipedia lookup, article ingestion and LLM extraction before grounded answer generation. The README also documents add-by-title, approval, graph cleanup, management and documentation capabilities. Edges reflect cited excerpts or README statements; some operation internals and UI/API details are unsampled.
Main entry points: processes.py Chat orchestrator · wg_check.js Chat UI · app.py Flask API · operations.py LLM operations
Components 17
Chat interface
- Chat UI
src-iris/wsgi/static/wg_check.js - Product documentation
src-iris/wsgi/docs/overview.html
Web API
- Flask API
src-iris/wsgi/app.py
Interop workflow
- Polling service
src-iris/production/services.py - Chat orchestrator
src-iris/production/processes.py - Interop messages
src-iris/production/messages.py
Knowledge pipeline
- Graph retrieval
src-iris/production/operations.py - Wikipedia lookup
src-iris/production/operations.py - Article ingestion
src-iris/production/processes.py - LLM operations
src-iris/production/operations.py - Entity resolution
src-iris/production/operations.py - Chunking and helpers
src-iris/production/common.py
IRIS state and models
- Chat request queue
- GraphKB storage
Other components
- Chat user
- Ollama models
- Wikipedia
Connections 23
- Chat user → Chat UI: uses
README.md - Chat UI → Flask API: submits and polls
README.md - Flask API → Chat request queue: queues request
src-iris/wsgi/app.py - Polling service → Chat request queue: claims queued rows
src-iris/production/services.py - Polling service → Chat orchestrator: dispatches chat
src-iris/production/services.py - Polling service → Entity resolution: dispatches resolve
src-iris/production/services.py - Chat orchestrator → Graph retrieval: searches context
src-iris/production/processes.py - Chat orchestrator → Wikipedia lookup: fetches page
src-iris/production/processes.py - Chat orchestrator → Article ingestion: requests ingest
src-iris/production/processes.py - Chat orchestrator → LLM operations: requests answer
src-iris/production/wikiGraph.py - Wikipedia lookup → LLM operations: distils topic
src-iris/production/wikiGraph.py - Article ingestion → LLM operations: extracts entities
src-iris/production/processes.py - Wikipedia lookup → Wikipedia: fetches article
README.md - Article ingestion → GraphKB storage: stores graph data
README.md - Graph retrieval → GraphKB storage: retrieves graph context
README.md - Graph retrieval → Ollama models: embeds queries
README.md - LLM operations → Ollama models: requests completions
README.md - Entity resolution → GraphKB storage: merges entities
README.md - Chunking and helpers → GraphKB storage: updates chat status
src-iris/production/common.py - Flask API → Product documentation: serves documentation
src-iris/wsgi/app.py - Chat UI → Flask API: manages knowledge
- Chat UI → Entity resolution: requests cleanup
README.md - Interop messages → Chat orchestrator: defines request contract
src-iris/production/messages.py