# corentin-tin/langgraph-agents-template architecture

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

- Interactive diagram: https://gitdiagram.com/corentin-tin/langgraph-agents-template
- Repository: https://github.com/corentin-tin/langgraph-agents-template

## Overview

This repository is a LangGraph agent-template product with a Chainlit interface. The main user workflow is selecting an agent, sending a message, and receiving its response; file-oriented agents also support document or data uploads. The graph preserves all five documented agent patterns and the shared prompt-loading layer. Source-index references and README statements support the shown relationships; unsampled integrations and utility wiring are omitted where their callers are not shown.

Main entry points: [`src/chainlit_app/agent_wrappers/base.py`](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/base.py) (Wrapper base), [`src/chainlit_app/agent_selector.py`](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_selector.py) (Agent selector), [`src/utils/prompt_loader.py`](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/prompt_loader.py) (Prompt loading), [`src/chainlit_app/app.py`](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/app.py) (Chat app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chainlit interface"]
  node_chainlit_app["Chat app<br/>[app.py]"]
  node_agent_selector["Agent selector<br/>[agent_selector.py]"]
  node_base_wrapper["Wrapper base<br/>[base.py]"]
  node_streaming["Response streaming<br/>[streaming_utils.py]"]
  node_react_wrapper["React wrapper"]
  node_retrieval_wrapper["Retrieval wrapper"]
  node_memory_wrapper["Memory wrapper"]
  node_enrichment_wrapper["Enrichment wrapper"]
  node_simple_wrapper["Simple wrapper"]
end

subgraph group_agents["Agent templates"]
  node_react_graph["React workflow<br/>[graph.py]"]
  node_retrieval_graph["Retrieval workflow<br/>[graph.py]"]
  node_memory_graph["Memory workflow<br/>[graph.py]"]
  node_enrichment_graph["Enrichment workflow<br/>[graph.py]"]
  node_simple_graph["Simple workflow<br/>[graph.py]"]
  node_react_nodes["Tool-calling logic<br/>[nodes.py]"]
  node_retrieval_nodes["RAG logic<br/>[nodes.py]"]
  node_memory_nodes["Memory logic<br/>[nodes.py]"]
  node_enrichment_nodes["Data processing logic<br/>[nodes.py]"]
  node_simple_nodes["Chat logic<br/>[nodes.py]"]
end

subgraph group_shared["Shared utilities"]
  node_prompt_loader["Prompt loading<br/>[prompt_loader.py]"]
  node_document_loading["Document loading"]
  node_data_store[("Database operations")]
  node_url_markdown["URL conversion<br/>[url_to_markdown.py]"]
end

subgraph group_integrations["External services"]
  node_retrieval_store[("Vector retrievers<br/>[retrieval.py]")]
end

node_user(("User"))

node_user -->|"sends message"| node_chainlit_app
node_chainlit_app -->|"offers profiles"| node_agent_selector
node_chainlit_app -->|"dispatches message"| node_base_wrapper
node_agent_selector -->|"selects agent"| node_react_wrapper
node_agent_selector -->|"selects agent"| node_retrieval_wrapper
node_agent_selector -->|"selects agent"| node_memory_wrapper
node_agent_selector -->|"selects agent"| node_enrichment_wrapper
node_agent_selector -->|"selects agent"| node_simple_wrapper
node_react_wrapper -->|"extends"| node_base_wrapper
node_retrieval_wrapper -->|"extends"| node_base_wrapper
node_memory_wrapper -->|"extends"| node_base_wrapper
node_enrichment_wrapper -->|"extends"| node_base_wrapper
node_base_wrapper -->|"loads graph"| node_react_graph
node_base_wrapper -->|"loads graph"| node_retrieval_graph
node_base_wrapper -->|"loads graph"| node_memory_graph
node_base_wrapper -->|"loads graph"| node_enrichment_graph
node_base_wrapper -->|"loads graph"| node_simple_graph
node_chainlit_app -->|"streams responses"| node_streaming
node_react_graph -->|"routes workflow"| node_react_nodes
node_retrieval_graph -->|"routes workflow"| node_retrieval_nodes
node_memory_graph -->|"routes workflow"| node_memory_nodes
node_enrichment_graph -->|"routes workflow"| node_enrichment_nodes
node_simple_graph -->|"routes workflow"| node_simple_nodes
node_retrieval_nodes -->|"retrieves documents"| node_retrieval_store
node_react_nodes -->|"loads prompts"| node_prompt_loader
node_retrieval_nodes -->|"loads prompts"| node_prompt_loader
node_memory_nodes -->|"loads prompts"| node_prompt_loader
node_enrichment_nodes -->|"loads prompts"| node_prompt_loader
node_simple_nodes -->|"loads prompts"| node_prompt_loader
node_retrieval_wrapper -.->|"accepts documents"| node_document_loading
node_enrichment_wrapper -.->|"handles data"| node_data_store
node_url_markdown -.->|"converts URLs"| node_document_loading

click node_chainlit_app "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/app.py"
click node_agent_selector "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_selector.py"
click node_base_wrapper "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/base.py"
click node_streaming "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/utils/streaming_utils.py"
click node_react_wrapper "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/react_agent_wrapper.py"
click node_retrieval_wrapper "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/retrieval_agent_wrapper.py"
click node_memory_wrapper "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/memory_agent_wrapper.py"
click node_enrichment_wrapper "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/data_enrichment_wrapper.py"
click node_simple_wrapper "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/simple_agent_wrapper.py"
click node_react_graph "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/react_agent/graph.py"
click node_retrieval_graph "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/retrieval_agent/graph.py"
click node_memory_graph "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/memory_agent/graph.py"
click node_enrichment_graph "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/data_enrichment_agent/graph.py"
click node_simple_graph "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/new_simple_agent/graph.py"
click node_react_nodes "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/react_agent/utils/nodes.py"
click node_retrieval_nodes "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/retrieval_agent/utils/nodes.py"
click node_retrieval_store "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/retrieval_agent/utils/retrieval.py"
click node_memory_nodes "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/memory_agent/utils/nodes.py"
click node_enrichment_nodes "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/data_enrichment_agent/utils/nodes.py"
click node_simple_nodes "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/new_simple_agent/utils/nodes.py"
click node_prompt_loader "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/prompt_loader.py"
click node_document_loading "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/document_loading.py"
click node_data_store "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/database_operations.py"
click node_url_markdown "https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/url_to_markdown.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_chainlit_app,node_agent_selector,node_base_wrapper,node_streaming,node_react_wrapper,node_retrieval_wrapper,node_memory_wrapper,node_enrichment_wrapper,node_simple_wrapper,node_user toneBlue
class node_react_graph,node_retrieval_graph,node_memory_graph,node_enrichment_graph,node_simple_graph,node_react_nodes,node_retrieval_nodes,node_memory_nodes,node_enrichment_nodes,node_simple_nodes toneAmber
class node_prompt_loader,node_document_loading,node_data_store,node_url_markdown toneMint
class node_retrieval_store toneRose
```

## Components

### Chainlit interface

- [Chat app](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/app.py): `src/chainlit_app/app.py`
- [Agent selector](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_selector.py): `src/chainlit_app/agent_selector.py`
- [Wrapper base](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/base.py): `src/chainlit_app/agent_wrappers/base.py`
- [Response streaming](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/utils/streaming_utils.py): `src/chainlit_app/utils/streaming_utils.py`
- [React wrapper](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/react_agent_wrapper.py): `src/chainlit_app/agent_wrappers/react_agent_wrapper.py`
- [Retrieval wrapper](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/retrieval_agent_wrapper.py): `src/chainlit_app/agent_wrappers/retrieval_agent_wrapper.py`
- [Memory wrapper](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/memory_agent_wrapper.py): `src/chainlit_app/agent_wrappers/memory_agent_wrapper.py`
- [Enrichment wrapper](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/data_enrichment_wrapper.py): `src/chainlit_app/agent_wrappers/data_enrichment_wrapper.py`
- [Simple wrapper](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/chainlit_app/agent_wrappers/simple_agent_wrapper.py): `src/chainlit_app/agent_wrappers/simple_agent_wrapper.py`

### Agent templates

- [React workflow](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/react_agent/graph.py): `src/agents/general/react_agent/graph.py`
- [Retrieval workflow](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/retrieval_agent/graph.py): `src/agents/general/retrieval_agent/graph.py`
- [Memory workflow](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/memory_agent/graph.py): `src/agents/general/memory_agent/graph.py`
- [Enrichment workflow](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/data_enrichment_agent/graph.py): `src/agents/general/data_enrichment_agent/graph.py`
- [Simple workflow](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/new_simple_agent/graph.py): `src/agents/general/new_simple_agent/graph.py`
- [Tool-calling logic](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/react_agent/utils/nodes.py): `src/agents/general/react_agent/utils/nodes.py`
- [RAG logic](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/retrieval_agent/utils/nodes.py): `src/agents/general/retrieval_agent/utils/nodes.py`
- [Memory logic](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/memory_agent/utils/nodes.py): `src/agents/general/memory_agent/utils/nodes.py`
- [Data processing logic](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/data_enrichment_agent/utils/nodes.py): `src/agents/general/data_enrichment_agent/utils/nodes.py`
- [Chat logic](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/new_simple_agent/utils/nodes.py): `src/agents/general/new_simple_agent/utils/nodes.py`

### Shared utilities

- [Prompt loading](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/prompt_loader.py): `src/utils/prompt_loader.py`
- [Document loading](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/document_loading.py): `src/utils/document_loading.py`
- [Database operations](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/database_operations.py): `src/utils/database_operations.py`
- [URL conversion](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/utils/url_to_markdown.py): `src/utils/url_to_markdown.py`

### External services

- [Vector retrievers](https://github.com/corentin-tin/langgraph-agents-template/blob/main/src/agents/general/retrieval_agent/utils/retrieval.py): `src/agents/general/retrieval_agent/utils/retrieval.py`

### Other components

- **User**

## Connections

- User → Chat app: sends message (evidence: `src/chainlit_app/app.py`)
- Chat app → Agent selector: offers profiles (evidence: `src/chainlit_app/agent_selector.py`)
- Chat app → Wrapper base: dispatches message (evidence: `src/chainlit_app/app.py`)
- Agent selector → React wrapper: selects agent
- Agent selector → Retrieval wrapper: selects agent
- Agent selector → Memory wrapper: selects agent
- Agent selector → Enrichment wrapper: selects agent
- Agent selector → Simple wrapper: selects agent
- React wrapper → Wrapper base: extends (evidence: `src/chainlit_app/agent_wrappers/react_agent_wrapper.py`)
- Retrieval wrapper → Wrapper base: extends (evidence: `src/chainlit_app/agent_wrappers/retrieval_agent_wrapper.py`)
- Memory wrapper → Wrapper base: extends (evidence: `src/chainlit_app/agent_wrappers/memory_agent_wrapper.py`)
- Enrichment wrapper → Wrapper base: extends (evidence: `src/chainlit_app/agent_wrappers/data_enrichment_wrapper.py`)
- Wrapper base → React workflow: loads graph (evidence: `src/chainlit_app/agent_wrappers/base.py`)
- Wrapper base → Retrieval workflow: loads graph (evidence: `src/chainlit_app/agent_wrappers/base.py`)
- Wrapper base → Memory workflow: loads graph (evidence: `src/chainlit_app/agent_wrappers/base.py`)
- Wrapper base → Enrichment workflow: loads graph (evidence: `src/chainlit_app/agent_wrappers/base.py`)
- Wrapper base → Simple workflow: loads graph (evidence: `src/chainlit_app/agent_wrappers/base.py`)
- Chat app → Response streaming: streams responses (evidence: `src/chainlit_app/app.py`)
- React workflow → Tool-calling logic: routes workflow (evidence: `src/agents/general/react_agent/graph.py`)
- Retrieval workflow → RAG logic: routes workflow (evidence: `src/agents/general/retrieval_agent/graph.py`)
- Memory workflow → Memory logic: routes workflow (evidence: `src/agents/general/memory_agent/graph.py`)
- Enrichment workflow → Data processing logic: routes workflow (evidence: `src/agents/general/data_enrichment_agent/graph.py`)
- Simple workflow → Chat logic: routes workflow (evidence: `src/agents/general/new_simple_agent/graph.py`)
- RAG logic → Vector retrievers: retrieves documents (evidence: `src/agents/general/retrieval_agent/utils/nodes.py`)
- Tool-calling logic → Prompt loading: loads prompts
- RAG logic → Prompt loading: loads prompts
- Memory logic → Prompt loading: loads prompts
- Data processing logic → Prompt loading: loads prompts
- Chat logic → Prompt loading: loads prompts
- Retrieval wrapper → Document loading: accepts documents
- Enrichment wrapper → Database operations: handles data
- URL conversion → Document loading: converts URLs
