# rkishore1207/artificial-intelligence architecture

> Architecture diagram of the GitHub repository rkishore1207/artificial-intelligence, 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/rkishore1207/artificial-intelligence
- Repository: https://github.com/rkishore1207/artificial-intelligence

## Overview

This repository contains AI learning samples and a small ASP.NET AI-agent API. The API’s user workflow accepts a prompt, asks Azure OpenAI to choose and invoke weather or user-detail functions as needed, then returns the model response; a separate endpoint turns text into an embedding. The README also describes broader Azure Agent/RAG concepts, but no corresponding implementation is present in the supplied tree. Edges reflect the sampled controller and service calls; unsampled capabilities are not inferred.

Main entry points: [`AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs`](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs) (Chat orchestrator), [`AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs`](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs) (Custom functions), [`AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs`](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs) (Agent controller), [`AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs`](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs) (Embedding service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Agent API"]
  node_controller["Agent controller"]
  node_prompt["Prompt request<br/>[PromptRequest.cs]"]
end

subgraph group_agent["Function Calling"]
  node_function_service["Chat orchestrator<br/>[FunctionCalling.cs]"]
  node_custom_functions["Custom functions<br/>[CustomFunctions.cs]"]
  node_function_contracts["Function contracts"]
  node_function_service_contract["Chat contract"]
  node_weather_models["Weather models<br/>[Location.cs]"]
  node_weather_details["Weather response<br/>[WeatherDetails.cs]"]
  node_user_model["User record<br/>[User.cs]"]
end

subgraph group_embed["Embeddings"]
  node_embedding_service["Embedding service<br/>[VectorEmbedding.cs]"]
  node_embedding_contract["Embedding contract"]
end

subgraph group_integrations["External Services"]
  node_azure_chat{{"Azure OpenAI chat"}}
  node_weather_api{{"OpenWeather API"}}
  node_azure_embeddings{{"Azure embeddings"}}
  node_ollama_sample["Ollama sample<br/>[Program.cs]"]
  node_chat_application["Chat sample<br/>[Program.cs]"]
end

node_client(("API client"))

node_client -->|"posts prompt"| node_controller
node_controller -->|"accepts"| node_prompt
node_controller -->|"calls chat"| node_function_service
node_function_service -->|"requests completion"| node_azure_chat
node_function_service -->|"dispatches tools"| node_custom_functions
node_custom_functions -->|"fetches weather"| node_weather_api
node_custom_functions -->|"parses location"| node_weather_models
node_custom_functions -->|"parses conditions"| node_weather_details
node_custom_functions -->|"creates records"| node_user_model
node_controller -->|"requests embedding"| node_embedding_service
node_embedding_service -->|"generates vector"| node_azure_embeddings
node_function_service -->|"implements"| node_function_service_contract
node_function_service -->|"uses contract"| node_function_contracts
node_embedding_service -->|"implements"| node_embedding_contract
node_ollama_sample -->|"streams response"| node_client

click node_controller "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs"
click node_prompt "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/PromptRequest.cs"
click node_function_service "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs"
click node_custom_functions "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs"
click node_function_contracts "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/ICustomFunctions.cs"
click node_function_service_contract "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/IFunctionCalling.cs"
click node_weather_models "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/Location.cs"
click node_weather_details "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/WeatherDetails.cs"
click node_user_model "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/User.cs"
click node_embedding_service "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs"
click node_embedding_contract "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/VectorEmbeddingAgent/IVectorEmbedding.cs"
click node_ollama_sample "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIFor.NET/FunctionCalling/Program.cs"
click node_chat_application "https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIFor.NET/ChatApplication/Program.cs"

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_controller,node_prompt,node_client toneBlue
class node_function_service,node_custom_functions,node_function_contracts,node_function_service_contract,node_weather_models,node_weather_details,node_user_model toneAmber
class node_embedding_service,node_embedding_contract toneMint
class node_azure_chat,node_weather_api,node_azure_embeddings,node_ollama_sample,node_chat_application toneRose
```

## Components

### Agent API

- [Agent controller](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs): `AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs`
- [Prompt request](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/PromptRequest.cs): `AIAgent/AIAgent/Services/FunctionCalling/Models/PromptRequest.cs`

### Function Calling

- [Chat orchestrator](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs): `AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs`
- [Custom functions](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs): `AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs`
- [Function contracts](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/ICustomFunctions.cs): `AIAgent/AIAgent/Services/FunctionCalling/ICustomFunctions.cs`
- [Chat contract](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/IFunctionCalling.cs): `AIAgent/AIAgent/Services/FunctionCalling/IFunctionCalling.cs`
- [Weather models](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/Location.cs): `AIAgent/AIAgent/Services/FunctionCalling/Models/Location.cs`
- [Weather response](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/WeatherDetails.cs): `AIAgent/AIAgent/Services/FunctionCalling/Models/WeatherDetails.cs`
- [User record](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/FunctionCalling/Models/User.cs): `AIAgent/AIAgent/Services/FunctionCalling/Models/User.cs`

### Embeddings

- [Embedding service](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs): `AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs`
- [Embedding contract](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIAgent/AIAgent/Services/VectorEmbeddingAgent/IVectorEmbedding.cs): `AIAgent/AIAgent/Services/VectorEmbeddingAgent/IVectorEmbedding.cs`

### External Services

- **Azure OpenAI chat**
- **OpenWeather API**
- **Azure embeddings**
- [Ollama sample](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIFor.NET/FunctionCalling/Program.cs): `AIFor.NET/FunctionCalling/Program.cs`
- [Chat sample](https://github.com/rkishore1207/artificial-intelligence/blob/develop/AIFor.NET/ChatApplication/Program.cs): `AIFor.NET/ChatApplication/Program.cs`

### Other components

- **API client**

## Connections

- API client → Agent controller: posts prompt (evidence: `AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs`)
- Agent controller → Prompt request: accepts (evidence: `AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs`)
- Agent controller → Chat orchestrator: calls chat (evidence: `AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs`)
- Chat orchestrator → Azure OpenAI chat: requests completion (evidence: `AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs`)
- Chat orchestrator → Custom functions: dispatches tools (evidence: `AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs`)
- Custom functions → OpenWeather API: fetches weather (evidence: `AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs`)
- Custom functions → Weather models: parses location (evidence: `AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs`)
- Custom functions → Weather response: parses conditions (evidence: `AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs`)
- Custom functions → User record: creates records (evidence: `AIAgent/AIAgent/Services/FunctionCalling/CustomFunctions.cs`)
- Agent controller → Embedding service: requests embedding (evidence: `AIAgent/AIAgent/AIAgent/Controllers/AIAgentController.cs`)
- Embedding service → Azure embeddings: generates vector (evidence: `AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs`)
- Chat orchestrator → Chat contract: implements (evidence: `AIAgent/AIAgent/Services/FunctionCalling/IFunctionCalling.cs`)
- Chat orchestrator → Function contracts: uses contract (evidence: `AIAgent/AIAgent/Services/FunctionCalling/FunctionCalling.cs`)
- Embedding service → Embedding contract: implements (evidence: `AIAgent/AIAgent/Services/VectorEmbeddingAgent/VectorEmbedding.cs`)
- Ollama sample → API client: streams response (evidence: `AIFor.NET/FunctionCalling/Program.cs`)
