# tarkojev/ai-generic architecture

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

- Interactive diagram: https://gitdiagram.com/tarkojev/ai-generic
- Repository: https://github.com/tarkojev/ai-generic

## Overview

This repository is a collection of general-AI learning examples, not a unified application. Its major areas are grid-world agents and environments, optimization solvers, machine-learning examples, and logical/probabilistic reasoning. The visible workflows are local: the genetic-algorithm driver constructs TSP individuals, while the hybrid agent delegates action selection to several agent strategies. The supplied top-level README only names the sections; other README capabilities and several runtime connections were not inspected, so unsupported cross-section flows are omitted.

Main entry points: [`Agentic AI/Agents/hybridbased.py`](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/hybridbased.py) (Hybrid Agent), [`Optimization/Genetic Algorithm/Main.py`](https://github.com/tarkojev/ai-generic/blob/main/Optimization/Genetic%20Algorithm/Main.py) (TSP Genetic Solver), [`Agentic AI/Agents/simplereflex.py`](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/simplereflex.py) (Simple Reflex), [`Agentic AI/Agents/modelbasedreflex.py`](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/modelbasedreflex.py) (Model Reflex)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agents["Agentic AI"]
  node_agent_runner["Agent Runner<br/>[run.py]"]
  node_agent_hybrid["Hybrid Agent<br/>[hybridbased.py]"]
  node_agent_simple["Simple Reflex<br/>[simplereflex.py]"]
  node_agent_model["Model Reflex"]
  node_agent_goal["Goal Search<br/>[goalbased.py]"]
  node_agent_utility["Utility Search<br/>[utilitybased.py]"]
  node_agent_qlearn["Q Learning<br/>[q_learning.py]"]
  node_agent_other["Other Strategies"]
  node_env_puzzle["Enemy Puzzle"]
  node_env_treasure["Treasure World<br/>[treasurehunting.py]"]
end

subgraph group_optimization["Optimization"]
  node_tsp_driver["TSP Genetic Solver<br/>[Main.py]"]
  node_tsp_individual["Tour Individual<br/>[TSP_Individual.py]"]
  node_sat_solver["SAT Search<br/>[main.py]"]
end

subgraph group_learning["Machine Learning"]
  node_ml_examples["ML Examples"]
end

subgraph group_reasoning["Reasoning"]
  node_knowledge_base["Logical Knowledge Base<br/>[knowledgebase.py]"]
  node_bayesian_network["Bayesian Network<br/>[bayesiannetwork.py]"]
  node_naive_bayes["Naive Bayes<br/>[naivebayesian.py]"]
end

node_agent_hybrid -->|"tries action"| node_agent_simple
node_agent_hybrid -->|"tries action"| node_agent_model
node_agent_hybrid -->|"tries action"| node_agent_goal
node_agent_hybrid -->|"tries action"| node_agent_utility
node_agent_hybrid -->|"tries action"| node_agent_qlearn
node_tsp_driver -->|"creates individuals"| node_tsp_individual

click node_agent_runner "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/run.py"
click node_agent_hybrid "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/hybridbased.py"
click node_agent_simple "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/simplereflex.py"
click node_agent_model "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/modelbasedreflex.py"
click node_agent_goal "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/goalbased.py"
click node_agent_utility "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/utilitybased.py"
click node_agent_qlearn "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/q_learning.py"
click node_agent_other "https://github.com/tarkojev/ai-generic/tree/main/Agentic%20AI/Agents"
click node_env_puzzle "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Environments/puzzlewithenemies.py"
click node_env_treasure "https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Environments/treasurehunting.py"
click node_tsp_driver "https://github.com/tarkojev/ai-generic/blob/main/Optimization/Genetic%20Algorithm/Main.py"
click node_tsp_individual "https://github.com/tarkojev/ai-generic/blob/main/Optimization/Genetic%20Algorithm/TSP_Individual.py"
click node_sat_solver "https://github.com/tarkojev/ai-generic/blob/main/Optimization/SATs/main.py"
click node_ml_examples "https://github.com/tarkojev/ai-generic/tree/main/Machine%20Learning/basics"
click node_knowledge_base "https://github.com/tarkojev/ai-generic/blob/main/Reasoning/knowledgebase.py"
click node_bayesian_network "https://github.com/tarkojev/ai-generic/blob/main/Reasoning/Probabilistic%20Graphical%20Reasoning/bayesiannetwork.py"
click node_naive_bayes "https://github.com/tarkojev/ai-generic/blob/main/Reasoning/Probabilistic%20Graphical%20Reasoning/naivebayesian.py"

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_agent_runner,node_agent_hybrid,node_agent_simple,node_agent_model,node_agent_goal,node_agent_utility,node_agent_qlearn,node_agent_other,node_env_puzzle,node_env_treasure toneBlue
class node_tsp_driver,node_tsp_individual,node_sat_solver toneAmber
class node_ml_examples toneMint
class node_knowledge_base,node_bayesian_network,node_naive_bayes toneRose
```

## Components

### Agentic AI

- [Agent Runner](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/run.py): `Agentic AI/run.py`
- [Hybrid Agent](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/hybridbased.py): `Agentic AI/Agents/hybridbased.py`
- [Simple Reflex](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/simplereflex.py): `Agentic AI/Agents/simplereflex.py`
- [Model Reflex](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/modelbasedreflex.py): `Agentic AI/Agents/modelbasedreflex.py`
- [Goal Search](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/goalbased.py): `Agentic AI/Agents/goalbased.py`
- [Utility Search](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/utilitybased.py): `Agentic AI/Agents/utilitybased.py`
- [Q Learning](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Agents/q_learning.py): `Agentic AI/Agents/q_learning.py`
- [Other Strategies](https://github.com/tarkojev/ai-generic/tree/main/Agentic%20AI/Agents): `Agentic AI/Agents`
- [Enemy Puzzle](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Environments/puzzlewithenemies.py): `Agentic AI/Environments/puzzlewithenemies.py`
- [Treasure World](https://github.com/tarkojev/ai-generic/blob/main/Agentic%20AI/Environments/treasurehunting.py): `Agentic AI/Environments/treasurehunting.py`

### Optimization

- [TSP Genetic Solver](https://github.com/tarkojev/ai-generic/blob/main/Optimization/Genetic%20Algorithm/Main.py): `Optimization/Genetic Algorithm/Main.py`
- [Tour Individual](https://github.com/tarkojev/ai-generic/blob/main/Optimization/Genetic%20Algorithm/TSP_Individual.py): `Optimization/Genetic Algorithm/TSP_Individual.py`
- [SAT Search](https://github.com/tarkojev/ai-generic/blob/main/Optimization/SATs/main.py): `Optimization/SATs/main.py`

### Machine Learning

- [ML Examples](https://github.com/tarkojev/ai-generic/tree/main/Machine%20Learning/basics): `Machine Learning/basics`

### Reasoning

- [Logical Knowledge Base](https://github.com/tarkojev/ai-generic/blob/main/Reasoning/knowledgebase.py): `Reasoning/knowledgebase.py`
- [Bayesian Network](https://github.com/tarkojev/ai-generic/blob/main/Reasoning/Probabilistic%20Graphical%20Reasoning/bayesiannetwork.py): `Reasoning/Probabilistic Graphical Reasoning/bayesiannetwork.py`
- [Naive Bayes](https://github.com/tarkojev/ai-generic/blob/main/Reasoning/Probabilistic%20Graphical%20Reasoning/naivebayesian.py): `Reasoning/Probabilistic Graphical Reasoning/naivebayesian.py`

## Connections

- Hybrid Agent → Simple Reflex: tries action (evidence: `Agentic AI/Agents/hybridbased.py`)
- Hybrid Agent → Model Reflex: tries action (evidence: `Agentic AI/Agents/hybridbased.py`)
- Hybrid Agent → Goal Search: tries action (evidence: `Agentic AI/Agents/hybridbased.py`)
- Hybrid Agent → Utility Search: tries action (evidence: `Agentic AI/Agents/hybridbased.py`)
- Hybrid Agent → Q Learning: tries action (evidence: `Agentic AI/Agents/hybridbased.py`)
- TSP Genetic Solver → Tour Individual: creates individuals (evidence: `Optimization/Genetic Algorithm/Main.py`)
