# 2739673455/insight architecture

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

- Interactive diagram: https://gitdiagram.com/2739673455/insight
- Repository: https://github.com/2739673455/insight

## Overview

DataAgent is a data-analysis assistant with an administrative console. Users authenticate, manage conversations, and ask questions; the assistant’s execution layer supports analysis against Doris, with metadata search and query-experience recall as distinct capabilities. Administrators manage accounts and Doris permissions, import catalog metadata, and synchronize semantic/value indexes through background tasks. The README documents these capabilities and setup flows; the sampled sources expose selected service and task relationships, but not the complete chat-agent or query runtime, so those links are limited.

Main entry points: [`app/query/execution/service.py`](https://github.com/2739673455/insight/blob/main/app/query/execution/service.py) (Query execution), [`app/metadata/tasks.py`](https://github.com/2739673455/insight/blob/main/app/metadata/tasks.py) (Metadata index tasks), [`web/src/features/metadata/index.tsx`](https://github.com/2739673455/insight/blob/main/web/src/features/metadata/index.tsx) (Admin console), [`app/assistant/conversations/service.py`](https://github.com/2739673455/insight/blob/main/app/assistant/conversations/service.py) (Conversation service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_webchat["Chat interface<br/>[ChatComposer.tsx]"]
  node_webadmin["Admin console<br/>[index.tsx]"]
  node_chatapi["Chat API<br/>[router.py]"]
  node_attachmentapi["Attachment API<br/>[router.py]"]
end

subgraph group_assistant["Assistant runtime"]
  node_conversation["Conversation service<br/>[service.py]"]
  node_agent["Agent runtime<br/>[runtime.py]"]
  node_execution["Query execution<br/>[service.py]"]
  node_sandbox["Analysis sandbox<br/>[manager.py]"]
  node_recall["Assistant recall<br/>[service.py]"]
  node_experience["Query experiences<br/>[management.py]"]
end

subgraph group_catalog["Metadata discovery"]
  node_metadataapi["Metadata API<br/>[router.py]"]
  node_catalogservice["Catalog import<br/>[service.py]"]
  node_metasearch["Metadata search<br/>[service.py]"]
  node_metatasks["Metadata index tasks<br/>[tasks.py]"]
end

subgraph group_governance["Identity and access"]
  node_authapi["Authentication API<br/>[router.py]"]
  node_identity["Identity service<br/>[service.py]"]
  node_adminapi["Identity admin API<br/>[router.py]"]
end

subgraph group_platform["Data and background services"]
  node_doris[("Doris data store")]
  node_postgres[("PostgreSQL stores")]
  node_celery["Task queue<br/>[celery_app.py]"]
  node_worker["Background workflows<br/>[tasks.py]"]
end

node_user(("User"))

node_user -->|"asks questions"| node_webchat
node_user -->|"manages data"| node_webadmin
node_conversation -->|"starts runs"| node_execution
node_conversation -.->|"uses recall"| node_recall
node_agent -.->|"requests analysis"| node_execution
node_execution -.->|"queries data"| node_doris
node_execution -->|"uses sandbox"| node_sandbox
node_metadataapi -->|"imports catalog"| node_catalogservice
node_catalogservice -->|"submits index work"| node_metatasks
node_metatasks -->|"reads source"| node_doris
node_metatasks -->|"persists catalog"| node_postgres
node_metasearch -->|"reads catalog"| node_postgres
node_webadmin -.->|"manages metadata"| node_metadataapi
node_webadmin -.->|"manages access"| node_adminapi
node_authapi -.->|"authenticates users"| node_identity
node_identity -->|"reads identity"| node_postgres
node_adminapi -->|"manages roles"| node_doris
node_execution -->|"records runs"| node_experience
node_celery -->|"routes tasks"| node_metatasks
node_celery -->|"routes tasks"| node_worker

click node_webchat "https://github.com/2739673455/insight/blob/main/web/src/features/chat/components/ChatComposer.tsx"
click node_webadmin "https://github.com/2739673455/insight/blob/main/web/src/features/metadata/index.tsx"
click node_chatapi "https://github.com/2739673455/insight/blob/main/app/assistant/api/chat/router.py"
click node_attachmentapi "https://github.com/2739673455/insight/blob/main/app/assistant/api/attachment/router.py"
click node_conversation "https://github.com/2739673455/insight/blob/main/app/assistant/conversations/service.py"
click node_agent "https://github.com/2739673455/insight/blob/main/app/assistant/agents/runtime.py"
click node_execution "https://github.com/2739673455/insight/blob/main/app/query/execution/service.py"
click node_sandbox "https://github.com/2739673455/insight/blob/main/app/sandbox/manager.py"
click node_recall "https://github.com/2739673455/insight/blob/main/app/assistant/recall/service.py"
click node_metadataapi "https://github.com/2739673455/insight/blob/main/app/metadata/api/router.py"
click node_catalogservice "https://github.com/2739673455/insight/blob/main/app/metadata/catalog/service.py"
click node_metasearch "https://github.com/2739673455/insight/blob/main/app/metadata/search/service.py"
click node_metatasks "https://github.com/2739673455/insight/blob/main/app/metadata/tasks.py"
click node_authapi "https://github.com/2739673455/insight/blob/main/app/identity/api/auth/router.py"
click node_identity "https://github.com/2739673455/insight/blob/main/app/identity/service.py"
click node_adminapi "https://github.com/2739673455/insight/blob/main/app/identity/api/router.py"
click node_experience "https://github.com/2739673455/insight/blob/main/app/query/experiences/management.py"
click node_celery "https://github.com/2739673455/insight/blob/main/app/shared/tasks/celery_app.py"
click node_worker "https://github.com/2739673455/insight/blob/main/app/workflows/tasks.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_webchat,node_webadmin,node_chatapi,node_attachmentapi,node_user toneBlue
class node_conversation,node_agent,node_execution,node_sandbox,node_recall,node_experience toneAmber
class node_metadataapi,node_catalogservice,node_metasearch,node_metatasks toneMint
class node_authapi,node_identity,node_adminapi toneRose
class node_doris,node_postgres,node_celery,node_worker toneIndigo
```

## Components

### User interaction

- [Chat interface](https://github.com/2739673455/insight/blob/main/web/src/features/chat/components/ChatComposer.tsx): `web/src/features/chat/components/ChatComposer.tsx`
- [Admin console](https://github.com/2739673455/insight/blob/main/web/src/features/metadata/index.tsx): `web/src/features/metadata/index.tsx`
- [Chat API](https://github.com/2739673455/insight/blob/main/app/assistant/api/chat/router.py): `app/assistant/api/chat/router.py`
- [Attachment API](https://github.com/2739673455/insight/blob/main/app/assistant/api/attachment/router.py): `app/assistant/api/attachment/router.py`

### Assistant runtime

- [Conversation service](https://github.com/2739673455/insight/blob/main/app/assistant/conversations/service.py): `app/assistant/conversations/service.py`
- [Agent runtime](https://github.com/2739673455/insight/blob/main/app/assistant/agents/runtime.py): `app/assistant/agents/runtime.py`
- [Query execution](https://github.com/2739673455/insight/blob/main/app/query/execution/service.py): `app/query/execution/service.py`
- [Analysis sandbox](https://github.com/2739673455/insight/blob/main/app/sandbox/manager.py): `app/sandbox/manager.py`
- [Assistant recall](https://github.com/2739673455/insight/blob/main/app/assistant/recall/service.py): `app/assistant/recall/service.py`
- [Query experiences](https://github.com/2739673455/insight/blob/main/app/query/experiences/management.py): `app/query/experiences/management.py`

### Metadata discovery

- [Metadata API](https://github.com/2739673455/insight/blob/main/app/metadata/api/router.py): `app/metadata/api/router.py`
- [Catalog import](https://github.com/2739673455/insight/blob/main/app/metadata/catalog/service.py): `app/metadata/catalog/service.py`
- [Metadata search](https://github.com/2739673455/insight/blob/main/app/metadata/search/service.py): `app/metadata/search/service.py`
- [Metadata index tasks](https://github.com/2739673455/insight/blob/main/app/metadata/tasks.py): `app/metadata/tasks.py`

### Identity and access

- [Authentication API](https://github.com/2739673455/insight/blob/main/app/identity/api/auth/router.py): `app/identity/api/auth/router.py`
- [Identity service](https://github.com/2739673455/insight/blob/main/app/identity/service.py): `app/identity/service.py`
- [Identity admin API](https://github.com/2739673455/insight/blob/main/app/identity/api/router.py): `app/identity/api/router.py`

### Data and background services

- **Doris data store**
- **PostgreSQL stores**
- [Task queue](https://github.com/2739673455/insight/blob/main/app/shared/tasks/celery_app.py): `app/shared/tasks/celery_app.py`
- [Background workflows](https://github.com/2739673455/insight/blob/main/app/workflows/tasks.py): `app/workflows/tasks.py`

### Other components

- **User**

## Connections

- User → Chat interface: asks questions
- User → Admin console: manages data
- Conversation service → Query execution: starts runs (evidence: `app/assistant/conversations/service.py`)
- Conversation service → Assistant recall: uses recall
- Agent runtime → Query execution: requests analysis
- Query execution → Doris data store: queries data
- Query execution → Analysis sandbox: uses sandbox (evidence: `app/query/execution/service.py`)
- Metadata API → Catalog import: imports catalog (evidence: `app/metadata/api/router.py`)
- Catalog import → Metadata index tasks: submits index work (evidence: `app/metadata/catalog/service.py`)
- Metadata index tasks → Doris data store: reads source (evidence: `app/metadata/tasks.py`)
- Metadata index tasks → PostgreSQL stores: persists catalog (evidence: `app/metadata/tasks.py`)
- Metadata search → PostgreSQL stores: reads catalog (evidence: `app/metadata/search/service.py`)
- Admin console → Metadata API: manages metadata
- Admin console → Identity admin API: manages access
- Authentication API → Identity service: authenticates users
- Identity service → PostgreSQL stores: reads identity (evidence: `app/identity/service.py`)
- Identity admin API → Doris data store: manages roles (evidence: `app/identity/api/router.py`)
- Query execution → Query experiences: records runs (evidence: `app/query/execution/service.py`)
- Task queue → Metadata index tasks: routes tasks (evidence: `app/shared/tasks/celery_app.py`)
- Task queue → Background workflows: routes tasks (evidence: `app/shared/tasks/celery_app.py`)
