# fakhahmed/agentic-finance-gcp architecture

> Architecture diagram of the GitHub repository fakhahmed/agentic-finance-gcp, 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/fakhahmed/agentic-finance-gcp
- Repository: https://github.com/fakhahmed/agentic-finance-gcp

## Overview

L’application Streamlit reçoit une question, la transmet au graphe d’agents financiers et affiche la réponse de l’expert choisi. Le graphe applique d’abord un garde-fou, puis route vers les agents SQL, RAG, marchés ou conversationnel. Les extraits montrent les appels SQL, RAG et marchés ainsi que le routage, mais pas les détails de compilation, de streaming ni de persistance du graphe. Les intégrations LangSmith et BigQuery décrites dans le README ne sont pas toutes visibles dans le code échantillonné.

Main entry points: [`agent/main.py`](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py) (Superviseur), [`agent/rag_tool.py`](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/rag_tool.py) (Préparation RAG), [`app/app.py`](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/app/app.py) (Interface Streamlit), [`data/rapport_financier.pdf`](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/data/rapport_financier.pdf) (Rapport financier PDF)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interface"]
  node_ui["Interface Streamlit<br/>[app.py]"]
end

subgraph group_orchestration["Orchestration"]
  node_guardrail["Garde-fou IA<br/>[main.py]"]
  node_supervisor["Superviseur<br/>[main.py]"]
  node_agent_graph["Graphe LangGraph<br/>[main.py]"]
  node_memory[("Mémoire conversationnelle<br/>[main.py]")]
end

subgraph group_expertise["Agents experts"]
  node_sql_agent["Agent SQL<br/>[main.py]"]
  node_rag_agent["Agent RAG<br/>[main.py]"]
  node_conversation_agent["Agent conversationnel<br/>[main.py]"]
  node_market_agent["Agent marchés<br/>[main.py]"]
  node_rag_setup["Préparation RAG<br/>[rag_tool.py]"]
end

subgraph group_sources["Données et services"]
  node_financial_pdf["Rapport financier PDF"]
  node_chroma[("Index Chroma temporaire<br/>[rag_tool.py]")]
  node_vertex["Google Vertex AI"]
  node_bigquery[("BigQuery")]
  node_yahoo["Yahoo Finance"]
  node_langsmith["LangSmith"]
end

node_user(("Analyste financier"))

node_user -->|"pose une question"| node_ui
node_ui -->|"transmet la question"| node_agent_graph
node_agent_graph -->|"fournit le flux"| node_ui
node_agent_graph -->|"exécute d’abord"| node_guardrail
node_guardrail -->|"autorise et route"| node_supervisor
node_supervisor -->|"route vers SQL"| node_sql_agent
node_supervisor -->|"route vers RAG"| node_rag_agent
node_supervisor -->|"route vers dialogue"| node_conversation_agent
node_supervisor -->|"route vers marchés"| node_market_agent
node_sql_agent -->|"interroge"| node_bigquery
node_sql_agent -->|"génère et reformule"| node_vertex
node_rag_agent -->|"obtient le récupérateur"| node_rag_setup
node_rag_setup -->|"charge et découpe"| node_financial_pdf
node_rag_setup -->|"vectorise"| node_vertex
node_rag_setup -->|"alimente l’index"| node_chroma
node_rag_agent -->|"recherche des extraits"| node_chroma
node_rag_agent -->|"synthétise la réponse"| node_vertex
node_market_agent -->|"extrait le ticker"| node_vertex
node_market_agent -->|"récupère les cours"| node_yahoo
node_conversation_agent -->|"génère une réponse"| node_vertex
node_agent_graph -.->|"utilise un checkpoint"| node_memory
node_agent_graph -.->|"trace les échanges"| node_langsmith

click node_ui "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/app/app.py"
click node_guardrail "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_supervisor "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_agent_graph "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_memory "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_sql_agent "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_rag_agent "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_conversation_agent "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_market_agent "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py"
click node_rag_setup "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/rag_tool.py"
click node_financial_pdf "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/data/rapport_financier.pdf"
click node_chroma "https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/rag_tool.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_ui toneBlue
class node_guardrail,node_supervisor,node_agent_graph,node_memory toneAmber
class node_sql_agent,node_rag_agent,node_conversation_agent,node_market_agent,node_rag_setup toneMint
class node_financial_pdf,node_chroma,node_vertex,node_bigquery,node_yahoo,node_langsmith toneRose
class node_user toneIndigo
```

## Components

### Interface

- [Interface Streamlit](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/app/app.py): `app/app.py`

### Orchestration

- [Garde-fou IA](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Superviseur](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Graphe LangGraph](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Mémoire conversationnelle](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`

### Agents experts

- [Agent SQL](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Agent RAG](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Agent conversationnel](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Agent marchés](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/main.py): `agent/main.py`
- [Préparation RAG](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/rag_tool.py): `agent/rag_tool.py`

### Données et services

- [Rapport financier PDF](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/data/rapport_financier.pdf): `data/rapport_financier.pdf`
- [Index Chroma temporaire](https://github.com/fakhahmed/agentic-finance-gcp/blob/main/agent/rag_tool.py): `agent/rag_tool.py`
- **Google Vertex AI**
- **BigQuery**
- **Yahoo Finance**
- **LangSmith**

### Other components

- **Analyste financier**

## Connections

- Analyste financier → Interface Streamlit: pose une question (evidence: `app/app.py`)
- Interface Streamlit → Graphe LangGraph: transmet la question (evidence: `app/app.py`)
- Graphe LangGraph → Interface Streamlit: fournit le flux (evidence: `app/app.py`)
- Graphe LangGraph → Garde-fou IA: exécute d’abord (evidence: `agent/main.py`)
- Garde-fou IA → Superviseur: autorise et route (evidence: `agent/main.py`)
- Superviseur → Agent SQL: route vers SQL (evidence: `agent/main.py`)
- Superviseur → Agent RAG: route vers RAG (evidence: `agent/main.py`)
- Superviseur → Agent conversationnel: route vers dialogue (evidence: `agent/main.py`)
- Superviseur → Agent marchés: route vers marchés (evidence: `agent/main.py`)
- Agent SQL → BigQuery: interroge (evidence: `agent/main.py`)
- Agent SQL → Google Vertex AI: génère et reformule (evidence: `agent/main.py`)
- Agent RAG → Préparation RAG: obtient le récupérateur (evidence: `agent/main.py`)
- Préparation RAG → Rapport financier PDF: charge et découpe (evidence: `agent/rag_tool.py`)
- Préparation RAG → Google Vertex AI: vectorise (evidence: `agent/rag_tool.py`)
- Préparation RAG → Index Chroma temporaire: alimente l’index (evidence: `agent/rag_tool.py`)
- Agent RAG → Index Chroma temporaire: recherche des extraits (evidence: `agent/main.py`)
- Agent RAG → Google Vertex AI: synthétise la réponse (evidence: `agent/main.py`)
- Agent marchés → Google Vertex AI: extrait le ticker (evidence: `agent/main.py`)
- Agent marchés → Yahoo Finance: récupère les cours (evidence: `agent/main.py`)
- Agent conversationnel → Google Vertex AI: génère une réponse (evidence: `agent/main.py`)
- Graphe LangGraph → Mémoire conversationnelle: utilise un checkpoint (evidence: `agent/main.py`)
- Graphe LangGraph → LangSmith: trace les échanges (evidence: `README.md`)
