How chaithz/thinktree works
This is a PDF-backed knowledge-graph application. Users upload a PDF, whose extracted text is chunked into ChromaDB; they then submit a question, receive retrieved context distilled by Ollama into graph-shaped JSON, and view an interactive graph. The graph covers the documented-by-code workflow and visualization; no README capabilities were provided. Backend and frontend request relationships are explicit in their callers; the LLM and vector-store internals are represented only where main.py invokes them.
Main entry points: page.jsx Graph page · main.py Query handler · KnowledgeGraph.jsx Graph renderer
Components 11
Graph interface
- Graph page
frontend/src/app/knowledge-graph/page.jsx - Graph renderer
frontend/src/components/KnowledgeGraph.jsx
Knowledge API
- FastAPI app
main.py - PDF extraction
main.py - Query handler
main.py
Retrieval and generation
- Text chunking
main.py - Vector retrieval
main.py - Ollama generation
main.py
Document storage
- ChromaDB collection
main.py
Other components
- User
- PDF file
Connections 14
- User → Graph page: submits query
frontend/src/app/knowledge-graph/page.jsx - User → Graph page: selects PDF
frontend/src/app/knowledge-graph/page.jsx - PDF file → Graph page: provides upload
frontend/src/app/knowledge-graph/page.jsx - Graph page → FastAPI app: POST query
frontend/src/app/knowledge-graph/page.jsx - Graph page → FastAPI app: POST PDF
frontend/src/app/knowledge-graph/page.jsx - FastAPI app → PDF extraction: routes upload
main.py - PDF extraction → Text chunking: chunks extracted text
main.py - PDF extraction → ChromaDB collection: upserts chunks
main.py - FastAPI app → Query handler: routes query
main.py - Query handler → Vector retrieval: queries collection
main.py - Vector retrieval → ChromaDB collection: retrieves context
main.py - Query handler → Ollama generation: sends context and prompt
main.py - Query handler → Graph page: returns answer
frontend/src/app/knowledge-graph/page.jsx - Graph page → Graph renderer: renders parsed graph
frontend/src/app/knowledge-graph/page.jsx