How paarthexe/twinterrytao works
Terence Tao AI is a conversational digital twin whose main workflow retrieves mathematical literature, adds user memory, drafts an answer, and audits it before presentation. The React UI and alternate Streamlit dashboard expose chat, memory, concept exploration, and ingestion controls; Flask routes the primary API workflow. The graph also preserves blog/arXiv ingestion and hybrid search. Some backend and UI source excerpts are partial, so uncertain internal calls are omitted; documented product relationships are cited to the README.
Main entry points: App.tsx React app · model.py Draft and audit · server.py Flask API · scraper.py Source ingestion
Components 21
User interfaces
- React app
frontend/src/App.tsx - Chat workspace
frontend/src/components/ChatWorkspace.tsx - Math renderer
frontend/src/components/MarkdownViewer.tsx - Navigation and sync
frontend/src/components/Navbar.tsx - Memory matrix
frontend/src/components/MemoryMatrix.tsx - Concept explorer
frontend/src/components/ConceptExplorer.tsx - Graph renderer
frontend/src/components/ForceGraph.tsx - Streamlit dashboard
app.py
API and orchestration
- Flask API
server.py
Knowledge and retrieval
- Source ingestion
scraper.py - Markdown corpus
documents - Hybrid retrieval
rag.py - Chroma vector index
rag.py
Answer generation
- Draft and audit
model.py - Prompt definitions
prompts.py
Persistent memory
- Memory operations
memory.py - Long-term memory
memory.py
Other components
- User
- WordPress blog
- arXiv API
- Ollama
Connections 26
- User → React app: uses
README.md - React app → Flask API: calls API
frontend/src/App.tsx - React app → Chat workspace: renders
frontend/src/App.tsx - React app → Navigation and sync: renders
frontend/src/App.tsx - React app → Memory matrix: renders
frontend/src/App.tsx - React app → Concept explorer: renders
frontend/src/App.tsx - Chat workspace → Math renderer: renders
frontend/src/components/ChatWorkspace.tsx - Concept explorer → Graph renderer: renders
frontend/src/components/ConceptExplorer.tsx - Concept explorer → Math renderer: renders
frontend/src/components/ConceptExplorer.tsx - Navigation and sync → Flask API: triggers sync
README.md - Flask API → Draft and audit: runs chat
README.md - Flask API → Memory operations: reads and updates
server.py - Flask API → Source ingestion: triggers ingestion
server.py - Streamlit dashboard → Draft and audit: runs chat
README.md - Streamlit dashboard → Memory operations: uses memory
app.py - Streamlit dashboard → Source ingestion: triggers ingestion
README.md - Source ingestion → WordPress blog: fetches posts
README.md - Source ingestion → arXiv API: fetches papers
README.md - Source ingestion → Markdown corpus: saves documents
README.md - Hybrid retrieval → Markdown corpus: indexes corpus
README.md - Hybrid retrieval → Chroma vector index: reads and writes
rag.py - Draft and audit → Hybrid retrieval: retrieves sources
model.py - Draft and audit → Prompt definitions: uses prompts
model.py - Draft and audit → Ollama: requests generation
model.py - Draft and audit → Memory operations: adds user context
README.md - Memory operations → Long-term memory: reads and writes
memory.py