# vinayparmar555/learn_agenticai architecture

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

- Interactive diagram: https://gitdiagram.com/vinayparmar555/learn_agenticai
- Repository: https://github.com/vinayparmar555/learn_agenticai

## Overview

This is a hands-on Agentic AI learning repository: separate examples cover prompting, tool use, retrieval-augmented generation, memory, graph workflows, and structured outputs. The clearest end-to-end workflow is RAG: index documents, retrieve and optionally rerank context, then generate an answer; a queued variant accepts a query, schedules processing, and returns a job result. The README also describes a FastAPI todo app, but the tree shows only its frontend files, so its backend flow is not mapped. Edges are limited to excerpted code or README-documented capabilities; unsampled implementations are represented without guessed internals.

Main entry points: [`Rag/retreival.py`](https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/retreival.py) (RAG Retrieval), [`raw_openai_func_call.py`](https://github.com/vinayparmar555/learn_agenticai/blob/main/raw_openai_func_call.py) (Tool-calling Agent), [`rag_queue/main.py`](https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/main.py) (RAG API), [`rag_queue/clients/rq_client.py`](https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/clients/rq_client.py) (RQ Queue Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patterns["Agent Patterns"]
  node_llm_setup["LLM Setup<br/>[llm.py]"]
  node_cot["Prompting Patterns<br/>[CoT.py]"]
  node_tool_agent["Tool-calling Agent"]
  node_tool_functions["Agent Tools"]
end

subgraph group_rag["RAG Systems"]
  node_rag_index["Document Indexing<br/>[indexing.py]"]
  node_rag_retrieval["RAG Retrieval<br/>[retreival.py]"]
  node_hybrid_search["Hybrid Search<br/>[hybrid_search.py]"]
  node_qdrant[("Qdrant Vector Store")]
  node_reranker["Cohere Reranker"]
  node_rag_evaluation["RAG Evaluation<br/>[retreival.py]"]
end

subgraph group_queue["Queued RAG"]
  node_rag_api["RAG API<br/>[main.py]"]
  node_rq_client["RQ Queue Client<br/>[rq_client.py]"]
  node_query_worker["Query Worker<br/>[worker.py]"]
  node_worker_runner["Worker Runner<br/>[run_worker.py]"]
  node_redis[("Redis")]
end

subgraph group_agents["Agent Workflows"]
  node_langgraph_chat["Graph Chat<br/>[chat.py]"]
  node_conditional_chat["Conditional Chat<br/>[chat_2.py]"]
  node_checkpoint_chat["Checkpoint Chat<br/>[chat_checkpoint.py]"]
  node_memory_agent["Memory Agent<br/>[mem.py]"]
  node_memory_store[("Memory Store")]
end

subgraph group_apps["Schemas and App"]
  node_output_schema["Output Schema<br/>[output.py]"]
  node_todo_frontend["Todo Frontend<br/>[script.js]"]
end

node_user(("Learner / User"))
node_llm_providers["LLM Providers"]
node_web_search["Web Search"]

node_user -->|"submits prompt"| node_tool_agent
node_tool_agent -->|"validates response"| node_output_schema
node_tool_agent -->|"dispatches tool"| node_tool_functions
node_tool_functions -->|"searches web"| node_web_search
node_tool_agent -->|"requests completion"| node_llm_providers
node_llm_setup -.->|"configures clients"| node_llm_providers
node_user -.->|"provides documents"| node_rag_index
node_rag_index -.->|"indexes vectors"| node_qdrant
node_user -->|"asks question"| node_rag_retrieval
node_rag_retrieval -->|"searches vectors"| node_qdrant
node_rag_retrieval -->|"reranks results"| node_reranker
node_rag_retrieval -->|"generates answer"| node_llm_providers
node_rag_retrieval -->|"evaluates answers"| node_rag_evaluation
node_hybrid_search -->|"stores hybrid vectors"| node_qdrant
node_user -->|"submits query"| node_rag_api
node_rag_api -->|"enqueues job"| node_rq_client
node_rag_api -->|"schedules processing"| node_query_worker
node_rag_api -->|"fetches job result"| node_rq_client
node_rq_client -->|"connects queue"| node_redis
node_worker_runner -->|"uses connection"| node_rq_client
node_query_worker -->|"searches chunks"| node_qdrant
node_query_worker -->|"generates answer"| node_llm_providers
node_user -.->|"starts chat"| node_langgraph_chat
node_user -->|"starts workflow"| node_conditional_chat
node_conditional_chat -->|"calls model"| node_llm_providers
node_user -.->|"starts chat"| node_checkpoint_chat
node_user -->|"enters query"| node_memory_agent
node_memory_agent -->|"searches and saves"| node_memory_store
node_memory_agent -->|"generates reply"| node_llm_providers
node_user -.->|"uses todo app"| node_todo_frontend

click node_llm_setup "https://github.com/vinayparmar555/learn_agenticai/blob/main/llm.py"
click node_cot "https://github.com/vinayparmar555/learn_agenticai/blob/main/CoT.py"
click node_tool_agent "https://github.com/vinayparmar555/learn_agenticai/blob/main/raw_openai_func_call.py"
click node_tool_functions "https://github.com/vinayparmar555/learn_agenticai/blob/main/raw_openai_func_call.py"
click node_rag_index "https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/indexing.py"
click node_rag_retrieval "https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/retreival.py"
click node_hybrid_search "https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/hybrid_search.py"
click node_rag_evaluation "https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/retreival.py"
click node_rag_api "https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/main.py"
click node_rq_client "https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/clients/rq_client.py"
click node_query_worker "https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/queues/worker.py"
click node_worker_runner "https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/clients/run_worker.py"
click node_langgraph_chat "https://github.com/vinayparmar555/learn_agenticai/blob/main/langgraph/chat.py"
click node_conditional_chat "https://github.com/vinayparmar555/learn_agenticai/blob/main/langgraph/chat_2.py"
click node_checkpoint_chat "https://github.com/vinayparmar555/learn_agenticai/blob/main/langgraph/chat_checkpoint.py"
click node_memory_agent "https://github.com/vinayparmar555/learn_agenticai/blob/main/memory_agent/mem.py"
click node_output_schema "https://github.com/vinayparmar555/learn_agenticai/blob/main/schema/output.py"
click node_todo_frontend "https://github.com/vinayparmar555/learn_agenticai/blob/main/todo_app/script.js"

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_llm_setup,node_cot,node_tool_agent,node_tool_functions,node_user toneBlue
class node_rag_index,node_rag_retrieval,node_hybrid_search,node_qdrant,node_reranker,node_rag_evaluation toneAmber
class node_rag_api,node_rq_client,node_query_worker,node_worker_runner,node_redis toneMint
class node_langgraph_chat,node_conditional_chat,node_checkpoint_chat,node_memory_agent,node_memory_store toneRose
class node_output_schema,node_todo_frontend,node_llm_providers,node_web_search toneIndigo
```

## Components

### Agent Patterns

- [LLM Setup](https://github.com/vinayparmar555/learn_agenticai/blob/main/llm.py): `llm.py`
- [Prompting Patterns](https://github.com/vinayparmar555/learn_agenticai/blob/main/CoT.py): `CoT.py`
- [Tool-calling Agent](https://github.com/vinayparmar555/learn_agenticai/blob/main/raw_openai_func_call.py): `raw_openai_func_call.py`
- [Agent Tools](https://github.com/vinayparmar555/learn_agenticai/blob/main/raw_openai_func_call.py): `raw_openai_func_call.py`

### RAG Systems

- [Document Indexing](https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/indexing.py): `Rag/indexing.py`
- [RAG Retrieval](https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/retreival.py): `Rag/retreival.py`
- [Hybrid Search](https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/hybrid_search.py): `Rag/hybrid_search.py`
- **Qdrant Vector Store**
- **Cohere Reranker**
- [RAG Evaluation](https://github.com/vinayparmar555/learn_agenticai/blob/main/Rag/retreival.py): `Rag/retreival.py`

### Queued RAG

- [RAG API](https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/main.py): `rag_queue/main.py`
- [RQ Queue Client](https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/clients/rq_client.py): `rag_queue/clients/rq_client.py`
- [Query Worker](https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/queues/worker.py): `rag_queue/queues/worker.py`
- [Worker Runner](https://github.com/vinayparmar555/learn_agenticai/blob/main/rag_queue/clients/run_worker.py): `rag_queue/clients/run_worker.py`
- **Redis**

### Agent Workflows

- [Graph Chat](https://github.com/vinayparmar555/learn_agenticai/blob/main/langgraph/chat.py): `langgraph/chat.py`
- [Conditional Chat](https://github.com/vinayparmar555/learn_agenticai/blob/main/langgraph/chat_2.py): `langgraph/chat_2.py`
- [Checkpoint Chat](https://github.com/vinayparmar555/learn_agenticai/blob/main/langgraph/chat_checkpoint.py): `langgraph/chat_checkpoint.py`
- [Memory Agent](https://github.com/vinayparmar555/learn_agenticai/blob/main/memory_agent/mem.py): `memory_agent/mem.py`
- **Memory Store**

### Schemas and App

- [Output Schema](https://github.com/vinayparmar555/learn_agenticai/blob/main/schema/output.py): `schema/output.py`
- [Todo Frontend](https://github.com/vinayparmar555/learn_agenticai/blob/main/todo_app/script.js): `todo_app/script.js`

### Other components

- **Learner / User**
- **LLM Providers**
- **Web Search**

## Connections

- Learner / User → Tool-calling Agent: submits prompt (evidence: `raw_openai_func_call.py`)
- Tool-calling Agent → Output Schema: validates response (evidence: `raw_openai_func_call.py`)
- Tool-calling Agent → Agent Tools: dispatches tool (evidence: `raw_openai_func_call.py`)
- Agent Tools → Web Search: searches web (evidence: `raw_openai_func_call.py`)
- Tool-calling Agent → LLM Providers: requests completion (evidence: `raw_openai_func_call.py`)
- LLM Setup → LLM Providers: configures clients (evidence: `README.md`)
- Learner / User → Document Indexing: provides documents (evidence: `README.md`)
- Document Indexing → Qdrant Vector Store: indexes vectors (evidence: `README.md`)
- Learner / User → RAG Retrieval: asks question (evidence: `Rag/retreival.py`)
- RAG Retrieval → Qdrant Vector Store: searches vectors (evidence: `Rag/retreival.py`)
- RAG Retrieval → Cohere Reranker: reranks results (evidence: `Rag/retreival.py`)
- RAG Retrieval → LLM Providers: generates answer (evidence: `Rag/retreival.py`)
- RAG Retrieval → RAG Evaluation: evaluates answers (evidence: `Rag/retreival.py`)
- Hybrid Search → Qdrant Vector Store: stores hybrid vectors (evidence: `Rag/hybrid_search.py`)
- Learner / User → RAG API: submits query (evidence: `rag_queue/main.py`)
- RAG API → RQ Queue Client: enqueues job (evidence: `rag_queue/main.py`)
- RAG API → Query Worker: schedules processing (evidence: `rag_queue/main.py`)
- RAG API → RQ Queue Client: fetches job result (evidence: `rag_queue/main.py`)
- RQ Queue Client → Redis: connects queue (evidence: `rag_queue/clients/rq_client.py`)
- Worker Runner → RQ Queue Client: uses connection (evidence: `rag_queue/clients/run_worker.py`)
- Query Worker → Qdrant Vector Store: searches chunks (evidence: `rag_queue/queues/worker.py`)
- Query Worker → LLM Providers: generates answer (evidence: `rag_queue/queues/worker.py`)
- Learner / User → Graph Chat: starts chat (evidence: `README.md`)
- Learner / User → Conditional Chat: starts workflow (evidence: `langgraph/chat_2.py`)
- Conditional Chat → LLM Providers: calls model (evidence: `langgraph/chat_2.py`)
- Learner / User → Checkpoint Chat: starts chat (evidence: `README.md`)
- Learner / User → Memory Agent: enters query (evidence: `memory_agent/mem.py`)
- Memory Agent → Memory Store: searches and saves (evidence: `memory_agent/mem.py`)
- Memory Agent → LLM Providers: generates reply (evidence: `memory_agent/mem.py`)
- Learner / User → Todo Frontend: uses todo app (evidence: `README.md`)
