# jaysurya046/webnavigator-ai architecture

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

- Interactive diagram: https://gitdiagram.com/jaysurya046/webnavigator-ai
- Repository: https://github.com/jaysurya046/webnavigator-ai

## Overview

Web-Navigator is a browser-automation agent: a user submits a task, the agent reasons over browser observations, dispatches a browser action, repeats until done, and returns a response. Its documented capabilities include dynamic-page interaction, smart search, and downloads; the available code also shows DOM/context support, history, episodic memory, and pluggable inference. Edges are limited to relationships explicit in the excerpts or README; several major modules are indexed but unsampled, so their internal wiring is not asserted.

Main entry points: [`src/agent/web/__init__.py`](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/__init__.py) (Agent controller), [`main.py`](https://github.com/jaysurya046/webnavigator-ai/blob/main/main.py) (CLI entry), [`src/memory/episodic/__init__.py`](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/memory/episodic/__init__.py) (Episodic memory), [`src/agent/web/browser`](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/browser) (Browser runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent workflow"]
  node_entry["CLI entry<br/>[main.py]"]
  node_controller["Agent controller<br/>[__init__.py]"]
  node_state["Agent state<br/>[state.py]"]
  node_messages["Message types<br/>[__init__.py]"]
end

subgraph group_browser["Browser interaction"]
  node_browser_config["Browser config<br/>[config.py]"]
  node_browser_runtime["Browser runtime"]
  node_context["Page context"]
  node_dom["DOM inspection"]
  node_history["Navigation history"]
end

subgraph group_models["Inference and memory"]
  node_inference["Model inference"]
  node_gemini["Gemini inference<br/>[gemini.py]"]
  node_openrouter["OpenRouter inference<br/>[open_router.py]"]
  node_episodic["Episodic memory<br/>[__init__.py]"]
  node_memory_store["Memory records<br/>[views.py]"]
  node_embeddings["Embedding providers"]
  node_vectorstore[("Vector stores")]
  node_speech["Speech input<br/>[__init__.py]"]
end

subgraph group_tools["Tool execution"]
  node_web_tools["Web actions<br/>[views.py]"]
  node_tool_registry["Tool registry<br/>[views.py]"]
  node_tool_core["Tool definitions"]
end

node_user(("User"))
node_browser_service["Playwright browser"]
node_llm_service["LLM service"]

node_user -->|"submits task"| node_entry
node_entry -->|"starts agent"| node_controller
node_entry -->|"configures model"| node_gemini
node_entry -->|"configures browser"| node_browser_config
node_controller -->|"uses state"| node_state
node_controller -->|"builds prompts"| node_messages
node_controller -->|"invokes model"| node_inference
node_controller -->|"dispatches actions"| node_web_tools
node_controller -->|"stores task memory"| node_episodic
node_browser_config -.->|"configures"| node_browser_runtime
node_browser_runtime -.->|"controls browser"| node_browser_service
node_context -.->|"uses session"| node_browser_runtime
node_web_tools -->|"operates pages"| node_context
node_dom -.->|"inspects page"| node_browser_service
node_history -.->|"navigates history"| node_browser_service
node_tool_registry -->|"executes functions"| node_tool_core
node_controller -.->|"uses registry"| node_tool_registry
node_gemini -.->|"sends inference"| node_llm_service
node_openrouter -.->|"sends inference"| node_llm_service
node_episodic -->|"reads and writes"| node_memory_store
node_episodic -->|"routes and summarizes"| node_inference
node_embeddings -.->|"requests embeddings"| node_llm_service
node_vectorstore -.->|"uses vectors"| node_embeddings
node_speech -->|"transcribes audio"| node_inference
node_controller -.->|"returns response"| node_user

click node_entry "https://github.com/jaysurya046/webnavigator-ai/blob/main/main.py"
click node_controller "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/__init__.py"
click node_state "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/state.py"
click node_messages "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/message/__init__.py"
click node_browser_config "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/browser/config.py"
click node_browser_runtime "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/browser"
click node_context "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/context"
click node_dom "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/dom"
click node_history "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/history"
click node_web_tools "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/tools/views.py"
click node_tool_registry "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/tool/registry/views.py"
click node_tool_core "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/tool"
click node_inference "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/inference"
click node_gemini "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/inference/gemini.py"
click node_openrouter "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/inference/open_router.py"
click node_episodic "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/memory/episodic/__init__.py"
click node_memory_store "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/memory/episodic/views.py"
click node_embeddings "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/embedding"
click node_vectorstore "https://github.com/jaysurya046/webnavigator-ai/tree/main/src/vectorstore"
click node_speech "https://github.com/jaysurya046/webnavigator-ai/blob/main/src/speech/__init__.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_entry,node_controller,node_state,node_messages,node_user,node_browser_service toneBlue
class node_browser_config,node_browser_runtime,node_context,node_dom,node_history toneAmber
class node_inference,node_gemini,node_openrouter,node_episodic,node_memory_store,node_embeddings,node_vectorstore,node_speech toneMint
class node_web_tools,node_tool_registry,node_tool_core toneRose
class node_llm_service toneIndigo
```

## Components

### Agent workflow

- [CLI entry](https://github.com/jaysurya046/webnavigator-ai/blob/main/main.py): `main.py`
- [Agent controller](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/__init__.py): `src/agent/web/__init__.py`
- [Agent state](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/state.py): `src/agent/web/state.py`
- [Message types](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/message/__init__.py): `src/message/__init__.py`

### Browser interaction

- [Browser config](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/browser/config.py): `src/agent/web/browser/config.py`
- [Browser runtime](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/browser): `src/agent/web/browser`
- [Page context](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/context): `src/agent/web/context`
- [DOM inspection](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/dom): `src/agent/web/dom`
- [Navigation history](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/agent/web/history): `src/agent/web/history`

### Inference and memory

- [Model inference](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/inference): `src/inference`
- [Gemini inference](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/inference/gemini.py): `src/inference/gemini.py`
- [OpenRouter inference](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/inference/open_router.py): `src/inference/open_router.py`
- [Episodic memory](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/memory/episodic/__init__.py): `src/memory/episodic/__init__.py`
- [Memory records](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/memory/episodic/views.py): `src/memory/episodic/views.py`
- [Embedding providers](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/embedding): `src/embedding`
- [Vector stores](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/vectorstore): `src/vectorstore`
- [Speech input](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/speech/__init__.py): `src/speech/__init__.py`

### Tool execution

- [Web actions](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/agent/web/tools/views.py): `src/agent/web/tools/views.py`
- [Tool registry](https://github.com/jaysurya046/webnavigator-ai/blob/main/src/tool/registry/views.py): `src/tool/registry/views.py`
- [Tool definitions](https://github.com/jaysurya046/webnavigator-ai/tree/main/src/tool): `src/tool`

### Other components

- **User**
- **Playwright browser**
- **LLM service**

## Connections

- User → CLI entry: submits task (evidence: `main.py`)
- CLI entry → Agent controller: starts agent (evidence: `main.py`)
- CLI entry → Gemini inference: configures model (evidence: `main.py`)
- CLI entry → Browser config: configures browser (evidence: `main.py`)
- Agent controller → Agent state: uses state (evidence: `src/agent/web/__init__.py`)
- Agent controller → Message types: builds prompts (evidence: `src/agent/web/__init__.py`)
- Agent controller → Model inference: invokes model (evidence: `src/agent/web/__init__.py`)
- Agent controller → Web actions: dispatches actions (evidence: `src/agent/web/__init__.py`)
- Agent controller → Episodic memory: stores task memory (evidence: `src/agent/web/__init__.py`)
- Browser config → Browser runtime: configures
- Browser runtime → Playwright browser: controls browser
- Page context → Browser runtime: uses session
- Web actions → Page context: operates pages (evidence: `src/agent/web/tools/__init__.py`)
- DOM inspection → Playwright browser: inspects page
- Navigation history → Playwright browser: navigates history
- Tool registry → Tool definitions: executes functions (evidence: `src/tool/registry/__init__.py`)
- Agent controller → Tool registry: uses registry
- Gemini inference → LLM service: sends inference
- OpenRouter inference → LLM service: sends inference
- Episodic memory → Memory records: reads and writes (evidence: `src/memory/episodic/__init__.py`)
- Episodic memory → Model inference: routes and summarizes (evidence: `src/memory/episodic/__init__.py`)
- Embedding providers → LLM service: requests embeddings
- Vector stores → Embedding providers: uses vectors
- Speech input → Model inference: transcribes audio (evidence: `src/speech/__init__.py`)
- Agent controller → User: returns response
