# jeremykamber/kynd architecture

> Architecture diagram of the GitHub repository jeremykamber/kynd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeremykamber/kynd
- Repository: https://github.com/jeremykamber/kynd
- Video tour (about a minute): https://gitdiagram.com/jeremykamber/kynd/video

## Overview

Kynd is an AI user-testing product: users provide a site, screenshot, or interview transcripts; the app runs AI personas through artifact analysis or derives personas from interviews, then presents behavioral findings and persona results. The map highlights analysis, interview-based persona generation, and documented persona chat/debate capabilities. Sampled routes show background runs and polling; unsampled wiring is omitted, and the README describes the broader product rather than detailed implementation.

Main entry points: [`src/infrastructure/adapters/LlmServiceImpl.ts`](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/LlmServiceImpl.ts) (LLM service), [`src/app/api/vps/generate-personas-from-interviews/route.ts`](https://github.com/jeremykamber/kynd/blob/main/src/app/api/vps/generate-personas-from-interviews/route.ts) (Interview API), [`src/application/usecases/GeneratePersonasFromInterviewsUseCase.ts`](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/GeneratePersonasFromInterviewsUseCase.ts) (Interview persona generation), [`src/application/usecases/AnalyzeArtifactUseCase.ts`](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/AnalyzeArtifactUseCase.ts) (Artifact analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Dashboard"]
  node_interview_ui["Interview upload"]
  node_pipeline_hook["Interview pipeline"]
  node_analysis_action["Analysis actions"]
  node_interview_action["Interview action"]
end

subgraph group_workflow["Testing workflows"]
  node_analysis_api["Analysis API<br/>[route.ts]"]
  node_report_api["Report API<br/>[route.ts]"]
  node_interview_api["Interview API<br/>[route.ts]"]
  node_analysis_usecase["Artifact analysis"]
  node_interview_usecase["Interview persona generation"]
  node_persona_usecase["Persona generation"]
  node_chat_usecase["Persona chat"]
  node_debate_usecase["Persona debate<br/>[DebateUseCase.ts]"]
end

subgraph group_ai["AI and domain"]
  node_artifact_domain["Analysis results"]
  node_persona_domain["Persona model<br/>[Persona.ts]"]
  node_llm_service["LLM service<br/>[LlmServiceImpl.ts]"]
  node_intake["Artifact intake"]
  node_rag["Persona retrieval<br/>[IdRagService.ts]"]
end

subgraph group_runtime["Runtime services"]
  node_browser["Remote browser"]
  node_run_results[("Run results")]
  node_persona_results[("Persona results")]
end

node_user(("User"))
node_llm_provider{{"OpenRouter"}}
node_target_site{{"Website or app"}}

node_user -->|"uses"| node_dashboard
node_user -->|"uploads transcripts"| node_interview_ui
node_interview_ui -->|"submits files"| node_pipeline_hook
node_pipeline_hook -->|"starts generation"| node_interview_action
node_analysis_action -->|"requests analysis"| node_analysis_api
node_interview_action -->|"submits transcripts"| node_interview_api
node_analysis_api -->|"executes"| node_analysis_usecase
node_report_api -->|"executes"| node_analysis_usecase
node_interview_api -->|"executes"| node_interview_usecase
node_interview_api -->|"provides generator"| node_persona_usecase
node_analysis_usecase -->|"uses intake"| node_intake
node_analysis_usecase -->|"analyzes artifacts"| node_llm_service
node_intake -->|"loads pages"| node_browser
node_intake -->|"summarizes content"| node_llm_service
node_browser -->|"visits"| node_target_site
node_analysis_api -->|"stores results"| node_run_results
node_interview_api -->|"stores personas"| node_persona_results
node_interview_usecase -->|"extracts signals"| node_llm_service
node_interview_usecase -->|"generates personas"| node_persona_usecase
node_interview_usecase -->|"indexes personas"| node_rag
node_persona_usecase -->|"creates personas"| node_llm_service
node_chat_usecase -->|"generates replies"| node_llm_service
node_chat_usecase -->|"retrieves context"| node_rag
node_debate_usecase -->|"runs debate"| node_llm_service
node_llm_service -->|"sends prompts"| node_llm_provider

click node_dashboard "https://github.com/jeremykamber/kynd/tree/main/src/app/(app)/dashboard"
click node_interview_ui "https://github.com/jeremykamber/kynd/blob/main/src/ui/interviews/InterviewUploadClient.tsx"
click node_pipeline_hook "https://github.com/jeremykamber/kynd/blob/main/src/ui/hooks/useInterviewPipeline.ts"
click node_analysis_action "https://github.com/jeremykamber/kynd/blob/main/src/actions/analyzeArtifactAction.ts"
click node_interview_action "https://github.com/jeremykamber/kynd/blob/main/src/actions/generatePersonasFromInterviews.ts"
click node_analysis_api "https://github.com/jeremykamber/kynd/blob/main/src/app/api/vps/analyze/route.ts"
click node_report_api "https://github.com/jeremykamber/kynd/blob/main/src/app/api/report/route.ts"
click node_interview_api "https://github.com/jeremykamber/kynd/blob/main/src/app/api/vps/generate-personas-from-interviews/route.ts"
click node_analysis_usecase "https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/AnalyzeArtifactUseCase.ts"
click node_interview_usecase "https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/GeneratePersonasFromInterviewsUseCase.ts"
click node_persona_usecase "https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/GeneratePersonasUseCase.ts"
click node_chat_usecase "https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/ChatWithPersonaUseCase.ts"
click node_debate_usecase "https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/DebateUseCase.ts"
click node_artifact_domain "https://github.com/jeremykamber/kynd/blob/main/src/domain/entities/ArtifactAnalysis.ts"
click node_persona_domain "https://github.com/jeremykamber/kynd/blob/main/src/domain/entities/Persona.ts"
click node_llm_service "https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/LlmServiceImpl.ts"
click node_intake "https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/ArtifactIntakeAdapter.ts"
click node_rag "https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/IdRagService.ts"
click node_browser "https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/RemotePlaywrightAdapter.ts"
click node_run_results "https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/AnalysisResultStore.ts"
click node_persona_results "https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/PersonaGenerationStore.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_interview_ui,node_pipeline_hook,node_analysis_action,node_interview_action,node_user toneBlue
class node_analysis_api,node_report_api,node_interview_api,node_analysis_usecase,node_interview_usecase,node_persona_usecase,node_chat_usecase,node_debate_usecase toneAmber
class node_artifact_domain,node_persona_domain,node_llm_service,node_intake,node_rag,node_llm_provider toneMint
class node_browser,node_run_results,node_persona_results toneRose
class node_target_site toneIndigo
```

## Components

### User experience

- [Dashboard](https://github.com/jeremykamber/kynd/tree/main/src/app/(app)/dashboard): `src/app/(app)/dashboard`
- [Interview upload](https://github.com/jeremykamber/kynd/blob/main/src/ui/interviews/InterviewUploadClient.tsx): `src/ui/interviews/InterviewUploadClient.tsx`
- [Interview pipeline](https://github.com/jeremykamber/kynd/blob/main/src/ui/hooks/useInterviewPipeline.ts): `src/ui/hooks/useInterviewPipeline.ts`
- [Analysis actions](https://github.com/jeremykamber/kynd/blob/main/src/actions/analyzeArtifactAction.ts): `src/actions/analyzeArtifactAction.ts`
- [Interview action](https://github.com/jeremykamber/kynd/blob/main/src/actions/generatePersonasFromInterviews.ts): `src/actions/generatePersonasFromInterviews.ts`

### Testing workflows

- [Analysis API](https://github.com/jeremykamber/kynd/blob/main/src/app/api/vps/analyze/route.ts): `src/app/api/vps/analyze/route.ts`
- [Report API](https://github.com/jeremykamber/kynd/blob/main/src/app/api/report/route.ts): `src/app/api/report/route.ts`
- [Interview API](https://github.com/jeremykamber/kynd/blob/main/src/app/api/vps/generate-personas-from-interviews/route.ts): `src/app/api/vps/generate-personas-from-interviews/route.ts`
- [Artifact analysis](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/AnalyzeArtifactUseCase.ts): `src/application/usecases/AnalyzeArtifactUseCase.ts`
- [Interview persona generation](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/GeneratePersonasFromInterviewsUseCase.ts): `src/application/usecases/GeneratePersonasFromInterviewsUseCase.ts`
- [Persona generation](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/GeneratePersonasUseCase.ts): `src/application/usecases/GeneratePersonasUseCase.ts`
- [Persona chat](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/ChatWithPersonaUseCase.ts): `src/application/usecases/ChatWithPersonaUseCase.ts`
- [Persona debate](https://github.com/jeremykamber/kynd/blob/main/src/application/usecases/DebateUseCase.ts): `src/application/usecases/DebateUseCase.ts`

### AI and domain

- [Analysis results](https://github.com/jeremykamber/kynd/blob/main/src/domain/entities/ArtifactAnalysis.ts): `src/domain/entities/ArtifactAnalysis.ts`
- [Persona model](https://github.com/jeremykamber/kynd/blob/main/src/domain/entities/Persona.ts): `src/domain/entities/Persona.ts`
- [LLM service](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/LlmServiceImpl.ts): `src/infrastructure/adapters/LlmServiceImpl.ts`
- [Artifact intake](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/ArtifactIntakeAdapter.ts): `src/infrastructure/adapters/ArtifactIntakeAdapter.ts`
- [Persona retrieval](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/IdRagService.ts): `src/infrastructure/adapters/IdRagService.ts`

### Runtime services

- [Remote browser](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/adapters/RemotePlaywrightAdapter.ts): `src/infrastructure/adapters/RemotePlaywrightAdapter.ts`
- [Run results](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/AnalysisResultStore.ts): `src/infrastructure/AnalysisResultStore.ts`
- [Persona results](https://github.com/jeremykamber/kynd/blob/main/src/infrastructure/PersonaGenerationStore.ts): `src/infrastructure/PersonaGenerationStore.ts`

### Other components

- **User**
- **OpenRouter**
- **Website or app**

## Connections

- User → Dashboard: uses
- User → Interview upload: uploads transcripts
- Interview upload → Interview pipeline: submits files
- Interview pipeline → Interview action: starts generation
- Analysis actions → Analysis API: requests analysis
- Interview action → Interview API: submits transcripts
- Analysis API → Artifact analysis: executes
- Report API → Artifact analysis: executes
- Interview API → Interview persona generation: executes
- Interview API → Persona generation: provides generator
- Artifact analysis → Artifact intake: uses intake
- Artifact analysis → LLM service: analyzes artifacts
- Artifact intake → Remote browser: loads pages
- Artifact intake → LLM service: summarizes content
- Remote browser → Website or app: visits
- Analysis API → Run results: stores results
- Interview API → Persona results: stores personas
- Interview persona generation → LLM service: extracts signals
- Interview persona generation → Persona generation: generates personas
- Interview persona generation → Persona retrieval: indexes personas
- Persona generation → LLM service: creates personas
- Persona chat → LLM service: generates replies
- Persona chat → Persona retrieval: retrieves context
- Persona debate → LLM service: runs debate
- LLM service → OpenRouter: sends prompts
