# vighneshmane07/jarvisx architecture

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

- Interactive diagram: https://gitdiagram.com/vighneshmane07/jarvisx
- Repository: https://github.com/vighneshmane07/jarvisx

## Overview

Jarvis AI is a document-aware assistant with a React/TanStack frontend and FastAPI backend. Users sign up or log in, then chat with the assistant, which can use conversational memory, tools, and retrieved PDF context; users can also upload PDFs and ask document-specific questions. The map includes the documented frontend experience and backend subsystems. Some frontend-to-API links are based on README descriptions; unsampled implementation details are not inferred.

Main entry points: [`app/rag/rag_pipeline.py`](https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/rag_pipeline.py) (RAG pipeline), [`app/agents/jarvis_agent.py`](https://github.com/vighneshmane07/jarvisx/blob/main/app/agents/jarvis_agent.py) (Jarvis agent), [`app/api/auth_api.py`](https://github.com/vighneshmane07/jarvisx/blob/main/app/api/auth_api.py) (Authentication API), [`app/api/chat.py`](https://github.com/vighneshmane07/jarvisx/blob/main/app/api/chat.py) (Chat API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_webapp["Web application"]
  node_router["Frontend router<br/>[router.tsx]"]
  node_route_tree["Route tree<br/>[routeTree.gen.ts]"]
  node_dashboard["Chat dashboard<br/>[dashboard.tsx]"]
  node_auth_views["Login and signup"]
end

subgraph group_api["API and identity"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_auth_api["Authentication API<br/>[auth_api.py]"]
  node_jwt["JWT tokens<br/>[jwt_handler.py]"]
  node_chat_api["Chat API<br/>[chat.py]"]
  node_database[("SQL database<br/>[database.py]")]
  node_user_model["User records<br/>[user_model.py]"]
  node_chat_model["Chat records<br/>[chat_model.py]"]
end

subgraph group_assistant["Assistant runtime"]
  node_agent["Jarvis agent<br/>[jarvis_agent.py]"]
  node_llm["LLM service<br/>[llm_service.py]"]
  node_tools["Agent tools"]
  node_web_search["Web search tool<br/>[web_search_tool.py]"]
end

subgraph group_knowledge["Document knowledge"]
  node_rag_api["PDF API<br/>[rag_api.py]"]
  node_rag_pipeline["RAG pipeline<br/>[rag_pipeline.py]"]
  node_pdf_loader["PDF loader<br/>[pdf_loader.py]"]
  node_vector_store[("Vector store<br/>[vector_store.py]")]
  node_retriever["Document retriever<br/>[retriever.py]"]
end

node_user(("User"))
node_openrouter["OpenRouter"]

node_user -->|"uses"| node_webapp
node_webapp -.->|"routes through"| node_router
node_router -->|"configures"| node_route_tree
node_route_tree -->|"registers"| node_dashboard
node_route_tree -->|"registers"| node_auth_views
node_dashboard -->|"streams chat"| node_chat_api
node_dashboard -->|"uploads and queries"| node_rag_api
node_auth_views -->|"authenticates"| node_auth_api
node_api_app -->|"registers"| node_chat_api
node_api_app -->|"registers"| node_auth_api
node_api_app -->|"registers"| node_rag_api
node_auth_api -->|"gets session"| node_database
node_auth_api -->|"queries and saves"| node_user_model
node_auth_api -->|"creates token"| node_jwt
node_user_model -->|"uses base"| node_database
node_chat_api -->|"invokes"| node_agent
node_chat_api -->|"gets session"| node_database
node_chat_api -->|"uses records"| node_chat_model
node_chat_model -->|"uses base"| node_database
node_agent -->|"calls tools"| node_tools
node_agent -->|"retrieves context"| node_retriever
node_agent -->|"generates response"| node_llm
node_llm -->|"requests completion"| node_openrouter
node_agent -.->|"may use"| node_web_search
node_rag_api -->|"uploads and asks"| node_rag_pipeline
node_rag_pipeline -->|"loads PDF"| node_pdf_loader
node_rag_pipeline -->|"creates store"| node_vector_store
node_rag_pipeline -->|"retrieves chunks"| node_retriever
node_rag_pipeline -->|"generates answer"| node_llm
node_retriever -->|"gets vector store"| node_rag_pipeline

click node_webapp "https://github.com/vighneshmane07/jarvisx/tree/main/Frontend/src/routes"
click node_router "https://github.com/vighneshmane07/jarvisx/blob/main/Frontend/src/router.tsx"
click node_route_tree "https://github.com/vighneshmane07/jarvisx/blob/main/Frontend/src/routeTree.gen.ts"
click node_dashboard "https://github.com/vighneshmane07/jarvisx/blob/main/Frontend/src/routes/dashboard.tsx"
click node_auth_views "https://github.com/vighneshmane07/jarvisx/tree/main/Frontend/src/routes"
click node_api_app "https://github.com/vighneshmane07/jarvisx/blob/main/app/main.py"
click node_auth_api "https://github.com/vighneshmane07/jarvisx/blob/main/app/api/auth_api.py"
click node_jwt "https://github.com/vighneshmane07/jarvisx/blob/main/app/auth/jwt_handler.py"
click node_chat_api "https://github.com/vighneshmane07/jarvisx/blob/main/app/api/chat.py"
click node_database "https://github.com/vighneshmane07/jarvisx/blob/main/app/database.py"
click node_user_model "https://github.com/vighneshmane07/jarvisx/blob/main/app/models/user_model.py"
click node_chat_model "https://github.com/vighneshmane07/jarvisx/blob/main/app/models/chat_model.py"
click node_agent "https://github.com/vighneshmane07/jarvisx/blob/main/app/agents/jarvis_agent.py"
click node_llm "https://github.com/vighneshmane07/jarvisx/blob/main/app/services/llm_service.py"
click node_tools "https://github.com/vighneshmane07/jarvisx/tree/main/app/tools"
click node_web_search "https://github.com/vighneshmane07/jarvisx/blob/main/app/tools/web_search_tool.py"
click node_rag_api "https://github.com/vighneshmane07/jarvisx/blob/main/app/api/rag_api.py"
click node_rag_pipeline "https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/rag_pipeline.py"
click node_pdf_loader "https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/pdf_loader.py"
click node_vector_store "https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/vector_store.py"
click node_retriever "https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/retriever.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_webapp,node_router,node_route_tree,node_dashboard,node_auth_views,node_user toneBlue
class node_api_app,node_auth_api,node_jwt,node_chat_api,node_database,node_user_model,node_chat_model toneAmber
class node_agent,node_llm,node_tools,node_web_search,node_openrouter toneMint
class node_rag_api,node_rag_pipeline,node_pdf_loader,node_vector_store,node_retriever toneRose
```

## Components

### Frontend experience

- [Web application](https://github.com/vighneshmane07/jarvisx/tree/main/Frontend/src/routes): `Frontend/src/routes`
- [Frontend router](https://github.com/vighneshmane07/jarvisx/blob/main/Frontend/src/router.tsx): `Frontend/src/router.tsx`
- [Route tree](https://github.com/vighneshmane07/jarvisx/blob/main/Frontend/src/routeTree.gen.ts): `Frontend/src/routeTree.gen.ts`
- [Chat dashboard](https://github.com/vighneshmane07/jarvisx/blob/main/Frontend/src/routes/dashboard.tsx): `Frontend/src/routes/dashboard.tsx`
- [Login and signup](https://github.com/vighneshmane07/jarvisx/tree/main/Frontend/src/routes): `Frontend/src/routes`

### API and identity

- [FastAPI application](https://github.com/vighneshmane07/jarvisx/blob/main/app/main.py): `app/main.py`
- [Authentication API](https://github.com/vighneshmane07/jarvisx/blob/main/app/api/auth_api.py): `app/api/auth_api.py`
- [JWT tokens](https://github.com/vighneshmane07/jarvisx/blob/main/app/auth/jwt_handler.py): `app/auth/jwt_handler.py`
- [Chat API](https://github.com/vighneshmane07/jarvisx/blob/main/app/api/chat.py): `app/api/chat.py`
- [SQL database](https://github.com/vighneshmane07/jarvisx/blob/main/app/database.py): `app/database.py`
- [User records](https://github.com/vighneshmane07/jarvisx/blob/main/app/models/user_model.py): `app/models/user_model.py`
- [Chat records](https://github.com/vighneshmane07/jarvisx/blob/main/app/models/chat_model.py): `app/models/chat_model.py`

### Assistant runtime

- [Jarvis agent](https://github.com/vighneshmane07/jarvisx/blob/main/app/agents/jarvis_agent.py): `app/agents/jarvis_agent.py`
- [LLM service](https://github.com/vighneshmane07/jarvisx/blob/main/app/services/llm_service.py): `app/services/llm_service.py`
- [Agent tools](https://github.com/vighneshmane07/jarvisx/tree/main/app/tools): `app/tools`
- [Web search tool](https://github.com/vighneshmane07/jarvisx/blob/main/app/tools/web_search_tool.py): `app/tools/web_search_tool.py`

### Document knowledge

- [PDF API](https://github.com/vighneshmane07/jarvisx/blob/main/app/api/rag_api.py): `app/api/rag_api.py`
- [RAG pipeline](https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/rag_pipeline.py): `app/rag/rag_pipeline.py`
- [PDF loader](https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/pdf_loader.py): `app/rag/pdf_loader.py`
- [Vector store](https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/vector_store.py): `app/rag/vector_store.py`
- [Document retriever](https://github.com/vighneshmane07/jarvisx/blob/main/app/rag/retriever.py): `app/rag/retriever.py`

### Other components

- **User**
- **OpenRouter**

## Connections

- User → Web application: uses
- Web application → Frontend router: routes through
- Frontend router → Route tree: configures (evidence: `Frontend/src/router.tsx`)
- Route tree → Chat dashboard: registers (evidence: `Frontend/src/routeTree.gen.ts`)
- Route tree → Login and signup: registers (evidence: `Frontend/src/routeTree.gen.ts`)
- Chat dashboard → Chat API: streams chat
- Chat dashboard → PDF API: uploads and queries
- Login and signup → Authentication API: authenticates
- FastAPI application → Chat API: registers (evidence: `app/main.py`)
- FastAPI application → Authentication API: registers (evidence: `app/main.py`)
- FastAPI application → PDF API: registers (evidence: `app/main.py`)
- Authentication API → SQL database: gets session (evidence: `app/api/auth_api.py`)
- Authentication API → User records: queries and saves (evidence: `app/api/auth_api.py`)
- Authentication API → JWT tokens: creates token (evidence: `app/api/auth_api.py`)
- User records → SQL database: uses base (evidence: `app/models/user_model.py`)
- Chat API → Jarvis agent: invokes (evidence: `app/api/chat.py`)
- Chat API → SQL database: gets session (evidence: `app/api/chat.py`)
- Chat API → Chat records: uses records (evidence: `app/api/chat.py`)
- Chat records → SQL database: uses base (evidence: `app/models/chat_model.py`)
- Jarvis agent → Agent tools: calls tools (evidence: `app/agents/jarvis_agent.py`)
- Jarvis agent → Document retriever: retrieves context (evidence: `app/agents/jarvis_agent.py`)
- Jarvis agent → LLM service: generates response (evidence: `app/agents/jarvis_agent.py`)
- LLM service → OpenRouter: requests completion (evidence: `app/services/llm_service.py`)
- Jarvis agent → Web search tool: may use
- PDF API → RAG pipeline: uploads and asks (evidence: `app/api/rag_api.py`)
- RAG pipeline → PDF loader: loads PDF (evidence: `app/rag/rag_pipeline.py`)
- RAG pipeline → Vector store: creates store (evidence: `app/rag/rag_pipeline.py`)
- RAG pipeline → Document retriever: retrieves chunks (evidence: `app/rag/rag_pipeline.py`)
- RAG pipeline → LLM service: generates answer (evidence: `app/rag/rag_pipeline.py`)
- Document retriever → RAG pipeline: gets vector store (evidence: `app/rag/retriever.py`)
