How harsha943vf/page_chat works
PageChat is a Flask app for loading a web page, preparing searchable chunks, and answering questions about that page with a local Ollama model. The main workflow runs through page loading and chat API handlers in app.py; the static HTML is the browser-facing interface, but its wiring is not shown in the excerpts. The graph preserves documented capabilities such as chunk browsing, caching, and performance statistics. Some internal calls are in omitted portions of app.py, so those links are marked unverified rather than asserted.
Main entry points: app.py Chat API · index.html PageChat UI
Components 17
Page preparation
- Page load API
pagechat/app.py - Page extraction
pagechat/app.py - Section chunking
pagechat/app.py - Embedding preparation
pagechat/app.py - Chunk browsing API
pagechat/app.py
Question answering
- Chat API
pagechat/app.py - Hybrid retrieval
pagechat/app.py - Context assembly
pagechat/app.py
Page and session state
- Page cache
pagechat/app.py - Conversation history
pagechat/app.py - Cache statistics API
pagechat/app.py - Cache and chat clearing
pagechat/app.py
Browser interface
- PageChat UI
pagechat/static/index.html
Other components
- User
- Web page
- Ollama embeddings
- Ollama chat model
Connections 23
- User → PageChat UI: uses
- PageChat UI → Page load API: requests page
- Page load API → Page extraction: calls
pagechat/app.py - Page extraction → Web page: fetches
pagechat/app.py - Page load API → Section chunking: chunks sections
pagechat/app.py - Page load API → Embedding preparation: precomputes
pagechat/app.py - Embedding preparation → Ollama embeddings: requests embeddings
- Page load API → Page cache: stores page
pagechat/app.py - PageChat UI → Chunk browsing API: browses chunks
- Chunk browsing API → Page cache: reads page
pagechat/app.py - PageChat UI → Chat API: asks question
- Chat API → Page cache: reads chunks
pagechat/app.py - Chat API → Conversation history: manages history
pagechat/app.py - Chat API → Hybrid retrieval: selects context
pagechat/app.py - Hybrid retrieval → Context assembly: provides chunks
pagechat/app.py - Chat API → Ollama chat model: calls chat
pagechat/app.py - Context assembly → Chat API: supplies prompt
pagechat/app.py - Chat API → PageChat UI: returns answer
- PageChat UI → Cache statistics API: requests stats
- Cache statistics API → Page cache: reports cache
pagechat/app.py - PageChat UI → Cache and chat clearing: clears state
- Cache and chat clearing → Page cache: clears pages
pagechat/app.py - Cache and chat clearing → Conversation history: clears history
pagechat/app.py