How himanshuksr0007/why-code works
Why-Code turns repository history and source structure into a Neo4j evidence graph, then answers questions with cited evidence or refuses unsupported claims. The principal workflow runs from repository selection and ingestion through decision/structure extraction and graph indexing to retrieval, validation, and answer presentation. The product also includes decision auditing, graph exploration, sharing, accounts, and custom model settings. Edges are limited to relationships explicit in the excerpts or README; several implementation details are unsampled, so those links are omitted.
Main entry points: routes.py Ask and evidence routes · retrieval/service.py Retrieval pipeline · neo4j_driver.py Evidence graph · ingestion/service.py History ingestion
Components 21
Repository indexing
- History ingestion
backend/app/ingestion/service.py - Decision extraction
backend/app/intent/pipeline.py - Code structure extraction
backend/app/structural/pipeline.py - Evidence graph
backend/app/graph/neo4j_driver.py
Grounded answers
- API application
backend/app/main.py - Ask and evidence routes
backend/app/retrieval/api/routes.py - Retrieval pipeline
backend/app/retrieval/service.py - Live repository service
backend/app/retrieval/live_service.py - LLM provider
backend/app/intent/llm/provider.py - Model management
backend/app/models/service.py
Decision exploration
- Decision center
frontend/src/components/decisions/decision-explorer.tsx - Graph explorer
frontend/src/components/graph/graph-explorer.tsx - Decision records API
backend/app/features/routes.py
Accounts and sharing
- Authentication
backend/app/auth/service.py - Chat sharing
backend/app/shares/service.py
Web experience
- Why-Code app
frontend/src/app/page.tsx - Answer presentation
frontend/src/components/answer/answer-panel.tsx - Question workspace
frontend/src/components/ask/ask-workspace.tsx - Share viewer
frontend/src/components/share/share-viewer.tsx - Settings
frontend/src/components/settings/settings-page.tsx
Other components
- Visitor
Connections 22
- Visitor → Why-Code app: opens
- Why-Code app → Ask and evidence routes: asks via
- Ask and evidence routes → Retrieval pipeline: invokes
backend/app/retrieval/api/routes.py - Ask and evidence routes → Live repository service: asks live service
backend/app/retrieval/api/routes.py - Retrieval pipeline → LLM provider: synthesizes with
backend/app/retrieval/service.py - Retrieval pipeline → Evidence graph: retrieves evidence
- Ask and evidence routes → Answer presentation: returns cited answer
- Question workspace → Ask and evidence routes: submits question
- History ingestion → Decision extraction: supplies history
- History ingestion → Code structure extraction: supplies repository
- Decision extraction → Evidence graph: records decisions
- Code structure extraction → Evidence graph: writes structure
- Visitor → Decision center: browses decisions
- Decision center → Decision records API: loads audit records
- Visitor → Graph explorer: explores connections
- Visitor → Settings: manages models
- Settings → Model management: configures model
- Visitor → Authentication: creates account
- Visitor → Share viewer: views shared chat
- Share viewer → Chat sharing: loads share
- API application → Ask and evidence routes: mounts routes
backend/app/main.py - API application → Decision records API: mounts routes
backend/app/main.py