# vishnuvardhangadukota-hub/synthetic-user-generation-platform architecture

> Architecture diagram of the GitHub repository vishnuvardhangadukota-hub/synthetic-user-generation-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform
- Repository: https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform

## Overview

This is a FastAPI platform for product research with synthetic personas: researchers configure experiments, generate personas, run surveys and interviews, then produce qualitative insights and adoption scores. Routes expose those workflows; services coordinate agents, memory, and persistence. Durable research state is managed through SQLAlchemy, while persona memory supports consistent interview turns. The README documents all major capabilities, including scoring and fallback LLM providers; those branches are represented, though some implementations were not excerpted, so uncertain links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/database/database.py`](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/database/database.py) (SQL database), [`backend/app/services/llm_service.py`](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/llm_service.py) (LLM providers and fallback), [`backend/app/api/routes/experiments.py`](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/experiments.py) (Experiment routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_experiment_routes["Experiment routes<br/>[experiments.py]"]
  node_persona_routes["Persona routes<br/>[personas.py]"]
  node_conversation_routes["Interview routes<br/>[conversations.py]"]
  node_survey_routes["Survey routes<br/>[surveys.py]"]
  node_insight_routes["Insight routes<br/>[insights.py]"]
  node_analytics_routes["Usage score routes<br/>[analytics.py]"]
end

subgraph group_research["Research Workflows"]
  node_experiment_service["Experiment workspace"]
  node_survey_service["Survey execution<br/>[survey_service.py]"]
  node_insight_service["Insight synthesis<br/>[insight_service.py]"]
  node_usage_service["Product usage scoring"]
end

subgraph group_persona["Persona Simulation"]
  node_persona_agent["Persona generation"]
  node_persona_service["Persona management<br/>[persona_service.py]"]
  node_consistency["Interview consistency"]
  node_memory_manager["Persona memory<br/>[persona_memory.py]"]
end

subgraph group_state["Memory and Persistence"]
  node_memory_service["Memory storage<br/>[memory_service.py]"]
  node_database[("SQL database<br/>[database.py]")]
  node_models[("Research records")]
end

subgraph group_intelligence["Analysis and LLM"]
  node_insight_agent["Insight extraction"]
  node_llm["LLM providers and fallback<br/>[llm_service.py]"]
  node_prompts["Research prompts<br/>[prompts.py]"]
end

node_researcher(("Researcher"))
node_llm_provider{{"LLM provider"}}

node_researcher -->|"uses API"| node_fastapi
node_fastapi -->|"registers routes"| node_experiment_routes
node_fastapi -->|"registers routes"| node_persona_routes
node_fastapi -->|"registers routes"| node_conversation_routes
node_fastapi -->|"registers routes"| node_survey_routes
node_fastapi -->|"registers routes"| node_insight_routes
node_fastapi -->|"registers routes"| node_analytics_routes
node_experiment_routes -->|"manages experiments"| node_experiment_service
node_experiment_routes -->|"generates personas"| node_persona_agent
node_experiment_routes -->|"saves personas"| node_persona_service
node_persona_routes -->|"manages personas"| node_persona_service
node_persona_routes -->|"reads memory"| node_memory_service
node_conversation_routes -.->|"handles turns"| node_consistency
node_survey_routes -->|"runs surveys"| node_survey_service
node_insight_routes -->|"requests insights"| node_insight_service
node_analytics_routes -.->|"requests scores"| node_usage_service
node_survey_service -->|"uses persona context"| node_memory_manager
node_survey_service -->|"generates responses"| node_llm
node_consistency -->|"loads and updates memory"| node_memory_manager
node_consistency -->|"stores interview turns"| node_memory_service
node_consistency -->|"generates interview replies"| node_llm
node_memory_manager -->|"reads and stores memories"| node_memory_service
node_insight_service -->|"loads experiment"| node_experiment_service
node_insight_service -->|"extracts themes"| node_insight_agent
node_insight_agent -->|"analyzes responses"| node_llm
node_usage_service -->|"evaluates adoption"| node_llm
node_persona_agent -->|"generates personas"| node_llm
node_persona_agent -->|"uses templates"| node_prompts
node_insight_agent -->|"uses templates"| node_prompts
node_llm -.->|"calls provider"| node_llm_provider
node_experiment_service -.->|"uses session"| node_database
node_persona_service -.->|"uses session"| node_database
node_survey_service -.->|"uses session"| node_database
node_insight_service -.->|"uses session"| node_database
node_usage_service -.->|"uses session"| node_database
node_memory_service -.->|"uses session"| node_database
node_database -->|"maps records"| node_models

click node_fastapi "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/main.py"
click node_experiment_routes "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/experiments.py"
click node_persona_routes "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/personas.py"
click node_conversation_routes "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/conversations.py"
click node_survey_routes "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/surveys.py"
click node_insight_routes "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/insights.py"
click node_analytics_routes "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/analytics.py"
click node_experiment_service "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/experiment_service.py"
click node_persona_agent "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/agents/persona_generation_agent.py"
click node_persona_service "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/persona_service.py"
click node_survey_service "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/survey_service.py"
click node_consistency "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/memory/consistency_manager.py"
click node_memory_manager "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/memory/persona_memory.py"
click node_memory_service "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/memory_service.py"
click node_insight_service "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/insight_service.py"
click node_insight_agent "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/agents/insight_extraction_agent.py"
click node_usage_service "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/usage_score_service.py"
click node_llm "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/llm_service.py"
click node_prompts "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/utils/prompts.py"
click node_database "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/database/database.py"
click node_models "https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/tree/main/backend/app/models"

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_fastapi,node_experiment_routes,node_persona_routes,node_conversation_routes,node_survey_routes,node_insight_routes,node_analytics_routes toneBlue
class node_experiment_service,node_survey_service,node_insight_service,node_usage_service toneAmber
class node_persona_agent,node_persona_service,node_consistency,node_memory_manager toneMint
class node_memory_service,node_database,node_models toneRose
class node_insight_agent,node_llm,node_prompts,node_researcher,node_llm_provider toneIndigo
```

