# birajbgt/knowly-ai architecture

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

- Interactive diagram: https://gitdiagram.com/birajbgt/knowly-ai
- Repository: https://github.com/birajbgt/knowly-ai

## Overview

Knowly AI is a browser-based document knowledge assistant. Users authenticate, then use a single client-side page for document management, chat, research planning, and learning; API requests pass through a Next.js catch-all proxy to a separate backend. The root layout supplies shared React Query context. The page excerpt is partial, so the feature nodes reflect documented UI areas, while specific backend processing stages and data stores cannot be established from the available evidence.

Main entry points: [`app/api/[...path]/route.ts`](https://github.com/birajbgt/knowly-ai/blob/main/app/api/%5B...path%5D/route.ts) (API proxy), [`app/page.tsx`](https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx) (Authentication), [`app/layout.tsx`](https://github.com/birajbgt/knowly-ai/blob/main/app/layout.tsx) (Root layout), [`app/providers.tsx`](https://github.com/birajbgt/knowly-ai/blob/main/app/providers.tsx) (Query provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_layout["Root layout<br/>[layout.tsx]"]
  node_providers["Query provider<br/>[providers.tsx]"]
end

subgraph group_product["Knowly AI features"]
  node_auth["Authentication<br/>[page.tsx]"]
  node_documents["Document workspace<br/>[page.tsx]"]
  node_chat["Knowledge chat<br/>[page.tsx]"]
  node_research["Research workspace<br/>[page.tsx]"]
  node_learning["Learning view<br/>[page.tsx]"]
end

subgraph group_api["API access"]
  node_proxy["API proxy<br/>[route.ts]"]
end

node_user(("User"))
node_backend["API backend"]

node_user -->|"signs in"| node_auth
node_user -->|"manages documents"| node_documents
node_user -->|"asks questions"| node_chat
node_user -->|"creates plans"| node_research
node_user -->|"views learning"| node_learning
node_layout -->|"wraps children"| node_providers
node_auth -->|"sends requests"| node_proxy
node_documents -->|"sends requests"| node_proxy
node_chat -->|"sends requests"| node_proxy
node_research -->|"sends requests"| node_proxy
node_learning -->|"sends requests"| node_proxy
node_proxy -->|"forwards requests"| node_backend

click node_layout "https://github.com/birajbgt/knowly-ai/blob/main/app/layout.tsx"
click node_providers "https://github.com/birajbgt/knowly-ai/blob/main/app/providers.tsx"
click node_auth "https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx"
click node_documents "https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx"
click node_chat "https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx"
click node_research "https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx"
click node_learning "https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx"
click node_proxy "https://github.com/birajbgt/knowly-ai/blob/main/app/api/%5B...path%5D/route.ts"

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_layout,node_providers,node_user toneBlue
class node_auth,node_documents,node_chat,node_research,node_learning toneAmber
class node_proxy,node_backend toneMint
```

## Components

### Application shell

- [Root layout](https://github.com/birajbgt/knowly-ai/blob/main/app/layout.tsx): `app/layout.tsx`
- [Query provider](https://github.com/birajbgt/knowly-ai/blob/main/app/providers.tsx): `app/providers.tsx`

### Knowly AI features

- [Authentication](https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx): `app/page.tsx`
- [Document workspace](https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx): `app/page.tsx`
- [Knowledge chat](https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx): `app/page.tsx`
- [Research workspace](https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx): `app/page.tsx`
- [Learning view](https://github.com/birajbgt/knowly-ai/blob/main/app/page.tsx): `app/page.tsx`

### API access

- [API proxy](https://github.com/birajbgt/knowly-ai/blob/main/app/api/%5B...path%5D/route.ts): `app/api/[...path]/route.ts`

### Other components

- **User**
- **API backend**

## Connections

- User → Authentication: signs in (evidence: `app/page.tsx`)
- User → Document workspace: manages documents (evidence: `app/page.tsx`)
- User → Knowledge chat: asks questions (evidence: `app/page.tsx`)
- User → Research workspace: creates plans (evidence: `app/page.tsx`)
- User → Learning view: views learning (evidence: `app/page.tsx`)
- Root layout → Query provider: wraps children (evidence: `app/layout.tsx`)
- Authentication → API proxy: sends requests (evidence: `app/page.tsx`)
- Document workspace → API proxy: sends requests (evidence: `app/page.tsx`)
- Knowledge chat → API proxy: sends requests (evidence: `app/page.tsx`)
- Research workspace → API proxy: sends requests (evidence: `app/page.tsx`)
- Learning view → API proxy: sends requests (evidence: `app/page.tsx`)
- API proxy → API backend: forwards requests (evidence: `app/api/[...path]/route.ts`)
