# faranbutt/ai-agents architecture

> Architecture diagram of the GitHub repository faranbutt/ai-agents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/faranbutt/ai-agents
- Repository: https://github.com/faranbutt/ai-agents

## Overview

##### Project type and purpose
- This repository is a tutorial-style, notebook-driven exploration of building AI-powered agents using the LangChain (for pipelining LLM calls) and LangGraph (for visualizing reasoning flows) frameworks.
- The notebooks (e.g., “General Agent.ipynb”, “Teaching Agent.ipynb”, “Customer_Support_Agent.ipynb”) each implement a different agent use case, while the `content/k_nearest_neighbor.py` module provides a simple content-based recommendation utility.

##### File structure
- Top-level notebooks: each corresponds to an example agent or ML exercise (e.g., SVM kernels, k-NN).
- `content/`: holds reusable Python modules (e.g., `k_nearest_neighbor.py`).
- `agent_practice/`: a sandbox directory with iterative agent prototypes (`ai_agent(1).ipynb` through `ai_agent(05).ipynb`).
- No separate “frontend” or “backend” folders—this is a code/demo repo rather than a web service.

##### README for additional insights
- Confirms core technologies: LangChain for building agent chains; LangGraph for rendering visual workflows; support for custom prompts and scalable pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% Notebook UI Layer
  subgraph "Notebook UI"
    subgraph "Example Agents"
      NB1["Content Based Recommendation System.ipynb"]:::notebook
      NB2["Customer_Support_Agent.ipynb"]:::notebook
      NB3["General Agent.ipynb"]:::notebook
      NB4["Teaching Agent.ipynb"]:::notebook
      NB5["lab01_part3_svm_kernels.ipynb"]:::notebook
    end
    subgraph "Sandbox Prototypes"
      SB1["ai_agent(1).ipynb"]:::notebook
      SB2["ai_agent(2).ipynb"]:::notebook
      SB3["ai_agent(03).ipynb"]:::notebook
      SB4["ai_agent(04).ipynb"]:::notebook
      SB5["ai_agent(05).ipynb"]:::notebook
    end
  end

  %% Core Pipeline
  LCP["LangChain Pipeline"]:::pipeline

  %% External API
  LLM["LLM Provider API"]:::api

  %% Tool Modules
  Tool["Tool Modules (k-NN)"]:::tool

  %% Visualization Engine
  LG["LangGraph Visualizer"]:::visualizer

  %% Project Metadata
  MD["README.md"]:::metadata

  %% Connections
  NB1 -->|configures & executes| LCP
  NB2 -->|configures & executes| LCP
  NB3 -->|configures & executes| LCP
  NB4 -->|configures & executes| LCP
  NB5 -->|configures & executes| LCP
  SB1 -->|configures & executes| LCP
  SB2 -->|configures & executes| LCP
  SB3 -->|configures & executes| LCP
  SB4 -->|configures & executes| LCP
  SB5 -->|configures & executes| LCP

  LCP -->|calls| LLM
  LCP -->|invokes| Tool
  LCP -->|emits events| LG
  LG -->|renders visuals| NB1

  MD -->|documents| LCP

  %% Click Events
  click NB1 "https://github.com/faranbutt/ai-agents/blob/main/Content Based Recommendation System.ipynb"
  click NB2 "https://github.com/faranbutt/ai-agents/blob/main/Customer_Support_Agent.ipynb"
  click NB3 "https://github.com/faranbutt/ai-agents/blob/main/General Agent.ipynb"
  click NB4 "https://github.com/faranbutt/ai-agents/blob/main/Teaching Agent.ipynb"
  click NB5 "https://github.com/faranbutt/ai-agents/blob/main/lab01_part3_svm_kernels.ipynb"
  click SB1 "https://github.com/faranbutt/ai-agents/blob/main/agent_practice/ai_agent(1).ipynb"
  click SB2 "https://github.com/faranbutt/ai-agents/blob/main/agent_practice/ai_agent(2).ipynb"
  click SB3 "https://github.com/faranbutt/ai-agents/blob/main/agent_practice/ai_agent(03).ipynb"
  click SB4 "https://github.com/faranbutt/ai-agents/blob/main/agent_practice/ai_agent(04).ipynb"
  click SB5 "https://github.com/faranbutt/ai-agents/blob/main/agent_practice/ai_agent(05).ipynb"
  click Tool "https://github.com/faranbutt/ai-agents/blob/main/content/k_nearest_neighbor.py"
  click MD "https://github.com/faranbutt/ai-agents/blob/main/README.md"

  %% Styles
  classDef notebook fill:#E0F7FA,stroke:#006064,color:#004D40,stroke-width:1px;
  classDef pipeline fill:#E8F5E9,stroke:#1B5E20,color:#2E7D32,stroke-width:1px,stroke-dasharray: 5 5;
  classDef api fill:#FFE0B2,stroke:#E65100,color:#BF360C,stroke-width:1px;
  classDef tool fill:#ECEFF1,stroke:#607D8B,color:#455A64,stroke-width:1px;
  classDef visualizer fill:#F3E5F5,stroke:#4A148C,color:#6A1B9A,stroke-width:1px;
  classDef metadata fill:#FFF8E1,stroke:#FF6F00,color:#E65100,stroke-width:1px;
```
