# steffanabishake/enterprise-ai-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/steffanabishake/enterprise-ai-assistant
- Repository: https://github.com/steffanabishake/enterprise-ai-assistant

## Overview

Enterprise Knowledge Assistant is a role-aware chat application for searching internal documents and returning answers with supporting passages. The main workflow runs from the Streamlit chat through the FastAPI API, into a routed LangGraph workflow, then through authorized retrieval, optional analysis or service lookup, response generation and citation/safety validation before streaming results. Local mode uses BM25; live mode adds Pinecone and OpenAI. The graph preserves documented ingestion, tracing, and in-memory conversation capabilities. Edges rely on excerpts or README statements; unsampled implementation details are not inferred.

Main entry points: [`app/main.py`](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/main.py) (Chat API), [`app/graph.py`](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py) (Workflow router), [`app/providers.py`](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/providers.py) (Provider client), [`app/retrieval.py`](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/retrieval.py) (Hybrid retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Chat experience"]
  node_chat_ui["Streamlit chat<br/>[chat.py]"]
end

subgraph group_workflow["Conversation workflow"]
  node_api["Chat API<br/>[main.py]"]
  node_identity["Identity and permissions<br/>[security.py]"]
  node_request_models["Request and answer models<br/>[models.py]"]
  node_session_memory[("Session memory<br/>[memory.py]")]
  node_router["Workflow router<br/>[graph.py]"]
  node_response["Answer generation<br/>[graph.py]"]
  node_validation["Citation and safety checks<br/>[graph.py]"]
end

subgraph group_knowledge["Knowledge and retrieval"]
  node_retrieval["Hybrid retrieval<br/>[retrieval.py]"]
  node_document_catalog[("Sample document catalog<br/>[documents.json]")]
  node_ingestion["Vector ingestion<br/>[ingest.py]"]
end

subgraph group_services["Tools and integrations"]
  node_providers["Provider client<br/>[providers.py]"]
  node_analysis["Incident analysis<br/>[tools.py]"]
  node_mcp_client["MCP service lookup<br/>[tools.py]"]
  node_service_catalog["Service catalog server<br/>[mcp_server.py]"]
  node_tracing["Execution tracing<br/>[main.py]"]
end

node_user(("Chat user"))
node_pinecone[("Pinecone vector index")]
node_openai["OpenAI API"]
node_langsmith["LangSmith"]

node_user -->|"asks question"| node_chat_ui
node_chat_ui -->|"posts chat"| node_api
node_api -->|"authenticates and limits"| node_identity
node_api -->|"accepts request"| node_request_models
node_api -->|"loads and updates"| node_session_memory
node_api -->|"streams workflow"| node_router
node_api -->|"configures traces"| node_tracing
node_router -->|"routes search"| node_retrieval
node_retrieval -->|"loads documents"| node_document_catalog
node_retrieval -->|"filters access"| node_identity
node_router -->|"calls analysis"| node_analysis
node_router -->|"calls service lookup"| node_mcp_client
node_mcp_client -->|"calls tool"| node_service_catalog
node_retrieval -->|"requests embeddings and search"| node_providers
node_providers -->|"requests embeddings and completions"| node_openai
node_providers -->|"queries and upserts vectors"| node_pinecone
node_ingestion -->|"loads source documents"| node_document_catalog
node_ingestion -->|"embeds and upserts"| node_providers
node_router -->|"routes results"| node_response
node_response -->|"requests live answer"| node_providers
node_response -->|"passes answer"| node_validation
node_validation -->|"streams checked answer"| node_api
node_tracing -->|"sends traces"| node_langsmith

click node_chat_ui "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/frontend/chat.py"
click node_api "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/main.py"
click node_identity "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/security.py"
click node_request_models "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/models.py"
click node_session_memory "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/memory.py"
click node_router "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py"
click node_retrieval "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/retrieval.py"
click node_document_catalog "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/data/documents.json"
click node_ingestion "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/scripts/ingest.py"
click node_providers "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/providers.py"
click node_analysis "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/tools.py"
click node_mcp_client "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/tools.py"
click node_service_catalog "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/mcp_server.py"
click node_response "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py"
click node_validation "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py"
click node_tracing "https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/main.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_chat_ui,node_user toneBlue
class node_api,node_identity,node_request_models,node_session_memory,node_router,node_response,node_validation,node_pinecone toneAmber
class node_retrieval,node_document_catalog,node_ingestion,node_openai toneMint
class node_providers,node_analysis,node_mcp_client,node_service_catalog,node_tracing toneRose
class node_langsmith toneIndigo
```

## Components

### Chat experience

- [Streamlit chat](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/frontend/chat.py): `frontend/chat.py`

### Conversation workflow

- [Chat API](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/main.py): `app/main.py`
- [Identity and permissions](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/security.py): `app/security.py`
- [Request and answer models](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/models.py): `app/models.py`
- [Session memory](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/memory.py): `app/memory.py`
- [Workflow router](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py): `app/graph.py`
- [Answer generation](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py): `app/graph.py`
- [Citation and safety checks](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/graph.py): `app/graph.py`

### Knowledge and retrieval

- [Hybrid retrieval](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/retrieval.py): `app/retrieval.py`
- [Sample document catalog](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/data/documents.json): `data/documents.json`
- [Vector ingestion](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/scripts/ingest.py): `scripts/ingest.py`

### Tools and integrations

- [Provider client](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/providers.py): `app/providers.py`
- [Incident analysis](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/tools.py): `app/tools.py`
- [MCP service lookup](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/tools.py): `app/tools.py`
- [Service catalog server](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/mcp_server.py): `app/mcp_server.py`
- [Execution tracing](https://github.com/steffanabishake/enterprise-ai-assistant/blob/main/app/main.py): `app/main.py`

### Other components

- **Chat user**
- **Pinecone vector index**
- **OpenAI API**
- **LangSmith**

## Connections

- Chat user → Streamlit chat: asks question (evidence: `README.md`)
- Streamlit chat → Chat API: posts chat (evidence: `README.md`)
- Chat API → Identity and permissions: authenticates and limits (evidence: `app/main.py`)
- Chat API → Request and answer models: accepts request (evidence: `app/main.py`)
- Chat API → Session memory: loads and updates (evidence: `app/main.py`)
- Chat API → Workflow router: streams workflow (evidence: `app/main.py`)
- Chat API → Execution tracing: configures traces (evidence: `app/main.py`)
- Workflow router → Hybrid retrieval: routes search (evidence: `app/graph.py`)
- Hybrid retrieval → Sample document catalog: loads documents (evidence: `app/retrieval.py`)
- Hybrid retrieval → Identity and permissions: filters access (evidence: `app/retrieval.py`)
- Workflow router → Incident analysis: calls analysis (evidence: `app/graph.py`)
- Workflow router → MCP service lookup: calls service lookup (evidence: `app/graph.py`)
- MCP service lookup → Service catalog server: calls tool (evidence: `app/tools.py`)
- Hybrid retrieval → Provider client: requests embeddings and search (evidence: `app/retrieval.py`)
- Provider client → OpenAI API: requests embeddings and completions (evidence: `app/providers.py`)
- Provider client → Pinecone vector index: queries and upserts vectors (evidence: `app/providers.py`)
- Vector ingestion → Sample document catalog: loads source documents (evidence: `scripts/ingest.py`)
- Vector ingestion → Provider client: embeds and upserts (evidence: `scripts/ingest.py`)
- Workflow router → Answer generation: routes results (evidence: `app/graph.py`)
- Answer generation → Provider client: requests live answer (evidence: `app/graph.py`)
- Answer generation → Citation and safety checks: passes answer (evidence: `app/graph.py`)
- Citation and safety checks → Chat API: streams checked answer (evidence: `app/main.py`)
- Execution tracing → LangSmith: sends traces (evidence: `README.md`)
