# codenama-007/app-saturation- architecture

> Architecture diagram of the GitHub repository codenama-007/app-saturation-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codenama-007/app-saturation-
- Repository: https://github.com/codenama-007/app-saturation-

## Overview

This repository implements an idea-market research and validation workflow: an idea is checked against cached analyses, turned into search queries, researched, compared with retrieved products, scored, and used to suggest evidence-based differentiators. LangGraph coordinates the stages; deterministic evidence checks and scoring constrain LLM output. The map also includes the persistent cache and external model/search boundaries. README content was empty, and several files were available only through the source index, so uncertain links are omitted or marked dashed.

Main entry points: [`graph.py`](https://github.com/codenama-007/app-saturation-/blob/main/graph.py) (Workflow graph), [`analysis.py`](https://github.com/codenama-007/app-saturation-/blob/main/analysis.py) (Competitor verification), [`llm.py`](https://github.com/codenama-007/app-saturation-/blob/main/llm.py) (LLM client), [`evidence.py`](https://github.com/codenama-007/app-saturation-/blob/main/evidence.py) (Evidence helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["Application entry<br/>[main.py]"]
end

subgraph group_workflow["Research workflow"]
  node_orchestrator["Workflow graph<br/>[graph.py]"]
  node_cache_gate["Cache check<br/>[cache.py]"]
  node_query["Query generation<br/>[research.py]"]
  node_search["Product search<br/>[research.py]"]
  node_comparison["Product comparison<br/>[research.py]"]
end

subgraph group_analysis["Analysis and scoring"]
  node_evidence["Evidence helpers<br/>[evidence.py]"]
  node_prompts["LLM prompts<br/>[prompts.py]"]
  node_llm["LLM client<br/>[llm.py]"]
  node_competitor_scoring["Competitor verification<br/>[analysis.py]"]
  node_scoring["Opportunity scoring<br/>[scoring.py]"]
  node_features["Feature suggestions<br/>[analysis.py]"]
end

subgraph group_support["State and persistence"]
  node_state["Workflow state<br/>[models.py]"]
  node_cache["Cache coordination<br/>[cache.py]"]
  node_memory[("Idea memory<br/>[memory.py]")]
end

node_user(("Idea submitter"))
node_search_provider["Search provider"]
node_model_provider["Groq model service"]

node_user -.->|"submits idea"| node_app
node_app -->|"invokes"| node_orchestrator
node_orchestrator -->|"uses state"| node_state
node_orchestrator -->|"dispatches"| node_cache_gate
node_orchestrator -->|"dispatches"| node_query
node_orchestrator -->|"dispatches"| node_search
node_orchestrator -->|"dispatches"| node_comparison
node_orchestrator -->|"dispatches"| node_competitor_scoring
node_orchestrator -->|"dispatches"| node_features
node_orchestrator -->|"dispatches"| node_cache
node_cache_gate -->|"looks up"| node_memory
node_cache -->|"saves idea"| node_memory
node_query -->|"formats prompt"| node_prompts
node_query -->|"requests query"| node_llm
node_query -->|"cleans query"| node_evidence
node_search -->|"filters results"| node_evidence
node_search -.->|"requests search"| node_search_provider
node_comparison -->|"formats evidence"| node_evidence
node_comparison -->|"formats prompt"| node_prompts
node_comparison -->|"requests analysis"| node_llm
node_llm -->|"calls model"| node_model_provider
node_competitor_scoring -->|"verifies names"| node_evidence
node_competitor_scoring -->|"formats prompt"| node_prompts
node_competitor_scoring -->|"extracts competitors"| node_llm
node_competitor_scoring -->|"calculates scores"| node_scoring
node_features -->|"formats evidence"| node_evidence
node_features -->|"formats prompt"| node_prompts
node_features -->|"generates suggestions"| node_llm

click node_app "https://github.com/codenama-007/app-saturation-/blob/main/main.py"
click node_orchestrator "https://github.com/codenama-007/app-saturation-/blob/main/graph.py"
click node_state "https://github.com/codenama-007/app-saturation-/blob/main/models.py"
click node_cache_gate "https://github.com/codenama-007/app-saturation-/blob/main/cache.py"
click node_query "https://github.com/codenama-007/app-saturation-/blob/main/research.py"
click node_search "https://github.com/codenama-007/app-saturation-/blob/main/research.py"
click node_comparison "https://github.com/codenama-007/app-saturation-/blob/main/research.py"
click node_evidence "https://github.com/codenama-007/app-saturation-/blob/main/evidence.py"
click node_prompts "https://github.com/codenama-007/app-saturation-/blob/main/prompts.py"
click node_llm "https://github.com/codenama-007/app-saturation-/blob/main/llm.py"
click node_competitor_scoring "https://github.com/codenama-007/app-saturation-/blob/main/analysis.py"
click node_scoring "https://github.com/codenama-007/app-saturation-/blob/main/scoring.py"
click node_features "https://github.com/codenama-007/app-saturation-/blob/main/analysis.py"
click node_cache "https://github.com/codenama-007/app-saturation-/blob/main/cache.py"
click node_memory "https://github.com/codenama-007/app-saturation-/blob/main/memory.py"

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_app toneBlue
class node_orchestrator,node_cache_gate,node_query,node_search,node_comparison toneAmber
class node_evidence,node_prompts,node_llm,node_competitor_scoring,node_scoring,node_features toneMint
class node_state,node_cache,node_memory toneRose
class node_user,node_search_provider,node_model_provider toneIndigo
```

## Components

### Application entry

- [Application entry](https://github.com/codenama-007/app-saturation-/blob/main/main.py): `main.py`

### Research workflow

- [Workflow graph](https://github.com/codenama-007/app-saturation-/blob/main/graph.py): `graph.py`
- [Cache check](https://github.com/codenama-007/app-saturation-/blob/main/cache.py): `cache.py`
- [Query generation](https://github.com/codenama-007/app-saturation-/blob/main/research.py): `research.py`
- [Product search](https://github.com/codenama-007/app-saturation-/blob/main/research.py): `research.py`
- [Product comparison](https://github.com/codenama-007/app-saturation-/blob/main/research.py): `research.py`

### Analysis and scoring

- [Evidence helpers](https://github.com/codenama-007/app-saturation-/blob/main/evidence.py): `evidence.py`
- [LLM prompts](https://github.com/codenama-007/app-saturation-/blob/main/prompts.py): `prompts.py`
- [LLM client](https://github.com/codenama-007/app-saturation-/blob/main/llm.py): `llm.py`
- [Competitor verification](https://github.com/codenama-007/app-saturation-/blob/main/analysis.py): `analysis.py`
- [Opportunity scoring](https://github.com/codenama-007/app-saturation-/blob/main/scoring.py): `scoring.py`
- [Feature suggestions](https://github.com/codenama-007/app-saturation-/blob/main/analysis.py): `analysis.py`

### State and persistence

- [Workflow state](https://github.com/codenama-007/app-saturation-/blob/main/models.py): `models.py`
- [Cache coordination](https://github.com/codenama-007/app-saturation-/blob/main/cache.py): `cache.py`
- [Idea memory](https://github.com/codenama-007/app-saturation-/blob/main/memory.py): `memory.py`

### Other components

- **Idea submitter**
- **Search provider**
- **Groq model service**

## Connections

- Idea submitter → Application entry: submits idea
- Application entry → Workflow graph: invokes (evidence: `main.py`)
- Workflow graph → Workflow state: uses state (evidence: `graph.py`)
- Workflow graph → Cache check: dispatches (evidence: `graph.py`)
- Workflow graph → Query generation: dispatches (evidence: `graph.py`)
- Workflow graph → Product search: dispatches (evidence: `graph.py`)
- Workflow graph → Product comparison: dispatches (evidence: `graph.py`)
- Workflow graph → Competitor verification: dispatches (evidence: `graph.py`)
- Workflow graph → Feature suggestions: dispatches (evidence: `graph.py`)
- Workflow graph → Cache coordination: dispatches (evidence: `graph.py`)
- Cache check → Idea memory: looks up (evidence: `cache.py`)
- Cache coordination → Idea memory: saves idea (evidence: `cache.py`)
- Query generation → LLM prompts: formats prompt (evidence: `research.py`)
- Query generation → LLM client: requests query (evidence: `research.py`)
- Query generation → Evidence helpers: cleans query (evidence: `research.py`)
- Product search → Evidence helpers: filters results (evidence: `research.py`)
- Product search → Search provider: requests search
- Product comparison → Evidence helpers: formats evidence (evidence: `research.py`)
- Product comparison → LLM prompts: formats prompt (evidence: `research.py`)
- Product comparison → LLM client: requests analysis (evidence: `research.py`)
- LLM client → Groq model service: calls model (evidence: `llm.py`)
- Competitor verification → Evidence helpers: verifies names (evidence: `analysis.py`)
- Competitor verification → LLM prompts: formats prompt (evidence: `analysis.py`)
- Competitor verification → LLM client: extracts competitors (evidence: `analysis.py`)
- Competitor verification → Opportunity scoring: calculates scores (evidence: `analysis.py`)
- Feature suggestions → Evidence helpers: formats evidence (evidence: `analysis.py`)
- Feature suggestions → LLM prompts: formats prompt (evidence: `analysis.py`)
- Feature suggestions → LLM client: generates suggestions (evidence: `analysis.py`)
