# harshithada/guardrailed-multi-agent-system architecture

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

- Interactive diagram: https://gitdiagram.com/harshithada/guardrailed-multi-agent-system
- Repository: https://github.com/harshithada/guardrailed-multi-agent-system

## Overview

The product is a stateful, guardrailed multi-agent workflow: a user task is planned, executed, reviewed, then approved or retried, with a three-attempt cap and safe fallback. LangGraph owns state and routing; CrewAI supplies the agents, and PydanticAI schemas constrain their outputs. Mem0 retrieves bounded semantic context before planning and stores successful results. The README documents these relationships, but no notebook source was provided, so implementation-level details remain unverified.

Main entry points: [`guardrailed_multi_agent_system.ipynb`](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb) (LangGraph workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow orchestration"]
  node_langgraph["LangGraph workflow"]
  node_graph_state["Graph state"]
  node_retry_budget["Execution cap"]
  node_fallback["Safe fallback"]
  node_response["Final response"]
end

subgraph group_agents["Agent stages"]
  node_planner["Planner"]
  node_executor["Executor"]
  node_reviewer["Reviewer"]
end

subgraph group_validation["Output validation"]
  node_schemas["Strict schemas"]
end

subgraph group_memory["Persistent memory"]
  node_memory["Mem0 memory"]
  node_sqlite[("SQLite history")]
  node_chroma[("Chroma vectors")]
  node_embeddings["Hugging Face embeddings"]
end

node_user(("User"))
node_groq["Groq inference"]

node_user -->|"submits task"| node_langgraph
node_langgraph -->|"tracks state"| node_graph_state
node_langgraph -->|"checks attempts"| node_retry_budget
node_retry_budget -->|"routes over limit"| node_fallback
node_fallback -->|"sets response"| node_response
node_langgraph -->|"routes to"| node_planner
node_planner -->|"passes plan"| node_executor
node_executor -->|"passes result"| node_reviewer
node_reviewer -->|"returns decision"| node_langgraph
node_langgraph -->|"retries on request"| node_planner
node_langgraph -->|"completes approved task"| node_response
node_planner -->|"validates output"| node_schemas
node_executor -->|"validates output"| node_schemas
node_reviewer -->|"validates output"| node_schemas
node_planner -->|"uses inference"| node_groq
node_executor -->|"uses inference"| node_groq
node_reviewer -->|"uses inference"| node_groq
node_langgraph -->|"retrieves context"| node_memory
node_memory -->|"provides context"| node_planner
node_langgraph -->|"saves approved result"| node_memory
node_memory -->|"persists history"| node_sqlite
node_memory -->|"stores vectors"| node_chroma
node_memory -->|"uses embeddings"| node_embeddings

click node_langgraph "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_graph_state "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_retry_budget "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_fallback "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_planner "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_executor "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_reviewer "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_response "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_schemas "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_memory "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_sqlite "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"
click node_chroma "https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb"

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_langgraph,node_graph_state,node_retry_budget,node_fallback,node_response,node_user toneBlue
class node_planner,node_executor,node_reviewer toneAmber
class node_schemas toneMint
class node_memory,node_sqlite,node_chroma,node_embeddings toneRose
class node_groq toneIndigo
```

## Components

### Workflow orchestration

- [LangGraph workflow](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Graph state](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Execution cap](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Safe fallback](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Final response](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`

### Agent stages

- [Planner](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Executor](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Reviewer](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`

### Output validation

- [Strict schemas](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`

### Persistent memory

- [Mem0 memory](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [SQLite history](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- [Chroma vectors](https://github.com/harshithada/guardrailed-multi-agent-system/blob/main/guardrailed_multi_agent_system.ipynb): `guardrailed_multi_agent_system.ipynb`
- **Hugging Face embeddings**

### Other components

- **User**
- **Groq inference**

## Connections

- User → LangGraph workflow: submits task (evidence: `README.md`)
- LangGraph workflow → Graph state: tracks state (evidence: `README.md`)
- LangGraph workflow → Execution cap: checks attempts (evidence: `README.md`)
- Execution cap → Safe fallback: routes over limit (evidence: `README.md`)
- Safe fallback → Final response: sets response (evidence: `README.md`)
- LangGraph workflow → Planner: routes to (evidence: `README.md`)
- Planner → Executor: passes plan (evidence: `README.md`)
- Executor → Reviewer: passes result (evidence: `README.md`)
- Reviewer → LangGraph workflow: returns decision (evidence: `README.md`)
- LangGraph workflow → Planner: retries on request (evidence: `README.md`)
- LangGraph workflow → Final response: completes approved task (evidence: `README.md`)
- Planner → Strict schemas: validates output (evidence: `README.md`)
- Executor → Strict schemas: validates output (evidence: `README.md`)
- Reviewer → Strict schemas: validates output (evidence: `README.md`)
- Planner → Groq inference: uses inference (evidence: `README.md`)
- Executor → Groq inference: uses inference (evidence: `README.md`)
- Reviewer → Groq inference: uses inference (evidence: `README.md`)
- LangGraph workflow → Mem0 memory: retrieves context (evidence: `README.md`)
- Mem0 memory → Planner: provides context (evidence: `README.md`)
- LangGraph workflow → Mem0 memory: saves approved result (evidence: `README.md`)
- Mem0 memory → SQLite history: persists history (evidence: `README.md`)
- Mem0 memory → Chroma vectors: stores vectors (evidence: `README.md`)
- Mem0 memory → Hugging Face embeddings: uses embeddings (evidence: `README.md`)
