How joejbaldwin/medra works
MeDRA streams model reasoning or supplied text into a live dashboard: a selected source yields chunks, the backend mines them into offset-aware metrics, presentation converts metrics into visual updates, and the browser renders text, concept, topic, and step views. The graph preserves documented source options and visualizations. Some subsystem links rely on the README because their implementation was not sampled; uncertain internal calls are omitted.
Main entry points: main.ts Dashboard app · server.py Session API · miner.py Incremental miner · pipeline.py Stream pipeline
Components 27
Session runtime
- Session API
backend/medra/server.py - Stream pipeline
backend/medra/pipeline.py - Message contracts
backend/medra/contracts.py
Text sources
- Trace replay
backend/medra/sources/replay.py - Sample traces
backend/medra/sources/samples.py - Pasted text
backend/medra/sources/paste.py - DeepSeek source
backend/medra/sources/deepseek.py - Ollama source
backend/medra/sources/ollama.py
Text mining
- Incremental miner
backend/medra/mining/miner.py - Language detection
backend/medra/mining/language.py - Text cleaning
backend/medra/mining/clean.py - Segmentation
backend/medra/mining/segment.py - Topic clustering
backend/medra/mining/topics.py
Presentation
- View presenter
backend/medra/present/presenter.py - Bubble selection
backend/medra/present/select.py - Topic timeline
backend/medra/present/timeline.py
Dashboard
- Dashboard app
frontend/src/main.ts - View state
frontend/src/state.ts - Stream text
frontend/src/textPane.ts - Visualization panels
frontend/src/panels.ts - Concept map
frontend/src/conceptMap.ts - Topic timeline
frontend/src/timeline.ts - Step graph
frontend/src/stepGraph.ts - Window layout
frontend/src/layout.ts - View picker
frontend/src/picker.ts
Other components
- User
- Model service
Connections 31
- User → Dashboard app: selects source
- Dashboard app → Session API: creates session
- Session API → Stream pipeline: starts stream
backend/medra/server.py - Session API → Trace replay: loads trace
backend/medra/server.py - Trace replay → Sample traces: reads traces
backend/medra/sources/replay.py - Session API → Pasted text: selects source
- Session API → DeepSeek source: selects source
backend/medra/server.py - Session API → Ollama source: selects source
backend/medra/server.py - DeepSeek source → Model service: streams request
backend/medra/sources/deepseek.py - Ollama source → Model service: uses local model
- Stream pipeline → Incremental miner: feeds chunks
backend/medra/pipeline.py - Stream pipeline → View presenter: presents metrics
backend/medra/pipeline.py - Stream pipeline → Message contracts: emits messages
backend/medra/pipeline.py - Incremental miner → Message contracts: produces metrics
backend/medra/mining/miner.py - Incremental miner → Language detection: detects language
backend/medra/mining/miner.py - Incremental miner → Text cleaning: masks text
backend/medra/mining/miner.py - Incremental miner → Segmentation: segments text
backend/medra/mining/miner.py - Incremental miner → Topic clustering: clusters topics
backend/medra/mining/miner.py - View presenter → Bubble selection: selects bubbles
backend/medra/present/presenter.py - View presenter → Topic timeline: builds timeline
backend/medra/present/presenter.py - View presenter → Message contracts: produces views
backend/medra/present/presenter.py - Session API → Dashboard app: streams updates
- Dashboard app → View state: updates state
frontend/src/main.ts - Dashboard app → Stream text: renders text
frontend/src/main.ts - Dashboard app → Visualization panels: opens views
frontend/src/main.ts - Dashboard app → Window layout: manages windows
frontend/src/main.ts - Dashboard app → View picker: offers views
frontend/src/main.ts - Visualization panels → Concept map: renders map
frontend/src/panels.ts - Visualization panels → Topic timeline: renders timeline
frontend/src/panels.ts - Visualization panels → Step graph: renders steps
frontend/src/panels.ts - View state → Message contracts: stores updates
frontend/src/state.ts