How personalaiengines/artha-terminal works
ARTHA is a self-hosted Indian-markets research terminal. A user explores market, stock, F&O, portfolio, and AI-analysis views; the web client requests backend data and presents sourced results. The backend combines stored and live market data with deterministic analysis, while the AI analyst narrates tool-returned facts. The README documents live-feed fallback, read-only broker access, charting, risk engines, and scheduled ingestion. Some links below rely on README documentation or SOURCE INDEX references; unsampled implementations are represented only at supported subsystem paths.
Main entry points: server.py JSON and WS API · orchestration.py AI orchestration · tools.py Analyst tools · page.tsx Research pages
Components 21
Web experience
- Research pages
web/app/(portal)/dashboard/page.tsx - Charts
web/components/widgets/kline-chart.tsx - Web API routes
web/app/api/ai/route.ts
API and orchestration
- JSON and WS API
api/server.py - Live socket
api/ws.py - AI orchestration
agent/orchestration.py - Grounding prompts
agent/prompts.py - Analyst tools
agent/tools.py - Provider routing
agent/llm_client.py
Research engines
- Stock research
services/stock_data.py - F&O analysis
services/fno_analysis.py - F&O orchestration
services/fno_service.py - Risk engines
engines/red_flags.py - News and search
services/market_news.py
Market data
- Broker portfolio
services/upstox.py - Market feeds
services/upstox_stream.py - Live fallback
services/last_good.py - Scheduled ingestion
ingestion/scheduler.py
Data foundation
- SQLite store
db/__init__.py - Configuration
config.py
Other components
- Researcher
Connections 26
- Researcher → Research pages: explores
README.md - Research pages → Charts: views charts
README.md - Research pages → Web API routes: requests data
- Web API routes → JSON and WS API: calls API
- JSON and WS API → Stock research: routes analysis
api/server.py - JSON and WS API → F&O orchestration: routes F&O
api/server.py - JSON and WS API → News and search: routes news
api/server.py - JSON and WS API → AI orchestration: runs analyst
api/server.py - JSON and WS API → Live socket: serves sockets
api/server.py - Live socket → Market feeds: streams ticks
api/ws.py - AI orchestration → Grounding prompts: builds prompts
agent/orchestration.py - AI orchestration → Provider routing: requests completion
agent/orchestration.py - AI orchestration → Analyst tools: dispatches tools
agent/orchestration.py - Analyst tools → Stock research: reads snapshots
agent/tools.py - Analyst tools → Risk engines: runs scans
agent/tools.py - Analyst tools → News and search: searches sources
agent/tools.py - F&O orchestration → F&O analysis: analyzes chain
services/fno_service.py - F&O orchestration → Broker portfolio: fetches options
services/fno_service.py - JSON and WS API → Broker portfolio: reads broker book
README.md - JSON and WS API → Live fallback: serves stale values
README.md - Scheduled ingestion → SQLite store: records jobs
ingestion/scheduler.py - Scheduled ingestion → Configuration: loads settings
ingestion/scheduler.py - JSON and WS API → SQLite store: reads market data
api/server.py - Market feeds → Live fallback: supports fallback
- Stock research → SQLite store: reads records
services/stock_data.py - Provider routing → Configuration: loads providers
agent/llm_client.py