# ajaykarthikpogula0101/deep-agent architecture

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

- Interactive diagram: https://gitdiagram.com/ajaykarthikpogula0101/deep-agent
- Repository: https://github.com/ajaykarthikpogula0101/deep-agent

## Overview

DeependHQ Assistant is an embeddable, cited-Q&A chat service with live Zoom booking and supporting lead-management features. Visitors enter through the website widget and FastAPI service; chat retrieves grounded sources or invokes booking, then records outcomes and may notify the visitor or host. A separate documented ingestion workflow crawls site content, chunks and embeds it, and stores it for retrieval. The graph also shows booking, tracking, and email capabilities. Edges rely on the README and SOURCE INDEX references; unsampled internals are not inferred.

Main entry points: [`app/chat.py`](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/chat.py) (Chat orchestration), [`app/booking/service.py`](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/service.py) (Booking service), [`app/ingest/pipeline.py`](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/pipeline.py) (Content ingestion), [`app/main.py`](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/main.py) (FastAPI service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Visitor interface"]
  node_widget["Embeddable widget<br/>[widget.js]"]
  node_api["FastAPI service<br/>[main.py]"]
end

subgraph group_qa["Knowledge Q&amp;A"]
  node_chat["Chat orchestration<br/>[chat.py]"]
  node_ingest["Content ingestion<br/>[pipeline.py]"]
  node_sources["Site crawling<br/>[sources.py]"]
  node_chunker["Document chunking<br/>[chunker.py]"]
  node_embed["Local embeddings<br/>[embeddings.py]"]
  node_retrieve["Vector retrieval<br/>[retrieve.py]"]
  node_prompts["Answer prompts<br/>[prompts.py]"]
  node_database[("Postgres and pgvector<br/>[db.py]")]
end

subgraph group_booking["Booking"]
  node_bookingflow["Booking flow<br/>[flow.py]"]
  node_bookingservice["Booking service<br/>[service.py]"]
  node_availability["Slot availability<br/>[availability.py]"]
  node_zoom["Zoom integration<br/>[zoom.py]"]
  node_bookings["Booking records<br/>[store_bookings.py]"]
end

subgraph group_operations["Lead operations"]
  node_inbox["Conversation inbox<br/>[inbox.py]"]
  node_tracking["Session tracking<br/>[tracking.py]"]
  node_templates["Email templates<br/>[templates.py]"]
  node_email["Booking email<br/>[email.py]"]
  node_mailer["Outbound mailer<br/>[mailer.py]"]
end

node_visitor(("Website visitor"))

node_visitor -->|"uses"| node_widget
node_widget -.->|"connects to"| node_api
node_api -->|"routes chat"| node_chat
node_chat -->|"retrieves sources"| node_retrieve
node_chat -->|"builds answers"| node_prompts
node_chat -->|"invokes booking"| node_bookingservice
node_chat -->|"uses booking tools"| node_bookingflow
node_chat -->|"records turns"| node_inbox
node_ingest -->|"fetches pages"| node_sources
node_ingest -->|"chunks documents"| node_chunker
node_ingest -->|"embeds chunks"| node_embed
node_ingest -->|"writes vectors"| node_database
node_retrieve -->|"embeds query"| node_embed
node_retrieve -->|"queries vectors"| node_database
node_bookingflow -->|"checks slots"| node_availability
node_bookingflow -->|"delegates booking"| node_bookingservice
node_bookingflow -->|"reads bookings"| node_database
node_bookingservice -->|"checks availability"| node_availability
node_bookingservice -->|"books with Zoom"| node_zoom
node_bookingservice -->|"stores lead"| node_bookings
node_bookingservice -->|"sends host brief"| node_email
node_email -->|"renders messages"| node_templates
node_email -->|"queues mail"| node_mailer
node_api -->|"handles tracking"| node_tracking
node_api -->|"serves inbox"| node_inbox

click node_widget "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/static/widget.js"
click node_api "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/main.py"
click node_chat "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/chat.py"
click node_ingest "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/pipeline.py"
click node_sources "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/sources.py"
click node_chunker "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/chunker.py"
click node_embed "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/embeddings.py"
click node_retrieve "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/rag/retrieve.py"
click node_prompts "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/rag/prompts.py"
click node_database "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/db.py"
click node_bookingflow "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/flow.py"
click node_bookingservice "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/service.py"
click node_availability "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/availability.py"
click node_zoom "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/zoom.py"
click node_bookings "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/store_bookings.py"
click node_inbox "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/inbox.py"
click node_tracking "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/tracking.py"
click node_templates "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/templates.py"
click node_email "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/email.py"
click node_mailer "https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/mailer.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_widget,node_api toneBlue
class node_chat,node_ingest,node_sources,node_chunker,node_embed,node_retrieve,node_prompts,node_database toneAmber
class node_bookingflow,node_bookingservice,node_availability,node_zoom,node_bookings toneMint
class node_inbox,node_tracking,node_templates,node_email,node_mailer toneRose
class node_visitor toneIndigo
```

## Components

### Visitor interface

- [Embeddable widget](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/static/widget.js): `static/widget.js`
- [FastAPI service](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/main.py): `app/main.py`

### Knowledge Q&A

- [Chat orchestration](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/chat.py): `app/chat.py`
- [Content ingestion](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/pipeline.py): `app/ingest/pipeline.py`
- [Site crawling](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/sources.py): `app/ingest/sources.py`
- [Document chunking](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/ingest/chunker.py): `app/ingest/chunker.py`
- [Local embeddings](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/embeddings.py): `app/embeddings.py`
- [Vector retrieval](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/rag/retrieve.py): `app/rag/retrieve.py`
- [Answer prompts](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/rag/prompts.py): `app/rag/prompts.py`
- [Postgres and pgvector](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/db.py): `app/db.py`

### Booking

- [Booking flow](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/flow.py): `app/booking/flow.py`
- [Booking service](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/service.py): `app/booking/service.py`
- [Slot availability](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/availability.py): `app/booking/availability.py`
- [Zoom integration](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/zoom.py): `app/booking/zoom.py`
- [Booking records](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/store_bookings.py): `app/store_bookings.py`

### Lead operations

- [Conversation inbox](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/inbox.py): `app/inbox.py`
- [Session tracking](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/tracking.py): `app/tracking.py`
- [Email templates](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/templates.py): `app/templates.py`
- [Booking email](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/booking/email.py): `app/booking/email.py`
- [Outbound mailer](https://github.com/ajaykarthikpogula0101/deep-agent/blob/main/app/mailer.py): `app/mailer.py`

### Other components

- **Website visitor**

## Connections

- Website visitor → Embeddable widget: uses (evidence: `README.md`)
- Embeddable widget → FastAPI service: connects to
- FastAPI service → Chat orchestration: routes chat (evidence: `app/chat.py`)
- Chat orchestration → Vector retrieval: retrieves sources (evidence: `app/chat.py`)
- Chat orchestration → Answer prompts: builds answers (evidence: `app/chat.py`)
- Chat orchestration → Booking service: invokes booking (evidence: `app/chat.py`)
- Chat orchestration → Booking flow: uses booking tools (evidence: `app/chat.py`)
- Chat orchestration → Conversation inbox: records turns (evidence: `app/chat.py`)
- Content ingestion → Site crawling: fetches pages (evidence: `app/ingest/pipeline.py`)
- Content ingestion → Document chunking: chunks documents (evidence: `app/ingest/pipeline.py`)
- Content ingestion → Local embeddings: embeds chunks (evidence: `app/ingest/pipeline.py`)
- Content ingestion → Postgres and pgvector: writes vectors (evidence: `app/ingest/pipeline.py`)
- Vector retrieval → Local embeddings: embeds query (evidence: `app/rag/retrieve.py`)
- Vector retrieval → Postgres and pgvector: queries vectors (evidence: `app/rag/retrieve.py`)
- Booking flow → Slot availability: checks slots (evidence: `app/booking/flow.py`)
- Booking flow → Booking service: delegates booking (evidence: `app/booking/flow.py`)
- Booking flow → Postgres and pgvector: reads bookings (evidence: `app/booking/flow.py`)
- Booking service → Slot availability: checks availability (evidence: `app/booking/service.py`)
- Booking service → Zoom integration: books with Zoom (evidence: `app/booking/service.py`)
- Booking service → Booking records: stores lead (evidence: `app/booking/service.py`)
- Booking service → Booking email: sends host brief (evidence: `app/booking/service.py`)
- Booking email → Email templates: renders messages (evidence: `app/booking/email.py`)
- Booking email → Outbound mailer: queues mail (evidence: `app/booking/email.py`)
- FastAPI service → Session tracking: handles tracking (evidence: `app/main.py`)
- FastAPI service → Conversation inbox: serves inbox (evidence: `app/main.py`)
