# mayurd8862/frameworkless-agent architecture

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

- Interactive diagram: https://gitdiagram.com/mayurd8862/frameworkless-agent
- Repository: https://github.com/mayurd8862/frameworkless-agent

## Overview

This is a small framework-free Python agent: a CLI conversation enters an explicit state, Gemini proposes a JSON decision, and Python validates it, detects missing tool parameters, and either asks for clarification, runs a registered tool, or returns an answer. The graph preserves the prompt, model interface, state validation, and both example tools. Edges reflect the README and sampled source; unsampled notebook and configuration files are omitted.

Main entry points: [`frameworkless-agent/main.py`](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/main.py) (Turn orchestration), [`frameworkless-agent/call_llm.py`](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/call_llm.py) (Gemini client), [`frameworkless-agent/tools.py`](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py) (Tool executor), [`frameworkless-agent/prompt.py`](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/prompt.py) (Agent prompt)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Agent orchestration"]
  node_cli_loop["CLI loop<br/>[main.py]"]
  node_turn_runner["Turn orchestration<br/>[main.py]"]
  node_agent_state["Conversation state<br/>[state.py]"]
  node_state_validation["Response validation<br/>[state.py]"]
end

subgraph group_model["Gemini interface"]
  node_llm_client["Gemini client<br/>[call_llm.py]"]
  node_system_prompt["Agent prompt<br/>[prompt.py]"]
end

subgraph group_tools["Tool runtime"]
  node_tool_registry["Tool registry<br/>[tools.py]"]
  node_parameter_checks["Parameter checks<br/>[tools.py]"]
  node_tool_executor["Tool executor<br/>[tools.py]"]
  node_weather_tool["Weather example<br/>[tools.py]"]
  node_sum_tool["Sum example<br/>[tools.py]"]
end

node_user(("User"))
node_gemini{{"Google Gemini"}}

node_user -->|"enters request"| node_cli_loop
node_cli_loop -->|"runs turn"| node_turn_runner
node_cli_loop -->|"appends message"| node_agent_state
node_turn_runner -->|"reads and updates"| node_agent_state
node_turn_runner -->|"requests decision"| node_llm_client
node_llm_client -->|"sets instruction"| node_system_prompt
node_system_prompt -->|"uses descriptions"| node_tool_registry
node_llm_client -->|"sends conversation"| node_gemini
node_gemini -->|"returns JSON"| node_llm_client
node_turn_runner -->|"validates response"| node_state_validation
node_turn_runner -->|"checks required values"| node_parameter_checks
node_turn_runner -->|"checks tool name"| node_tool_registry
node_turn_runner -->|"executes selected tool"| node_tool_executor
node_tool_executor -->|"dispatches"| node_weather_tool
node_tool_executor -->|"dispatches"| node_sum_tool
node_turn_runner -->|"prints answer"| node_cli_loop

click node_cli_loop "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/main.py"
click node_turn_runner "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/main.py"
click node_agent_state "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/state.py"
click node_state_validation "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/state.py"
click node_llm_client "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/call_llm.py"
click node_system_prompt "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/prompt.py"
click node_tool_registry "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py"
click node_parameter_checks "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py"
click node_tool_executor "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py"
click node_weather_tool "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py"
click node_sum_tool "https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.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_cli_loop,node_turn_runner,node_agent_state,node_state_validation,node_user toneBlue
class node_llm_client,node_system_prompt toneAmber
class node_tool_registry,node_parameter_checks,node_tool_executor,node_weather_tool,node_sum_tool toneMint
class node_gemini toneIndigo
```

## Components

### Agent orchestration

- [CLI loop](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/main.py): `frameworkless-agent/main.py`
- [Turn orchestration](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/main.py): `frameworkless-agent/main.py`
- [Conversation state](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/state.py): `frameworkless-agent/state.py`
- [Response validation](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/state.py): `frameworkless-agent/state.py`

### Gemini interface

- [Gemini client](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/call_llm.py): `frameworkless-agent/call_llm.py`
- [Agent prompt](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/prompt.py): `frameworkless-agent/prompt.py`

### Tool runtime

- [Tool registry](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py): `frameworkless-agent/tools.py`
- [Parameter checks](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py): `frameworkless-agent/tools.py`
- [Tool executor](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py): `frameworkless-agent/tools.py`
- [Weather example](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py): `frameworkless-agent/tools.py`
- [Sum example](https://github.com/mayurd8862/frameworkless-agent/blob/main/frameworkless-agent/tools.py): `frameworkless-agent/tools.py`

### Other components

- **User**
- **Google Gemini**

## Connections

- User → CLI loop: enters request (evidence: `frameworkless-agent/main.py`)
- CLI loop → Turn orchestration: runs turn (evidence: `frameworkless-agent/main.py`)
- CLI loop → Conversation state: appends message (evidence: `frameworkless-agent/main.py`)
- Turn orchestration → Conversation state: reads and updates (evidence: `frameworkless-agent/main.py`)
- Turn orchestration → Gemini client: requests decision (evidence: `frameworkless-agent/main.py`)
- Gemini client → Agent prompt: sets instruction (evidence: `frameworkless-agent/call_llm.py`)
- Agent prompt → Tool registry: uses descriptions (evidence: `frameworkless-agent/prompt.py`)
- Gemini client → Google Gemini: sends conversation (evidence: `frameworkless-agent/call_llm.py`)
- Google Gemini → Gemini client: returns JSON (evidence: `frameworkless-agent/call_llm.py`)
- Turn orchestration → Response validation: validates response (evidence: `frameworkless-agent/main.py`)
- Turn orchestration → Parameter checks: checks required values (evidence: `frameworkless-agent/main.py`)
- Turn orchestration → Tool registry: checks tool name (evidence: `frameworkless-agent/main.py`)
- Turn orchestration → Tool executor: executes selected tool (evidence: `frameworkless-agent/main.py`)
- Tool executor → Weather example: dispatches (evidence: `frameworkless-agent/tools.py`)
- Tool executor → Sum example: dispatches (evidence: `frameworkless-agent/tools.py`)
- Turn orchestration → CLI loop: prints answer (evidence: `frameworkless-agent/main.py`)
