# siddharth-kharche/generative_ai_project architecture

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

- Interactive diagram: https://gitdiagram.com/siddharth-kharche/generative_ai_project
- Repository: https://github.com/siddharth-kharche/generative_ai_project

## Overview

This repository is a Generative AI project template, not a single end-user application. Its documented capabilities span agent and chat orchestration, model routing, prompt engineering, memory and retrieval, skills, multimodal processing, and supporting safeguards. The README describes these as modular components but does not specify runtime calls or data flow; the sampled source excerpts are empty, so relationships between components are not drawn.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Agents and flows"]
  node_base_agent["Base agent<br/>[base_agent.py]"]
  node_planner["Planner<br/>[planner.py]"]
  node_executor["Executor<br/>[executor.py]"]
  node_chat_flow["Chat flow<br/>[chat_flow.py]"]
  node_doc_processor["Document processing<br/>[doc_processor.py]"]
end

subgraph group_models["Model access"]
  node_llm_router["LLM router<br/>[router.py]"]
  node_openai["OpenAI adapter<br/>[openai.py]"]
  node_anthropic["Anthropic adapter<br/>[anthropic.py]"]
  node_llm_schemas["LLM schemas<br/>[schemas.py]"]
end

subgraph group_prompts["Prompt and memory"]
  node_chainer["Prompt chaining<br/>[chainer.py]"]
  node_few_shot["Few-shot prompts<br/>[few_shot.py]"]
  node_templates["Prompt templates<br/>[templates.py]"]
  node_short_term_memory["Short-term memory<br/>[short_term.py]"]
  node_long_term_memory["Long-term memory<br/>[long_term.py]"]
end

subgraph group_knowledge["Retrieval and skills"]
  node_document_db[("Document lookup<br/>[document_db.py]")]
  node_vector_db[("Vector search<br/>[vector_db.py]")]
  node_web_search["Web search<br/>[web_search.py]"]
  node_code_interpreter["Code execution"]
  node_image_processor["Image processing<br/>[image_processor.py]"]
  node_speech_handler["Speech handling<br/>[speech_handler.py]"]
end

subgraph group_safety["Safety and operations"]
  node_fallback["Fallback routing<br/>[router.py]"]
  node_pii["PII filtering<br/>[pii.py]"]
  node_error_handler["Error handling<br/>[error_handler.py]"]
  node_cache["Caching<br/>[cache.py]"]
  node_rate_limiter["Rate limiting<br/>[rate_limiter.py]"]
  node_token_counter["Token counting<br/>[token_counter.py]"]
  node_logger["Logging<br/>[logger.py]"]
end

node_model_config["Model configuration<br/>[model_config.yaml]"]
node_prompt_config["Prompt configuration"]
node_prompt_data["Prompt data<br/>[default.yaml]"]
node_embedding_data["Embedding data"]

