# yosef-ali/erpnext-ai-agent-project architecture

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

- Interactive diagram: https://gitdiagram.com/yosef-ali/erpnext-ai-agent-project
- Repository: https://github.com/yosef-ali/erpnext-ai-agent-project

## Overview

ERPNext AI Agent is an ERPNext-facing assistant for semantic document search, business-relationship graphs, document ingestion, and generated ERP designs. The primary workflow begins with a user task, which the multi-agent orchestrator turns into requirements, architecture, schema, and implementation deliverables. Separate branches support indexing/search, graph building, and MCP-based IDE access; RL training data is another distinct capability. The excerpts show connector API access and some orchestration behavior, but not every integration call, so uncertain links are omitted or marked dashed.

Main entry points: [`integrations/multi_agent_workflows.py`](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py) (Workflow orchestrator), [`start_erpnext_ai_agent.py`](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/start_erpnext_ai_agent.py) (Agent startup), [`integrations/document_indexer.py`](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/document_indexer.py) (Document indexer), [`integrations/knowledge_graph_builder.py`](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/knowledge_graph_builder.py) (Knowledge graph builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow generation"]
  node_startup["Agent startup"]
  node_orchestrator["Workflow orchestrator"]
  node_requirements["Requirements analysis"]
  node_architecture["Architecture design"]
  node_schema["DocType design"]
end

subgraph group_data["ERPNext data intelligence"]
  node_indexer["Document indexer"]
  node_vectorstore[("Vector database")]
  node_kg["Knowledge graph builder"]
  node_graphstore[("Graph store")]
end

subgraph group_integrations["External integrations"]
  node_connector["ERPNext connector"]
  node_mcp["MCP configuration"]
end

subgraph group_learning["Learning data"]
  node_rl["RL dataset generator"]
end

node_user(("User"))
node_erpnext["ERPNext instance"]
node_mcpclient["IDE MCP client"]

node_user -->|"starts"| node_startup
node_startup -->|"runs workflows"| node_orchestrator
node_orchestrator -->|"analyzes requirements"| node_requirements
node_orchestrator -->|"designs architecture"| node_architecture
node_orchestrator -->|"designs schema"| node_schema
node_orchestrator -->|"returns deliverables"| node_user
node_startup -->|"checks connection"| node_connector
node_connector -->|"requests data"| node_erpnext
node_indexer -->|"indexes documents"| node_vectorstore
node_user -->|"searches documents"| node_indexer
node_startup -->|"builds graph"| node_kg
node_kg -.->|"stores relationships"| node_graphstore
node_mcp -->|"configures access"| node_mcpclient
node_rl -.->|"derives usage patterns"| node_erpnext

click node_startup "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/start_erpnext_ai_agent.py"
click node_orchestrator "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py"
click node_requirements "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py"
click node_architecture "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py"
click node_schema "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py"
click node_connector "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/erpnext_connector.py"
click node_indexer "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/document_indexer.py"
click node_kg "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/knowledge_graph_builder.py"
click node_mcp "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/mcp_server_config.py"
click node_rl "https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/rl_training_dataset.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_startup,node_orchestrator,node_requirements,node_architecture,node_schema,node_user,node_mcpclient toneBlue
class node_indexer,node_vectorstore,node_kg,node_graphstore toneAmber
class node_connector,node_mcp toneMint
class node_rl toneRose
class node_erpnext toneIndigo
```

## Components

### Workflow generation

- [Agent startup](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/start_erpnext_ai_agent.py): `start_erpnext_ai_agent.py`
- [Workflow orchestrator](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py): `integrations/multi_agent_workflows.py`
- [Requirements analysis](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py): `integrations/multi_agent_workflows.py`
- [Architecture design](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py): `integrations/multi_agent_workflows.py`
- [DocType design](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/multi_agent_workflows.py): `integrations/multi_agent_workflows.py`

### ERPNext data intelligence

- [Document indexer](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/document_indexer.py): `integrations/document_indexer.py`
- **Vector database**
- [Knowledge graph builder](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/knowledge_graph_builder.py): `integrations/knowledge_graph_builder.py`
- **Graph store**

### External integrations

- [ERPNext connector](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/erpnext_connector.py): `integrations/erpnext_connector.py`
- [MCP configuration](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/mcp_server_config.py): `integrations/mcp_server_config.py`

### Learning data

- [RL dataset generator](https://github.com/yosef-ali/erpnext-ai-agent-project/blob/main/integrations/rl_training_dataset.py): `integrations/rl_training_dataset.py`

### Other components

- **User**
- **ERPNext instance**
- **IDE MCP client**

## Connections

- User → Agent startup: starts (evidence: `README.md`)
- Agent startup → Workflow orchestrator: runs workflows (evidence: `start_erpnext_ai_agent.py`)
- Workflow orchestrator → Requirements analysis: analyzes requirements (evidence: `README.md`)
- Workflow orchestrator → Architecture design: designs architecture (evidence: `README.md`)
- Workflow orchestrator → DocType design: designs schema (evidence: `README.md`)
- Workflow orchestrator → User: returns deliverables (evidence: `integrations/multi_agent_workflows.py`)
- Agent startup → ERPNext connector: checks connection (evidence: `start_erpnext_ai_agent.py`)
- ERPNext connector → ERPNext instance: requests data (evidence: `integrations/erpnext_connector.py`)
- Document indexer → Vector database: indexes documents (evidence: `README.md`)
- User → Document indexer: searches documents (evidence: `README.md`)
- Agent startup → Knowledge graph builder: builds graph (evidence: `start_erpnext_ai_agent.py`)
- Knowledge graph builder → Graph store: stores relationships
- MCP configuration → IDE MCP client: configures access (evidence: `README.md`)
- RL dataset generator → ERPNext instance: derives usage patterns
