# lakshaydhingra6/artha architecture

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

- Interactive diagram: https://gitdiagram.com/lakshaydhingra6/artha
- Repository: https://github.com/lakshaydhingra6/artha

## Overview

Artha-Agent is a Streamlit research assistant for Indian equities. Users ask questions in the dashboard; the agent selects tools (or uses deterministic intent handling), gathers market, technical, memory, knowledge-store, or IPO information, and returns a response with tool traces. The dashboard also presents market and chart views and lets users add knowledge documents. The graph includes documented capabilities whose implementation excerpts were not sampled; their internal relationships are omitted where evidence is unavailable.

Main entry points: [`core/agent.py`](https://github.com/lakshaydhingra6/artha/blob/main/core/agent.py) (Research agent), [`tools/stock_tools.py`](https://github.com/lakshaydhingra6/artha/blob/main/tools/stock_tools.py) (Stock tool registry), [`app.py`](https://github.com/lakshaydhingra6/artha/blob/main/app.py) (Streamlit dashboard), [`core/vector_store.py`](https://github.com/lakshaydhingra6/artha/blob/main/core/vector_store.py) (Company knowledge search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Research interface"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_charts["Interactive charts<br/>[app.py]"]
end

subgraph group_agent["Agent orchestration"]
  node_agent_runtime["Research agent<br/>[agent.py]"]
  node_tool_registry["Stock tool registry<br/>[stock_tools.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_market["Market research"]
  node_nse_client["Market data client<br/>[nse_client.py]"]
  node_technicals["Technical indicators<br/>[technicals.py]"]
  node_ipo_manager["IPO intelligence<br/>[ipo_manager.py]"]
  node_ipo_file["IPO dataset<br/>[ipo_data.json]"]
end

subgraph group_knowledge["Knowledge and memory"]
  node_memory["Working and persistent memory<br/>[memory_manager.py]"]
  node_sqlite[("Local SQLite state<br/>[memory_manager.py]")]
  node_knowledge_store["Company knowledge search<br/>[vector_store.py]"]
  node_knowledge_file["Knowledge documents"]
end

node_user(("Investor"))
node_nse{{"NSE market feeds"}}
node_yahoo{{"Yahoo Finance"}}
node_gemini{{"Google Gemini"}}

node_user -->|"asks research"| node_dashboard
node_dashboard -->|"submits queries"| node_agent_runtime
node_dashboard -->|"renders indicators"| node_technicals
node_dashboard -->|"adds documents"| node_knowledge_store
node_dashboard -->|"renders charts"| node_charts
node_agent_runtime -->|"dispatches tools"| node_tool_registry
node_agent_runtime -->|"records context"| node_memory
node_agent_runtime -->|"searches knowledge"| node_knowledge_store
node_agent_runtime -.->|"requests reasoning"| node_gemini
node_agent_runtime -->|"loads settings"| node_config
node_tool_registry -->|"fetches market data"| node_nse_client
node_tool_registry -->|"calculates indicators"| node_technicals
node_tool_registry -->|"manages watchlists"| node_memory
node_tool_registry -->|"searches filings"| node_knowledge_store
node_tool_registry -->|"looks up IPOs"| node_ipo_manager
node_nse_client -->|"requests quotes"| node_nse
node_nse_client -.->|"falls back to"| node_yahoo
node_memory -->|"reads and writes"| node_sqlite
node_knowledge_store -->|"loads and saves"| node_knowledge_file
node_ipo_manager -.->|"loads IPO data"| node_ipo_file

click node_dashboard "https://github.com/lakshaydhingra6/artha/blob/main/app.py"
click node_agent_runtime "https://github.com/lakshaydhingra6/artha/blob/main/core/agent.py"
click node_tool_registry "https://github.com/lakshaydhingra6/artha/blob/main/tools/stock_tools.py"
click node_config "https://github.com/lakshaydhingra6/artha/blob/main/config.py"
click node_nse_client "https://github.com/lakshaydhingra6/artha/blob/main/core/nse_client.py"
click node_technicals "https://github.com/lakshaydhingra6/artha/blob/main/core/technicals.py"
click node_charts "https://github.com/lakshaydhingra6/artha/blob/main/app.py"
click node_memory "https://github.com/lakshaydhingra6/artha/blob/main/core/memory_manager.py"
click node_sqlite "https://github.com/lakshaydhingra6/artha/blob/main/core/memory_manager.py"
click node_knowledge_store "https://github.com/lakshaydhingra6/artha/blob/main/core/vector_store.py"
click node_knowledge_file "https://github.com/lakshaydhingra6/artha/blob/main/data/knowledge_store.json"
click node_ipo_manager "https://github.com/lakshaydhingra6/artha/blob/main/core/ipo_manager.py"
click node_ipo_file "https://github.com/lakshaydhingra6/artha/blob/main/data/ipo_data.json"

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_dashboard,node_charts toneBlue
class node_agent_runtime,node_tool_registry,node_config toneAmber
class node_nse_client,node_technicals,node_ipo_manager,node_ipo_file toneMint
class node_memory,node_sqlite,node_knowledge_store,node_knowledge_file toneRose
class node_user,node_nse,node_yahoo,node_gemini toneIndigo
```

## Components

### Research interface

- [Streamlit dashboard](https://github.com/lakshaydhingra6/artha/blob/main/app.py): `app.py`
- [Interactive charts](https://github.com/lakshaydhingra6/artha/blob/main/app.py): `app.py`

### Agent orchestration

- [Research agent](https://github.com/lakshaydhingra6/artha/blob/main/core/agent.py): `core/agent.py`
- [Stock tool registry](https://github.com/lakshaydhingra6/artha/blob/main/tools/stock_tools.py): `tools/stock_tools.py`
- [Runtime configuration](https://github.com/lakshaydhingra6/artha/blob/main/config.py): `config.py`

### Market research

- [Market data client](https://github.com/lakshaydhingra6/artha/blob/main/core/nse_client.py): `core/nse_client.py`
- [Technical indicators](https://github.com/lakshaydhingra6/artha/blob/main/core/technicals.py): `core/technicals.py`
- [IPO intelligence](https://github.com/lakshaydhingra6/artha/blob/main/core/ipo_manager.py): `core/ipo_manager.py`
- [IPO dataset](https://github.com/lakshaydhingra6/artha/blob/main/data/ipo_data.json): `data/ipo_data.json`

### Knowledge and memory

- [Working and persistent memory](https://github.com/lakshaydhingra6/artha/blob/main/core/memory_manager.py): `core/memory_manager.py`
- [Local SQLite state](https://github.com/lakshaydhingra6/artha/blob/main/core/memory_manager.py): `core/memory_manager.py`
- [Company knowledge search](https://github.com/lakshaydhingra6/artha/blob/main/core/vector_store.py): `core/vector_store.py`
- [Knowledge documents](https://github.com/lakshaydhingra6/artha/blob/main/data/knowledge_store.json): `data/knowledge_store.json`

### Other components

- **Investor**
- **NSE market feeds**
- **Yahoo Finance**
- **Google Gemini**

## Connections

- Investor → Streamlit dashboard: asks research (evidence: `README.md`)
- Streamlit dashboard → Research agent: submits queries (evidence: `app.py`)
- Streamlit dashboard → Technical indicators: renders indicators (evidence: `app.py`)
- Streamlit dashboard → Company knowledge search: adds documents (evidence: `app.py`)
- Streamlit dashboard → Interactive charts: renders charts (evidence: `README.md`)
- Research agent → Stock tool registry: dispatches tools (evidence: `core/agent.py`)
- Research agent → Working and persistent memory: records context (evidence: `core/agent.py`)
- Research agent → Company knowledge search: searches knowledge (evidence: `core/agent.py`)
- Research agent → Google Gemini: requests reasoning (evidence: `README.md`)
- Research agent → Runtime configuration: loads settings (evidence: `core/agent.py`)
- Stock tool registry → Market data client: fetches market data (evidence: `tools/stock_tools.py`)
- Stock tool registry → Technical indicators: calculates indicators (evidence: `tools/stock_tools.py`)
- Stock tool registry → Working and persistent memory: manages watchlists (evidence: `tools/stock_tools.py`)
- Stock tool registry → Company knowledge search: searches filings (evidence: `tools/stock_tools.py`)
- Stock tool registry → IPO intelligence: looks up IPOs (evidence: `tools/stock_tools.py`)
- Market data client → NSE market feeds: requests quotes (evidence: `README.md`)
- Market data client → Yahoo Finance: falls back to (evidence: `README.md`)
- Working and persistent memory → Local SQLite state: reads and writes (evidence: `core/memory_manager.py`)
- Company knowledge search → Knowledge documents: loads and saves (evidence: `core/vector_store.py`)
- IPO intelligence → IPO dataset: loads IPO data