click node_base_agent "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/agents/base_agent.py"
click node_planner "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/agents/planner.py"
click node_executor "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/agents/executor.py"
click node_chat_flow "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/pipelines/chat_flow.py"
click node_doc_processor "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/pipelines/doc_processor.py"
click node_llm_router "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/router.py"
click node_openai "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/platforms/openai.py"
click node_anthropic "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/platforms/anthropic.py"
click node_llm_schemas "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/schemas.py"
click node_chainer "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/prompt_engineering/chainer.py"
click node_few_shot "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/prompt_engineering/few_shot.py"
click node_templates "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/prompt_engineering/templates.py"
click node_short_term_memory "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/memory/short_term.py"
click node_long_term_memory "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/memory/long_term.py"
click node_document_db "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/retrieval/document_db.py"
click node_vector_db "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/retrieval/vector_db.py"
click node_web_search "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/skills/web_search.py"
click node_code_interpreter "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/skills/code_interpreter.py"
click node_image_processor "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/vision_audio/image_processor.py"
click node_speech_handler "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/vision_audio/speech_handler.py"
click node_fallback "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/fallback/router.py"
click node_pii "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/guardrails/pii.py"
click node_error_handler "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/handlers/error_handler.py"
click node_cache "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/cache.py"
click node_rate_limiter "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/rate_limiter.py"
click node_token_counter "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/token_counter.py"
click node_logger "https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/logger.py"
click node_model_config "https://github.com/siddharth-kharche/generative_ai_project/blob/main/config/model_config.yaml"
click node_prompt_config "https://github.com/siddharth-kharche/generative_ai_project/blob/main/config/prompt_templates.yaml"
click node_prompt_data "https://github.com/siddharth-kharche/generative_ai_project/blob/main/data/prompts/default.yaml"
click node_embedding_data "https://github.com/siddharth-kharche/generative_ai_project/blob/main/data/embeddings/empty_embeddings.json"

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_base_agent,node_planner,node_executor,node_chat_flow,node_doc_processor toneBlue
class node_llm_router,node_openai,node_anthropic,node_llm_schemas toneAmber
class node_chainer,node_few_shot,node_templates,node_short_term_memory,node_long_term_memory toneMint
class node_document_db,node_vector_db,node_web_search,node_code_interpreter,node_image_processor,node_speech_handler toneRose
class node_fallback,node_pii,node_error_handler,node_cache,node_rate_limiter,node_token_counter,node_logger,node_model_config toneIndigo
class node_prompt_config,node_prompt_data,node_embedding_data toneTeal
```

## Components

### Agents and flows

- [Base agent](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/agents/base_agent.py): `src/agents/base_agent.py`
- [Planner](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/agents/planner.py): `src/agents/planner.py`
- [Executor](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/agents/executor.py): `src/agents/executor.py`
- [Chat flow](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/pipelines/chat_flow.py): `src/pipelines/chat_flow.py`
- [Document processing](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/pipelines/doc_processor.py): `src/pipelines/doc_processor.py`

### Model access

- [LLM router](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/router.py): `src/llm/router.py`
- [OpenAI adapter](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/platforms/openai.py): `src/llm/platforms/openai.py`
- [Anthropic adapter](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/platforms/anthropic.py): `src/llm/platforms/anthropic.py`
- [LLM schemas](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/llm/schemas.py): `src/llm/schemas.py`

### Prompt and memory

- [Prompt chaining](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/prompt_engineering/chainer.py): `src/prompt_engineering/chainer.py`
- [Few-shot prompts](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/prompt_engineering/few_shot.py): `src/prompt_engineering/few_shot.py`
- [Prompt templates](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/prompt_engineering/templates.py): `src/prompt_engineering/templates.py`
- [Short-term memory](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/memory/short_term.py): `src/memory/short_term.py`
- [Long-term memory](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/memory/long_term.py): `src/memory/long_term.py`

### Retrieval and skills

- [Document lookup](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/retrieval/document_db.py): `src/retrieval/document_db.py`
- [Vector search](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/retrieval/vector_db.py): `src/retrieval/vector_db.py`
- [Web search](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/skills/web_search.py): `src/skills/web_search.py`
- [Code execution](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/skills/code_interpreter.py): `src/skills/code_interpreter.py`
- [Image processing](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/vision_audio/image_processor.py): `src/vision_audio/image_processor.py`
- [Speech handling](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/vision_audio/speech_handler.py): `src/vision_audio/speech_handler.py`

### Safety and operations

- [Fallback routing](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/fallback/router.py): `src/fallback/router.py`
- [PII filtering](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/guardrails/pii.py): `src/guardrails/pii.py`
- [Error handling](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/handlers/error_handler.py): `src/handlers/error_handler.py`
- [Caching](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/cache.py): `src/utils/cache.py`
- [Rate limiting](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/rate_limiter.py): `src/utils/rate_limiter.py`
- [Token counting](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/token_counter.py): `src/utils/token_counter.py`
- [Logging](https://github.com/siddharth-kharche/generative_ai_project/blob/main/src/utils/logger.py): `src/utils/logger.py`

### Other components

- [Model configuration](https://github.com/siddharth-kharche/generative_ai_project/blob/main/config/model_config.yaml): `config/model_config.yaml`
- [Prompt configuration](https://github.com/siddharth-kharche/generative_ai_project/blob/main/config/prompt_templates.yaml): `config/prompt_templates.yaml`
- [Prompt data](https://github.com/siddharth-kharche/generative_ai_project/blob/main/data/prompts/default.yaml): `data/prompts/default.yaml`
- [Embedding data](https://github.com/siddharth-kharche/generative_ai_project/blob/main/data/embeddings/empty_embeddings.json): `data/embeddings/empty_embeddings.json`
