How prasannashr/twin works
This is a privacy-filtered digital-twin career assistant. A visitor asks a question or supplies job requirements through the chat UI; the agent may search the profile or gather evidence per requirement, then returns a bounded, citation-checked answer with source passages and research actions. The README documents ingestion, chunking, and in-memory BM25 indexing; those internals are represented at the documented subsystem level because their source was not sampled.
Main entry points: graph.py Bounded agent loop · interface.py Chat interface · tools.py Read-only tool dispatch · loader.py Document ingestion
Components 16
Chat experience
- Chat interface
twin/ui/interface.py - App entry
app.py - Answer and evidence
twin/ui/interface.py
Agent and safety
- Bounded agent loop
twin/agent/graph.py - Agent instructions
twin/agent/prompts.py - Read-only tool dispatch
twin/agent/tools.py - Privacy checks
twin/privacy.py - Request source IDs
twin/agent/tools.py
Profile retrieval
- Profile summary
data/summary.txt - Career PDF
data/linkedin.pdf - Document ingestion
twin/retrieval/loader.py - In-memory BM25 index
twin/retrieval/knowledge_base.py
Model service
- Provider client
twin/provider.py - Runtime settings
twin/config.py
Other components
- Visitor
- Experiential Labs
Connections 21
- Visitor → Chat interface: asks question
- App entry → Chat interface: launches UI
- Chat interface → Privacy checks: checks input
- Chat interface → Bounded agent loop: runs request
- Bounded agent loop → Agent instructions: uses instructions
- Bounded agent loop → Provider client: requests completion
- Provider client → Runtime settings: reads settings
- Provider client → Experiential Labs: sends completion
- Bounded agent loop → Read-only tool dispatch: dispatches tools
- Read-only tool dispatch → In-memory BM25 index: searches passages
- Read-only tool dispatch → Privacy checks: filters queries
- Read-only tool dispatch → Request source IDs: registers evidence
- Request source IDs → Bounded agent loop: returns evidence
- Bounded agent loop → Privacy checks: validates answer
- Profile summary → Document ingestion: provides text
- Career PDF → Document ingestion: provides PDF
- Document ingestion → Privacy checks: filters passages
- Document ingestion → In-memory BM25 index: builds index
- Bounded agent loop → Chat interface: returns answer and sources
- Chat interface → Answer and evidence: renders evidence
- Answer and evidence → Visitor: shows response