# itanishqshelar/vectorvault architecture

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

- Interactive diagram: https://gitdiagram.com/itanishqshelar/vectorvault
- Repository: https://github.com/itanishqshelar/vectorvault

## Overview

VectorVault is a document-grounded AI assistant with upload and Google-source ingestion, semantic search, chat, source inspection, voice interaction, and ticket/CRM workflows. Its main path is upload → parse and chunk → embed and store → retrieve context → stream a Gemini answer with source references. The sampled routes establish the ingestion, retrieval, session, and Google-sync wiring; several UI and conflict-resolution details are documented but their implementation was not sampled, so those links are shown only where supported.

Main entry points: [`src/lib/supabase.js`](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/supabase.js) (Storage operations), [`src/app/api/fetch/drive/route.js`](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/fetch/drive/route.js) (Drive sync), [`src/lib/gemini.js`](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/gemini.js) (Gemini services), [`src/app/api/ingest/process/route.js`](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ingest/process/route.js) (Ingest processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_home["Main app<br/>[page.js]"]
  node_chat["Chat interface<br/>[ChatInterface.jsx]"]
  node_upload["Upload panel<br/>[UploadPanel.jsx]"]
  node_viewer["Source viewer<br/>[DocumentViewer.jsx]"]
  node_searchui["Search modal<br/>[SearchModal.jsx]"]
  node_voiceui["Voice interface<br/>[LiveVoiceOrb.jsx]"]
  node_crm["CRM page<br/>[page.jsx]"]
end

subgraph group_knowledge["Knowledge pipeline"]
  node_uploadapi["Upload endpoint<br/>[route.js]"]
  node_processor["Ingest processor<br/>[route.js]"]
  node_parsers["File parsers"]
  node_chunker["Chunking<br/>[chunker.js]"]
  node_supabase["Storage operations<br/>[supabase.js]"]
  node_vectorstore[("Supabase store")]
end

subgraph group_assistant["Assistant workflows"]
  node_ask["Chat endpoint<br/>[route.js]"]
  node_search["Search endpoint<br/>[route.js]"]
  node_document["Document endpoint<br/>[route.js]"]
  node_sessions["Chat sessions<br/>[route.js]"]
  node_conflicts["Conflict handling<br/>[conflict.js]"]
  node_tickets["Ticket endpoints<br/>[route.js]"]
end

subgraph group_integrations["External integrations"]
  node_gemini["Gemini services<br/>[gemini.js]"]
  node_geminiservice{{"Google Gemini"}}
  node_drive["Drive sync<br/>[route.js]"]
  node_gmail["Gmail sync<br/>[route.js]"]
  node_googleauth["Google OAuth<br/>[googleAuth.js]"]
  node_google{{"Google Drive / Gmail"}}
  node_transcribe["Transcription endpoint<br/>[route.js]"]
  node_groq{{"Groq transcription"}}
end

node_user(("User"))

node_user -->|"opens"| node_home
node_home -->|"shows"| node_chat
node_home -->|"shows"| node_upload
node_user -->|"selects files"| node_upload
node_upload -->|"uploads"| node_uploadapi
node_uploadapi -->|"stores file"| node_supabase
node_uploadapi -->|"returns source ID"| node_processor
node_processor -->|"loads file"| node_supabase
node_processor -->|"parses"| node_parsers
node_processor -->|"chunks text"| node_chunker
node_processor -->|"requests embeddings"| node_gemini
node_processor -->|"inserts chunks"| node_supabase
node_supabase -->|"reads / writes"| node_vectorstore
node_chat -->|"submits query"| node_ask
node_ask -->|"embeds query"| node_gemini
node_ask -->|"searches vectors"| node_supabase
node_ask -->|"requests answer"| node_gemini
node_gemini -->|"calls"| node_geminiservice
node_searchui -->|"submits query"| node_search
node_search -->|"embeds query"| node_gemini
node_search -->|"searches vectors"| node_supabase
node_viewer -->|"loads source"| node_document
node_document -->|"reads source and chunks"| node_supabase
node_chat -->|"saves messages"| node_sessions
node_sessions -->|"reads / writes"| node_supabase
node_ask -.->|"checks conflicts"| node_conflicts
node_user -->|"chooses Drive files"| node_drive
node_drive -->|"gets OAuth tokens"| node_googleauth
node_drive -->|"lists / downloads"| node_google
node_drive -->|"parses files"| node_parsers
node_drive -->|"chunks text"| node_chunker
node_drive -->|"requests embeddings"| node_gemini
node_drive -->|"stores sources and chunks"| node_supabase
node_user -->|"starts sync"| node_gmail
node_gmail -->|"gets OAuth tokens"| node_googleauth
node_gmail -->|"lists / fetches messages"| node_google
node_gmail -->|"chunks text"| node_chunker
node_gmail -->|"embeds and classifies"| node_gemini
node_gmail -->|"stores sources and tickets"| node_supabase
node_crm -->|"manages tickets"| node_tickets
node_user -->|"speaks"| node_voiceui
node_voiceui -->|"sends audio"| node_transcribe
node_transcribe -->|"transcribes"| node_groq
node_voiceui -.->|"asks with transcript"| node_ask

click node_home "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/page.js"
click node_chat "https://github.com/itanishqshelar/vectorvault/blob/main/src/components/ChatInterface.jsx"
click node_upload "https://github.com/itanishqshelar/vectorvault/blob/main/src/components/UploadPanel.jsx"
click node_viewer "https://github.com/itanishqshelar/vectorvault/blob/main/src/components/DocumentViewer.jsx"
click node_searchui "https://github.com/itanishqshelar/vectorvault/blob/main/src/components/SearchModal.jsx"
click node_voiceui "https://github.com/itanishqshelar/vectorvault/blob/main/src/components/LiveVoiceOrb.jsx"
click node_crm "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/crm/page.jsx"
click node_uploadapi "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ingest/route.js"
click node_processor "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ingest/process/route.js"
click node_parsers "https://github.com/itanishqshelar/vectorvault/tree/main/src/lib/parsers"
click node_chunker "https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/chunker.js"
click node_supabase "https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/supabase.js"
click node_ask "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ask/route.js"
click node_search "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/search/route.js"
click node_document "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/document/route.js"
click node_sessions "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/sessions/route.js"
click node_conflicts "https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/conflict.js"
click node_gemini "https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/gemini.js"
click node_drive "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/fetch/drive/route.js"
click node_gmail "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/fetch/gmail/route.js"
click node_googleauth "https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/googleAuth.js"
click node_tickets "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/tickets/route.js"
click node_transcribe "https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/transcribe/route.js"

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_home,node_chat,node_upload,node_viewer,node_searchui,node_voiceui,node_crm,node_user toneBlue
class node_uploadapi,node_processor,node_parsers,node_chunker,node_supabase,node_vectorstore toneAmber
class node_ask,node_search,node_document,node_sessions,node_conflicts,node_tickets toneMint
class node_gemini,node_geminiservice,node_drive,node_gmail,node_googleauth,node_google,node_transcribe,node_groq toneRose
```

## Components

### User experience

- [Main app](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/page.js): `src/app/page.js`
- [Chat interface](https://github.com/itanishqshelar/vectorvault/blob/main/src/components/ChatInterface.jsx): `src/components/ChatInterface.jsx`
- [Upload panel](https://github.com/itanishqshelar/vectorvault/blob/main/src/components/UploadPanel.jsx): `src/components/UploadPanel.jsx`
- [Source viewer](https://github.com/itanishqshelar/vectorvault/blob/main/src/components/DocumentViewer.jsx): `src/components/DocumentViewer.jsx`
- [Search modal](https://github.com/itanishqshelar/vectorvault/blob/main/src/components/SearchModal.jsx): `src/components/SearchModal.jsx`
- [Voice interface](https://github.com/itanishqshelar/vectorvault/blob/main/src/components/LiveVoiceOrb.jsx): `src/components/LiveVoiceOrb.jsx`
- [CRM page](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/crm/page.jsx): `src/app/crm/page.jsx`

### Knowledge pipeline

- [Upload endpoint](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ingest/route.js): `src/app/api/ingest/route.js`
- [Ingest processor](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ingest/process/route.js): `src/app/api/ingest/process/route.js`
- [File parsers](https://github.com/itanishqshelar/vectorvault/tree/main/src/lib/parsers): `src/lib/parsers`
- [Chunking](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/chunker.js): `src/lib/chunker.js`
- [Storage operations](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- **Supabase store**

### Assistant workflows

- [Chat endpoint](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/ask/route.js): `src/app/api/ask/route.js`
- [Search endpoint](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/search/route.js): `src/app/api/search/route.js`
- [Document endpoint](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/document/route.js): `src/app/api/document/route.js`
- [Chat sessions](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/sessions/route.js): `src/app/api/sessions/route.js`
- [Conflict handling](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/conflict.js): `src/lib/conflict.js`
- [Ticket endpoints](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/tickets/route.js): `src/app/api/tickets/route.js`

### External integrations

- [Gemini services](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/gemini.js): `src/lib/gemini.js`
- **Google Gemini**
- [Drive sync](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/fetch/drive/route.js): `src/app/api/fetch/drive/route.js`
- [Gmail sync](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/fetch/gmail/route.js): `src/app/api/fetch/gmail/route.js`
- [Google OAuth](https://github.com/itanishqshelar/vectorvault/blob/main/src/lib/googleAuth.js): `src/lib/googleAuth.js`
- **Google Drive / Gmail**
- [Transcription endpoint](https://github.com/itanishqshelar/vectorvault/blob/main/src/app/api/transcribe/route.js): `src/app/api/transcribe/route.js`
- **Groq transcription**

### Other components

- **User**

## Connections

- User → Main app: opens
- Main app → Chat interface: shows
- Main app → Upload panel: shows
- User → Upload panel: selects files
- Upload panel → Upload endpoint: uploads
- Upload endpoint → Storage operations: stores file
- Upload endpoint → Ingest processor: returns source ID
- Ingest processor → Storage operations: loads file
- Ingest processor → File parsers: parses
- Ingest processor → Chunking: chunks text
- Ingest processor → Gemini services: requests embeddings
- Ingest processor → Storage operations: inserts chunks
- Storage operations → Supabase store: reads / writes
- Chat interface → Chat endpoint: submits query
- Chat endpoint → Gemini services: embeds query
- Chat endpoint → Storage operations: searches vectors
- Chat endpoint → Gemini services: requests answer
- Gemini services → Google Gemini: calls
- Search modal → Search endpoint: submits query
- Search endpoint → Gemini services: embeds query
- Search endpoint → Storage operations: searches vectors
- Source viewer → Document endpoint: loads source
- Document endpoint → Storage operations: reads source and chunks
- Chat interface → Chat sessions: saves messages
- Chat sessions → Storage operations: reads / writes
- Chat endpoint → Conflict handling: checks conflicts
- User → Drive sync: chooses Drive files
- Drive sync → Google OAuth: gets OAuth tokens
- Drive sync → Google Drive / Gmail: lists / downloads
- Drive sync → File parsers: parses files
- Drive sync → Chunking: chunks text
- Drive sync → Gemini services: requests embeddings
- Drive sync → Storage operations: stores sources and chunks
- User → Gmail sync: starts sync
- Gmail sync → Google OAuth: gets OAuth tokens
- Gmail sync → Google Drive / Gmail: lists / fetches messages
- Gmail sync → Chunking: chunks text
- Gmail sync → Gemini services: embeds and classifies
- Gmail sync → Storage operations: stores sources and tickets
- CRM page → Ticket endpoints: manages tickets
- User → Voice interface: speaks
- Voice interface → Transcription endpoint: sends audio
- Transcription endpoint → Groq transcription: transcribes
- Voice interface → Chat endpoint: asks with transcript
