# rohannimje/techvruk-ai-agent architecture

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

- Interactive diagram: https://gitdiagram.com/rohannimje/techvruk-ai-agent
- Repository: https://github.com/rohannimje/techvruk-ai-agent

## Overview

The product is a Streamlit research chat app: users submit questions, the agent uses Gemini to decide whether to answer directly or invoke internal-knowledge or web search, and the UI presents the answer with tool badges or a persistent styled error. The README documents model switching and cached FAISS resources. The sampled code shows the agent’s ReAct graph and knowledge-base construction; unsampled UI and tool details are represented only where documented.

Main entry points: [`agent.py`](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py) (Tool executor), [`app.py`](https://github.com/rohannimje/techvruk-ai-agent/blob/main/app.py) (Chat UI), [`dummy_data.txt`](https://github.com/rohannimje/techvruk-ai-agent/blob/main/dummy_data.txt) (Company knowledge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chat interface"]
  node_chat_ui["Chat UI<br/>[app.py]"]
  node_answer_display["Answer and errors<br/>[app.py]"]
end

subgraph group_orchestration["Agent orchestration"]
  node_run_agent["Agent entry point<br/>[agent.py]"]
  node_reasoner["Gemini reasoner<br/>[agent.py]"]
  node_router["Tool-call router<br/>[agent.py]"]
  node_tool_node["Tool executor<br/>[agent.py]"]
  node_message_state["Message history<br/>[agent.py]"]
end

subgraph group_retrieval["Knowledge retrieval"]
  node_rag_search["Internal KB search<br/>[agent.py]"]
  node_vector_store[("Cached FAISS index<br/>[agent.py]")]
  node_knowledge_base["Company knowledge<br/>[dummy_data.txt]"]
end

subgraph group_integrations["External integrations"]
  node_web_search["Live web search<br/>[agent.py]"]
end

node_user(("Research user"))
node_gemini{{"Google Gemini"}}
node_duckduckgo{{"DuckDuckGo"}}

node_user -->|"submits query"| node_chat_ui
node_chat_ui -->|"calls"| node_run_agent
node_run_agent -->|"starts graph"| node_reasoner
node_reasoner -->|"invokes model"| node_gemini
node_reasoner -->|"checks tool calls"| node_router
node_router -->|"routes tool calls"| node_tool_node
node_router -->|"ends graph"| node_run_agent
node_tool_node -->|"executes selected tool"| node_rag_search
node_tool_node -->|"executes selected tool"| node_web_search
node_rag_search -->|"searches"| node_vector_store
node_vector_store -->|"indexes text"| node_knowledge_base
node_web_search -->|"searches web"| node_duckduckgo
node_tool_node -->|"appends tool output"| node_message_state
node_message_state -->|"feeds next cycle"| node_reasoner
node_run_agent -->|"returns answer and tools"| node_answer_display
node_chat_ui -->|"renders response"| node_answer_display

click node_chat_ui "https://github.com/rohannimje/techvruk-ai-agent/blob/main/app.py"
click node_answer_display "https://github.com/rohannimje/techvruk-ai-agent/blob/main/app.py"
click node_run_agent "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_reasoner "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_router "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_tool_node "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_message_state "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_rag_search "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_vector_store "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py"
click node_knowledge_base "https://github.com/rohannimje/techvruk-ai-agent/blob/main/dummy_data.txt"
click node_web_search "https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.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_chat_ui,node_answer_display,node_user toneBlue
class node_run_agent,node_reasoner,node_router,node_tool_node,node_message_state toneAmber
class node_rag_search,node_vector_store,node_knowledge_base toneMint
class node_web_search toneRose
class node_gemini,node_duckduckgo toneIndigo
```

## Components

### Chat interface

- [Chat UI](https://github.com/rohannimje/techvruk-ai-agent/blob/main/app.py): `app.py`
- [Answer and errors](https://github.com/rohannimje/techvruk-ai-agent/blob/main/app.py): `app.py`

### Agent orchestration

- [Agent entry point](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`
- [Gemini reasoner](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`
- [Tool-call router](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`
- [Tool executor](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`
- [Message history](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`

### Knowledge retrieval

- [Internal KB search](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`
- [Cached FAISS index](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`
- [Company knowledge](https://github.com/rohannimje/techvruk-ai-agent/blob/main/dummy_data.txt): `dummy_data.txt`

### External integrations

- [Live web search](https://github.com/rohannimje/techvruk-ai-agent/blob/main/agent.py): `agent.py`

### Other components

- **Research user**
- **Google Gemini**
- **DuckDuckGo**

## Connections

- Research user → Chat UI: submits query (evidence: `README.md`)
- Chat UI → Agent entry point: calls (evidence: `README.md`)
- Agent entry point → Gemini reasoner: starts graph (evidence: `agent.py`)
- Gemini reasoner → Google Gemini: invokes model (evidence: `agent.py`)
- Gemini reasoner → Tool-call router: checks tool calls (evidence: `agent.py`)
- Tool-call router → Tool executor: routes tool calls (evidence: `agent.py`)
- Tool-call router → Agent entry point: ends graph (evidence: `agent.py`)
- Tool executor → Internal KB search: executes selected tool (evidence: `README.md`)
- Tool executor → Live web search: executes selected tool (evidence: `README.md`)
- Internal KB search → Cached FAISS index: searches (evidence: `agent.py`)
- Cached FAISS index → Company knowledge: indexes text (evidence: `agent.py`)
- Live web search → DuckDuckGo: searches web (evidence: `README.md`)
- Tool executor → Message history: appends tool output (evidence: `agent.py`)
- Message history → Gemini reasoner: feeds next cycle (evidence: `README.md`)
- Agent entry point → Answer and errors: returns answer and tools (evidence: `README.md`)
- Chat UI → Answer and errors: renders response (evidence: `app.py`)
