# prarabdha7/gcici26 architecture

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

- Interactive diagram: https://gitdiagram.com/prarabdha7/gcici26
- Repository: https://github.com/prarabdha7/gcici26

## Overview

JA Assure is a multi-agent marketing and compliance system for three insurance brands. Its primary workflow accepts a campaign request, orchestrates research, drafting and compliance checks, generates media, and persists content for human review; approved content is then published by a scheduled worker. The README also describes B2B lead generation, competitive intelligence, memory, and an Obsidian knowledge vault. Relationships below rely on the supplied excerpts, SOURCE INDEX references, and README; unsampled implementation details are not inferred.

Main entry points: [`app/graph/nodes.py`](https://github.com/prarabdha7/gcici26/blob/main/app/graph/nodes.py) (Workflow Nodes), [`app/api/actions.py`](https://github.com/prarabdha7/gcici26/blob/main/app/api/actions.py) (Action API), [`app/db/database.py`](https://github.com/prarabdha7/gcici26/blob/main/app/db/database.py) (SQL Database), [`app/llm/client.py`](https://github.com/prarabdha7/gcici26/blob/main/app/llm/client.py) (LLM Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["API and Review"]
  node_api["Action API<br/>[actions.py]"]
  node_rest["REST Views<br/>[routes.py]"]
  node_dashboard["Review Dashboard<br/>[dashboard.py]"]
end

subgraph group_marketing["Marketing Workflow"]
  node_workflow{{"Marketing Graph<br/>[graph.py]"}}
  node_nodes["Workflow Nodes<br/>[nodes.py]"]
  node_state["Run State<br/>[state.py]"]
  node_compliance["Compliance Fallback<br/>[fallback.py]"]
  node_brand["Brand Knowledge<br/>[brand_knowledge.py]"]
end

subgraph group_intelligence["Research and Leads"]
  node_leadflow{{"Lead Generation<br/>[lead_gen_graph.py]"}}
  node_leadagents["Lead Agents<br/>[leads.py]"]
  node_research["Market Research<br/>[research.py]"]
  node_researchutil["Web Research<br/>[research.py]"]
  node_providers["Search Providers<br/>[providers.py]"]
  node_intelworker["Intel Worker<br/>[intel.py]"]
end

subgraph group_generation["Models and Media"]
  node_llm["LLM Client<br/>[client.py]"]
  node_media["Media Assembly<br/>[assembly.py]"]
  node_images["Image Generation<br/>[image_gen.py]"]
  node_stock["Stock Video<br/>[stock_video.py]"]
end

subgraph group_operations["Memory and Publishing"]
  node_db[("SQL Database<br/>[database.py]")]
  node_models["Content and Lead Records<br/>[models.py]"]
  node_memory[("Feedback Memory<br/>[store.py]")]
  node_retrieval["Memory Retrieval<br/>[retrieval.py]"]
  node_obsidian["Obsidian Vault<br/>[obsidian.py]"]
  node_scheduler["Publish Scheduler<br/>[scheduler.py]"]
  node_publisher["Social Publisher<br/>[publisher.py]"]
end

node_marketer(("Marketing User"))
node_llmservice(("Model Providers"))
node_social(("Social Platforms"))

node_marketer -->|"submits requests"| node_api
node_api -->|"runs graph"| node_workflow
node_workflow -->|"dispatches steps"| node_nodes
node_workflow -->|"uses state"| node_state
node_nodes -->|"generates copy"| node_llm
node_nodes -->|"uses fallback"| node_compliance
node_nodes -->|"retrieves guidance"| node_retrieval
node_nodes -->|"assembles media"| node_media
node_nodes -->|"generates images"| node_images
node_nodes -->|"persists queue"| node_db
node_nodes -->|"uses brand rules"| node_brand
node_api -->|"serves image actions"| node_images
node_api -->|"serves media actions"| node_media
node_api -->|"uses vault"| node_obsidian
node_api -->|"reads and writes"| node_db
node_api -->|"records feedback"| node_memory
node_rest -->|"queries records"| node_db
node_dashboard -->|"uses graph"| node_workflow
node_dashboard -->|"reads records"| node_db
node_leadflow -->|"dispatches discovery"| node_leadagents
node_leadflow -->|"dispatches research"| node_research
node_research -->|"fetches context"| node_researchutil
node_research -->|"summarizes findings"| node_llm
node_leadagents -->|"discovers prospects"| node_providers
node_leadagents -->|"stores leads"| node_db
node_researchutil -.->|"fallback search"| node_providers
node_intelworker -->|"runs research"| node_research
node_llm -->|"calls models"| node_llmservice
node_media -->|"requests generation"| node_llm
node_media -->|"selects footage"| node_stock
node_images -->|"requests synthesis"| node_llm
node_db -->|"maps tables"| node_models
node_retrieval -->|"reads feedback"| node_models
node_memory -->|"stores feedback"| node_models
node_scheduler -->|"dispatches approved"| node_publisher
node_scheduler -->|"schedules sweeps"| node_intelworker
node_scheduler -->|"polls queue"| node_db
node_publisher -->|"publishes posts"| node_social
node_social -->|"confirms webhook"| node_rest

click node_api "https://github.com/prarabdha7/gcici26/blob/main/app/api/actions.py"
click node_rest "https://github.com/prarabdha7/gcici26/blob/main/app/api/routes.py"
click node_dashboard "https://github.com/prarabdha7/gcici26/blob/main/app/api/dashboard.py"
click node_workflow "https://github.com/prarabdha7/gcici26/blob/main/app/graph/graph.py"
click node_nodes "https://github.com/prarabdha7/gcici26/blob/main/app/graph/nodes.py"
click node_state "https://github.com/prarabdha7/gcici26/blob/main/app/graph/state.py"
click node_compliance "https://github.com/prarabdha7/gcici26/blob/main/app/llm/fallback.py"
click node_leadflow "https://github.com/prarabdha7/gcici26/blob/main/app/graph/lead_gen_graph.py"
click node_leadagents "https://github.com/prarabdha7/gcici26/blob/main/app/agents/leads.py"
click node_research "https://github.com/prarabdha7/gcici26/blob/main/app/agents/research.py"
click node_researchutil "https://github.com/prarabdha7/gcici26/blob/main/app/utils/research.py"
click node_providers "https://github.com/prarabdha7/gcici26/blob/main/app/agents/providers.py"
click node_brand "https://github.com/prarabdha7/gcici26/blob/main/app/agents/brand_knowledge.py"
click node_llm "https://github.com/prarabdha7/gcici26/blob/main/app/llm/client.py"
click node_media "https://github.com/prarabdha7/gcici26/blob/main/app/media/assembly.py"
click node_images "https://github.com/prarabdha7/gcici26/blob/main/app/media/image_gen.py"
click node_stock "https://github.com/prarabdha7/gcici26/blob/main/app/media/stock_video.py"
click node_db "https://github.com/prarabdha7/gcici26/blob/main/app/db/database.py"
click node_models "https://github.com/prarabdha7/gcici26/blob/main/app/db/models.py"
click node_memory "https://github.com/prarabdha7/gcici26/blob/main/app/memory/store.py"
click node_retrieval "https://github.com/prarabdha7/gcici26/blob/main/app/memory/retrieval.py"
click node_obsidian "https://github.com/prarabdha7/gcici26/blob/main/app/integrations/obsidian.py"
click node_scheduler "https://github.com/prarabdha7/gcici26/blob/main/worker/scheduler.py"
click node_publisher "https://github.com/prarabdha7/gcici26/blob/main/worker/publisher.py"
click node_intelworker "https://github.com/prarabdha7/gcici26/blob/main/worker/intel.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_api,node_rest,node_dashboard,node_marketer toneBlue
class node_workflow,node_nodes,node_state,node_compliance,node_brand toneAmber
class node_leadflow,node_leadagents,node_research,node_researchutil,node_providers,node_intelworker toneMint
class node_llm,node_media,node_images,node_stock toneRose
class node_db,node_models,node_memory,node_retrieval,node_obsidian,node_scheduler,node_publisher,node_llmservice,node_social toneIndigo
```

## Components

### API and Review

- [Action API](https://github.com/prarabdha7/gcici26/blob/main/app/api/actions.py): `app/api/actions.py`
- [REST Views](https://github.com/prarabdha7/gcici26/blob/main/app/api/routes.py): `app/api/routes.py`
- [Review Dashboard](https://github.com/prarabdha7/gcici26/blob/main/app/api/dashboard.py): `app/api/dashboard.py`

### Marketing Workflow

- [Marketing Graph](https://github.com/prarabdha7/gcici26/blob/main/app/graph/graph.py): `app/graph/graph.py`
- [Workflow Nodes](https://github.com/prarabdha7/gcici26/blob/main/app/graph/nodes.py): `app/graph/nodes.py`
- [Run State](https://github.com/prarabdha7/gcici26/blob/main/app/graph/state.py): `app/graph/state.py`
- [Compliance Fallback](https://github.com/prarabdha7/gcici26/blob/main/app/llm/fallback.py): `app/llm/fallback.py`
- [Brand Knowledge](https://github.com/prarabdha7/gcici26/blob/main/app/agents/brand_knowledge.py): `app/agents/brand_knowledge.py`

### Research and Leads

- [Lead Generation](https://github.com/prarabdha7/gcici26/blob/main/app/graph/lead_gen_graph.py): `app/graph/lead_gen_graph.py`
- [Lead Agents](https://github.com/prarabdha7/gcici26/blob/main/app/agents/leads.py): `app/agents/leads.py`
- [Market Research](https://github.com/prarabdha7/gcici26/blob/main/app/agents/research.py): `app/agents/research.py`
- [Web Research](https://github.com/prarabdha7/gcici26/blob/main/app/utils/research.py): `app/utils/research.py`
- [Search Providers](https://github.com/prarabdha7/gcici26/blob/main/app/agents/providers.py): `app/agents/providers.py`
- [Intel Worker](https://github.com/prarabdha7/gcici26/blob/main/worker/intel.py): `worker/intel.py`

### Models and Media

- [LLM Client](https://github.com/prarabdha7/gcici26/blob/main/app/llm/client.py): `app/llm/client.py`
- [Media Assembly](https://github.com/prarabdha7/gcici26/blob/main/app/media/assembly.py): `app/media/assembly.py`
- [Image Generation](https://github.com/prarabdha7/gcici26/blob/main/app/media/image_gen.py): `app/media/image_gen.py`
- [Stock Video](https://github.com/prarabdha7/gcici26/blob/main/app/media/stock_video.py): `app/media/stock_video.py`

### Memory and Publishing

- [SQL Database](https://github.com/prarabdha7/gcici26/blob/main/app/db/database.py): `app/db/database.py`
- [Content and Lead Records](https://github.com/prarabdha7/gcici26/blob/main/app/db/models.py): `app/db/models.py`
- [Feedback Memory](https://github.com/prarabdha7/gcici26/blob/main/app/memory/store.py): `app/memory/store.py`
- [Memory Retrieval](https://github.com/prarabdha7/gcici26/blob/main/app/memory/retrieval.py): `app/memory/retrieval.py`
- [Obsidian Vault](https://github.com/prarabdha7/gcici26/blob/main/app/integrations/obsidian.py): `app/integrations/obsidian.py`
- [Publish Scheduler](https://github.com/prarabdha7/gcici26/blob/main/worker/scheduler.py): `worker/scheduler.py`
- [Social Publisher](https://github.com/prarabdha7/gcici26/blob/main/worker/publisher.py): `worker/publisher.py`

### Other components

- **Marketing User**
- **Model Providers**
- **Social Platforms**

## Connections

- Marketing User → Action API: submits requests (evidence: `app/api/actions.py`)
- Action API → Marketing Graph: runs graph (evidence: `app/api/actions.py`)
- Marketing Graph → Workflow Nodes: dispatches steps (evidence: `app/graph/graph.py`)
- Marketing Graph → Run State: uses state (evidence: `app/graph/graph.py`)
- Workflow Nodes → LLM Client: generates copy (evidence: `app/graph/nodes.py`)
- Workflow Nodes → Compliance Fallback: uses fallback (evidence: `app/graph/nodes.py`)
- Workflow Nodes → Memory Retrieval: retrieves guidance (evidence: `app/graph/nodes.py`)
- Workflow Nodes → Media Assembly: assembles media (evidence: `app/graph/nodes.py`)
- Workflow Nodes → Image Generation: generates images (evidence: `app/graph/nodes.py`)
- Workflow Nodes → SQL Database: persists queue (evidence: `app/graph/nodes.py`)
- Workflow Nodes → Brand Knowledge: uses brand rules
- Action API → Image Generation: serves image actions (evidence: `app/api/actions.py`)
- Action API → Media Assembly: serves media actions (evidence: `app/api/actions.py`)
- Action API → Obsidian Vault: uses vault (evidence: `app/api/actions.py`)
- Action API → SQL Database: reads and writes (evidence: `app/api/actions.py`)
- Action API → Feedback Memory: records feedback (evidence: `app/api/actions.py`)
- REST Views → SQL Database: queries records (evidence: `app/api/routes.py`)
- Review Dashboard → Marketing Graph: uses graph (evidence: `app/api/dashboard.py`)
- Review Dashboard → SQL Database: reads records (evidence: `app/api/dashboard.py`)
- Lead Generation → Lead Agents: dispatches discovery (evidence: `app/graph/lead_gen_graph.py`)
- Lead Generation → Market Research: dispatches research (evidence: `app/graph/lead_gen_graph.py`)
- Market Research → Web Research: fetches context (evidence: `app/agents/research.py`)
- Market Research → LLM Client: summarizes findings (evidence: `app/agents/research.py`)
- Lead Agents → Search Providers: discovers prospects (evidence: `app/agents/leads.py`)
- Lead Agents → SQL Database: stores leads (evidence: `app/agents/leads.py`)
- Web Research → Search Providers: fallback search
- Intel Worker → Market Research: runs research (evidence: `worker/intel.py`)
- LLM Client → Model Providers: calls models (evidence: `app/llm/client.py`)
- Media Assembly → LLM Client: requests generation (evidence: `app/media/assembly.py`)
- Media Assembly → Stock Video: selects footage (evidence: `app/media/assembly.py`)
- Image Generation → LLM Client: requests synthesis (evidence: `app/media/image_gen.py`)
- SQL Database → Content and Lead Records: maps tables (evidence: `app/db/database.py`)
- Memory Retrieval → Content and Lead Records: reads feedback (evidence: `app/memory/retrieval.py`)
- Feedback Memory → Content and Lead Records: stores feedback (evidence: `app/memory/store.py`)
- Publish Scheduler → Social Publisher: dispatches approved (evidence: `worker/scheduler.py`)
- Publish Scheduler → Intel Worker: schedules sweeps (evidence: `worker/scheduler.py`)
- Publish Scheduler → SQL Database: polls queue (evidence: `worker/scheduler.py`)
- Social Publisher → Social Platforms: publishes posts (evidence: `worker/publisher.py`)
- Social Platforms → REST Views: confirms webhook (evidence: `app/api/routes.py`)
