# praveen0815/ai-agent-practice- architecture

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

- Interactive diagram: https://gitdiagram.com/praveen0815/ai-agent-practice-
- Repository: https://github.com/praveen0815/ai-agent-practice-

## Overview

This is a Slack-based AI agent for researching and assessing new community members. A Slack join event fetches member details, gathers basic web and GitHub research, uses an OpenAI model to produce a fit analysis, stores it, and posts it to a Slack channel; the database record is then marked as sent. The app also exposes an Express health endpoint and a development-only analysis endpoint. The graph reflects the sampled source; some event and research details are omitted from the excerpts.

Main entry points: [`index.js`](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js) (Analysis workflow), [`db.js`](https://github.com/praveen0815/ai-agent-practice-/blob/main/db.js) (PostgreSQL analysis store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Event and HTTP ingress"]
  node_slack_app["Slack event app<br/>[index.js]"]
  node_member_lookup["Member lookup<br/>[index.js]"]
  node_express_api["Express endpoints<br/>[index.js]"]
end

subgraph group_analysis["Member analysis"]
  node_analysis_flow["Analysis workflow<br/>[index.js]"]
  node_research["Basic research<br/>[index.js]"]
  node_ai_analysis["AI analysis<br/>[index.js]"]
end

subgraph group_persistence["Analysis persistence"]
  node_database[("PostgreSQL analysis store<br/>[db.js]")]
end

node_slack_member(("Slack member"))
node_http_caller(("HTTP caller"))
node_github["GitHub search"]
node_company_web["Company website"]
node_openai["OpenAI model"]
node_slack_channel["Analysis channel"]

node_slack_member -->|"joins channel"| node_slack_app
node_slack_app -->|"gets member"| node_member_lookup
node_member_lookup -->|"analyzes member"| node_analysis_flow
node_http_caller -->|"requests endpoint"| node_express_api
node_express_api -->|"runs test analysis"| node_analysis_flow
node_analysis_flow -->|"requests research"| node_research
node_research -->|"searches users"| node_github
node_research -->|"fetches website"| node_company_web
node_analysis_flow -->|"requests assessment"| node_ai_analysis
node_ai_analysis -->|"invokes model"| node_openai
node_analysis_flow -->|"saves analysis"| node_database
node_analysis_flow -->|"posts result"| node_slack_channel
node_analysis_flow -->|"marks sent"| node_database
node_slack_app -->|"initializes store"| node_database

click node_slack_app "https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js"
click node_member_lookup "https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js"
click node_express_api "https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js"
click node_analysis_flow "https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js"
click node_research "https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js"
click node_ai_analysis "https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js"
click node_database "https://github.com/praveen0815/ai-agent-practice-/blob/main/db.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_slack_app,node_member_lookup,node_express_api toneBlue
class node_analysis_flow,node_research,node_ai_analysis toneAmber
class node_database toneMint
class node_slack_member,node_http_caller,node_github,node_company_web,node_openai,node_slack_channel toneIndigo
```

## Components

### Event and HTTP ingress

- [Slack event app](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js): `index.js`
- [Member lookup](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js): `index.js`
- [Express endpoints](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js): `index.js`

### Member analysis

- [Analysis workflow](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js): `index.js`
- [Basic research](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js): `index.js`
- [AI analysis](https://github.com/praveen0815/ai-agent-practice-/blob/main/index.js): `index.js`

### Analysis persistence

- [PostgreSQL analysis store](https://github.com/praveen0815/ai-agent-practice-/blob/main/db.js): `db.js`

### Other components

- **Slack member**
- **HTTP caller**
- **GitHub search**
- **Company website**
- **OpenAI model**
- **Analysis channel**

## Connections

- Slack member → Slack event app: joins channel (evidence: `index.js`)
- Slack event app → Member lookup: gets member (evidence: `index.js`)
- Member lookup → Analysis workflow: analyzes member (evidence: `index.js`)
- HTTP caller → Express endpoints: requests endpoint (evidence: `index.js`)
- Express endpoints → Analysis workflow: runs test analysis (evidence: `index.js`)
- Analysis workflow → Basic research: requests research (evidence: `index.js`)
- Basic research → GitHub search: searches users (evidence: `index.js`)
- Basic research → Company website: fetches website (evidence: `index.js`)
- Analysis workflow → AI analysis: requests assessment (evidence: `index.js`)
- AI analysis → OpenAI model: invokes model (evidence: `index.js`)
- Analysis workflow → PostgreSQL analysis store: saves analysis (evidence: `index.js`)
- Analysis workflow → Analysis channel: posts result (evidence: `index.js`)
- Analysis workflow → PostgreSQL analysis store: marks sent (evidence: `index.js`)
- Slack event app → PostgreSQL analysis store: initializes store (evidence: `index.js`)
