# abhishek-gupta18/continumai architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek-gupta18/continumai
- Repository: https://github.com/abhishek-gupta18/continumai

## Overview

ContinumAI is an Express LLM gateway: clients submit normalized chat requests, the route builds conversation context, tries configured model providers, records the outcome, and returns a normalized response. Its implemented memory layer supports file storage and a PostgreSQL configuration path. The repository also contains a separate Proventa landing-page preview. The README describes Claude failover, but the sampled provider registry configures OpenAI and Gemini; unsampled PostgreSQL details and landing-page behavior are not expanded here.

Main entry points: [`server.js`](https://github.com/abhishek-gupta18/continumai/blob/main/server.js) (Express Server), [`routes/chat.js`](https://github.com/abhishek-gupta18/continumai/blob/main/routes/chat.js) (Chat Handler), [`providers/index.js`](https://github.com/abhishek-gupta18/continumai/blob/main/providers/index.js) (Provider Registry), [`providers/openai.js`](https://github.com/abhishek-gupta18/continumai/blob/main/providers/openai.js) (OpenAI Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["Gateway API"]
  node_server["Express Server<br/>[server.js]"]
  node_chat["Chat Handler<br/>[chat.js]"]
end

subgraph group_providers["Model Providers"]
  node_registry["Provider Registry<br/>[index.js]"]
  node_openai["OpenAI Adapter<br/>[openai.js]"]
  node_gemini["Gemini Adapter<br/>[gemini.js]"]
  node_claude["Claude Adapter<br/>[claude.js]"]
  node_classifier["Error Classifier<br/>[errorClassifier.js]"]
end

subgraph group_memory["Conversation Memory"]
  node_memory["Memory Coordinator<br/>[memory.js]"]
  node_filecompose["File Memory Setup<br/>[store.js]"]
  node_filestore[("File Session Store<br/>[fileStore.js]")]
  node_pgpool["Postgres Pool<br/>[pgPool.js]"]
  node_pgstore[("Postgres Store<br/>[pgStore.js]")]
end

subgraph group_preview["Proventa Preview"]
  node_main["UI Bootstrap<br/>[main.tsx]"]
  node_app["Landing App<br/>[App.tsx]"]
  node_landing["Proventa Landing"]
end

node_client(("API Client"))
node_modelservices{{"LLM Services"}}
node_postgres[("PostgreSQL")]
node_browser(("Browser Visitor"))

node_client -->|"sends chat"| node_server
node_server -->|"routes POST"| node_chat
node_server -->|"builds providers"| node_registry
node_server -->|"creates pool"| node_pgpool
node_server -->|"creates store"| node_pgstore
node_chat -->|"builds providers"| node_registry
node_chat -->|"loads context, saves turns"| node_memory
node_chat -->|"dispatches"| node_openai
node_chat -->|"dispatches"| node_gemini
node_registry -->|"registers"| node_openai
node_registry -->|"registers"| node_gemini
node_openai -->|"classifies errors"| node_classifier
node_gemini -->|"classifies errors"| node_classifier
node_openai -->|"calls"| node_modelservices
node_gemini -->|"calls"| node_modelservices
node_filecompose -->|"creates"| node_memory
node_filecompose -->|"creates"| node_filestore
node_memory -->|"reads and writes"| node_filestore
node_server -->|"creates with Postgres"| node_memory
node_server -.->|"serves health"| node_browser
node_pgstore -.->|"persists sessions"| node_postgres
node_browser -.->|"opens preview"| node_main
node_main -->|"renders"| node_app
node_app -->|"configures"| node_landing
node_claude -.->|"calls"| node_modelservices

click node_server "https://github.com/abhishek-gupta18/continumai/blob/main/server.js"
click node_chat "https://github.com/abhishek-gupta18/continumai/blob/main/routes/chat.js"
click node_registry "https://github.com/abhishek-gupta18/continumai/blob/main/providers/index.js"
click node_openai "https://github.com/abhishek-gupta18/continumai/blob/main/providers/openai.js"
click node_gemini "https://github.com/abhishek-gupta18/continumai/blob/main/providers/gemini.js"
click node_claude "https://github.com/abhishek-gupta18/continumai/blob/main/providers/claude.js"
click node_classifier "https://github.com/abhishek-gupta18/continumai/blob/main/providers/errorClassifier.js"
click node_memory "https://github.com/abhishek-gupta18/continumai/blob/main/memory/memory.js"
click node_filecompose "https://github.com/abhishek-gupta18/continumai/blob/main/memory/store.js"
click node_filestore "https://github.com/abhishek-gupta18/continumai/blob/main/memory/fileStore.js"
click node_pgpool "https://github.com/abhishek-gupta18/continumai/blob/main/memory/pgPool.js"
click node_pgstore "https://github.com/abhishek-gupta18/continumai/blob/main/memory/pgStore.js"
click node_main "https://github.com/abhishek-gupta18/continumai/blob/main/preview/src/main.tsx"
click node_app "https://github.com/abhishek-gupta18/continumai/blob/main/preview/src/App.tsx"
click node_landing "https://github.com/abhishek-gupta18/continumai/blob/main/preview/src/ProventaLanding.tsx"

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_server,node_chat,node_client,node_browser toneBlue
class node_registry,node_openai,node_gemini,node_claude,node_classifier,node_postgres toneAmber
class node_memory,node_filecompose,node_filestore,node_pgpool,node_pgstore toneMint
class node_main,node_app,node_landing toneRose
class node_modelservices toneIndigo
```

## Components

### Gateway API

- [Express Server](https://github.com/abhishek-gupta18/continumai/blob/main/server.js): `server.js`
- [Chat Handler](https://github.com/abhishek-gupta18/continumai/blob/main/routes/chat.js): `routes/chat.js`

### Model Providers

- [Provider Registry](https://github.com/abhishek-gupta18/continumai/blob/main/providers/index.js): `providers/index.js`
- [OpenAI Adapter](https://github.com/abhishek-gupta18/continumai/blob/main/providers/openai.js): `providers/openai.js`
- [Gemini Adapter](https://github.com/abhishek-gupta18/continumai/blob/main/providers/gemini.js): `providers/gemini.js`
- [Claude Adapter](https://github.com/abhishek-gupta18/continumai/blob/main/providers/claude.js): `providers/claude.js`
- [Error Classifier](https://github.com/abhishek-gupta18/continumai/blob/main/providers/errorClassifier.js): `providers/errorClassifier.js`

### Conversation Memory

- [Memory Coordinator](https://github.com/abhishek-gupta18/continumai/blob/main/memory/memory.js): `memory/memory.js`
- [File Memory Setup](https://github.com/abhishek-gupta18/continumai/blob/main/memory/store.js): `memory/store.js`
- [File Session Store](https://github.com/abhishek-gupta18/continumai/blob/main/memory/fileStore.js): `memory/fileStore.js`
- [Postgres Pool](https://github.com/abhishek-gupta18/continumai/blob/main/memory/pgPool.js): `memory/pgPool.js`
- [Postgres Store](https://github.com/abhishek-gupta18/continumai/blob/main/memory/pgStore.js): `memory/pgStore.js`

### Proventa Preview

- [UI Bootstrap](https://github.com/abhishek-gupta18/continumai/blob/main/preview/src/main.tsx): `preview/src/main.tsx`
- [Landing App](https://github.com/abhishek-gupta18/continumai/blob/main/preview/src/App.tsx): `preview/src/App.tsx`
- [Proventa Landing](https://github.com/abhishek-gupta18/continumai/blob/main/preview/src/ProventaLanding.tsx): `preview/src/ProventaLanding.tsx`

### Other components

- **API Client**
- **LLM Services**
- **PostgreSQL**
- **Browser Visitor**

## Connections

- API Client → Express Server: sends chat (evidence: `README.md`)
- Express Server → Chat Handler: routes POST (evidence: `server.js`)
- Express Server → Provider Registry: builds providers (evidence: `server.js`)
- Express Server → Postgres Pool: creates pool (evidence: `server.js`)
- Express Server → Postgres Store: creates store (evidence: `server.js`)
- Chat Handler → Provider Registry: builds providers (evidence: `routes/chat.js`)
- Chat Handler → Memory Coordinator: loads context, saves turns (evidence: `routes/chat.js`)
- Chat Handler → OpenAI Adapter: dispatches (evidence: `routes/chat.js`)
- Chat Handler → Gemini Adapter: dispatches (evidence: `routes/chat.js`)
- Provider Registry → OpenAI Adapter: registers (evidence: `providers/index.js`)
- Provider Registry → Gemini Adapter: registers (evidence: `providers/index.js`)
- OpenAI Adapter → Error Classifier: classifies errors (evidence: `providers/openai.js`)
- Gemini Adapter → Error Classifier: classifies errors (evidence: `providers/gemini.js`)
- OpenAI Adapter → LLM Services: calls (evidence: `providers/openai.js`)
- Gemini Adapter → LLM Services: calls (evidence: `providers/gemini.js`)
- File Memory Setup → Memory Coordinator: creates (evidence: `memory/store.js`)
- File Memory Setup → File Session Store: creates (evidence: `memory/store.js`)
- Memory Coordinator → File Session Store: reads and writes (evidence: `memory/memory.js`)
- Express Server → Memory Coordinator: creates with Postgres (evidence: `server.js`)
- Express Server → Browser Visitor: serves health
- Postgres Store → PostgreSQL: persists sessions
- Browser Visitor → UI Bootstrap: opens preview
- UI Bootstrap → Landing App: renders (evidence: `preview/src/main.tsx`)
- Landing App → Proventa Landing: configures (evidence: `preview/src/App.tsx`)
- Claude Adapter → LLM Services: calls