## Components

### REST API

- [FastAPI app](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/main.py): `backend/app/main.py`
- [Experiment routes](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/experiments.py): `backend/app/api/routes/experiments.py`
- [Persona routes](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/personas.py): `backend/app/api/routes/personas.py`
- [Interview routes](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/conversations.py): `backend/app/api/routes/conversations.py`
- [Survey routes](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/surveys.py): `backend/app/api/routes/surveys.py`
- [Insight routes](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/insights.py): `backend/app/api/routes/insights.py`
- [Usage score routes](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/api/routes/analytics.py): `backend/app/api/routes/analytics.py`

### Research Workflows

- [Experiment workspace](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/experiment_service.py): `backend/app/services/experiment_service.py`
- [Survey execution](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/survey_service.py): `backend/app/services/survey_service.py`
- [Insight synthesis](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/insight_service.py): `backend/app/services/insight_service.py`
- [Product usage scoring](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/usage_score_service.py): `backend/app/services/usage_score_service.py`

### Persona Simulation

- [Persona generation](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/agents/persona_generation_agent.py): `backend/app/agents/persona_generation_agent.py`
- [Persona management](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/persona_service.py): `backend/app/services/persona_service.py`
- [Interview consistency](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/memory/consistency_manager.py): `backend/app/memory/consistency_manager.py`
- [Persona memory](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/memory/persona_memory.py): `backend/app/memory/persona_memory.py`

### Memory and Persistence

- [Memory storage](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/memory_service.py): `backend/app/services/memory_service.py`
- [SQL database](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/database/database.py): `backend/app/database/database.py`
- [Research records](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/tree/main/backend/app/models): `backend/app/models`

### Analysis and LLM

- [Insight extraction](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/agents/insight_extraction_agent.py): `backend/app/agents/insight_extraction_agent.py`
- [LLM providers and fallback](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/services/llm_service.py): `backend/app/services/llm_service.py`
- [Research prompts](https://github.com/vishnuvardhangadukota-hub/synthetic-user-generation-platform/blob/main/backend/app/utils/prompts.py): `backend/app/utils/prompts.py`

### Other components

- **Researcher**
- **LLM provider**

## Connections

- Researcher → FastAPI app: uses API
- FastAPI app → Experiment routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Persona routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Interview routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Survey routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Insight routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Usage score routes: registers routes (evidence: `backend/app/main.py`)
- Experiment routes → Experiment workspace: manages experiments (evidence: `backend/app/api/routes/experiments.py`)
- Experiment routes → Persona generation: generates personas (evidence: `backend/app/api/routes/experiments.py`)
- Experiment routes → Persona management: saves personas (evidence: `backend/app/api/routes/experiments.py`)
- Persona routes → Persona management: manages personas (evidence: `backend/app/api/routes/personas.py`)
- Persona routes → Memory storage: reads memory (evidence: `backend/app/api/routes/personas.py`)
- Interview routes → Interview consistency: handles turns (evidence: `backend/app/api/routes/conversations.py`)
- Survey routes → Survey execution: runs surveys (evidence: `backend/app/api/routes/surveys.py`)
- Insight routes → Insight synthesis: requests insights (evidence: `backend/app/api/routes/insights.py`)
- Usage score routes → Product usage scoring: requests scores
- Survey execution → Persona memory: uses persona context (evidence: `backend/app/services/survey_service.py`)
- Survey execution → LLM providers and fallback: generates responses (evidence: `backend/app/services/survey_service.py`)
- Interview consistency → Persona memory: loads and updates memory (evidence: `backend/app/memory/consistency_manager.py`)
- Interview consistency → Memory storage: stores interview turns (evidence: `backend/app/memory/consistency_manager.py`)
- Interview consistency → LLM providers and fallback: generates interview replies (evidence: `backend/app/memory/consistency_manager.py`)
- Persona memory → Memory storage: reads and stores memories (evidence: `backend/app/memory/persona_memory.py`)
- Insight synthesis → Experiment workspace: loads experiment (evidence: `backend/app/services/insight_service.py`)
- Insight synthesis → Insight extraction: extracts themes (evidence: `backend/app/services/insight_service.py`)
- Insight extraction → LLM providers and fallback: analyzes responses (evidence: `backend/app/agents/insight_extraction_agent.py`)
- Product usage scoring → LLM providers and fallback: evaluates adoption (evidence: `backend/app/services/usage_score_service.py`)
- Persona generation → LLM providers and fallback: generates personas (evidence: `backend/app/agents/persona_generation_agent.py`)
- Persona generation → Research prompts: uses templates (evidence: `backend/app/agents/persona_generation_agent.py`)
- Insight extraction → Research prompts: uses templates (evidence: `backend/app/agents/insight_extraction_agent.py`)
- LLM providers and fallback → LLM provider: calls provider
- Experiment workspace → SQL database: uses session
- Persona management → SQL database: uses session
- Survey execution → SQL database: uses session
- Insight synthesis → SQL database: uses session
- Product usage scoring → SQL database: uses session
- Memory storage → SQL database: uses session
- SQL database → Research records: maps records (evidence: `backend/app/models/persona.py`)
