# Enterprise Brain

Enterprise Brain is a decision-intelligence platform for CXOs — a multi-agent AI system with a FastAPI backend, a React frontend, and specialised A2A agents (Tata Steel, UI, RT Agent and more).

---

## Prerequisites

Before you start, make sure you have the following installed:

- **Python 3.11.x** — exactly 3.11 (the backend requires `>=3.11,<3.12`)
- **uv** — fast Python package manager ([install guide](https://docs.astral.sh/uv/getting-started/installation/))
  ```bash
  curl -LsSf https://astral.sh/uv/install.sh | sh
  ```
- **Node.js 18+** and **npm 9+**
- **Git**

---

## Setup

### Step 1 — Clone the repository

```bash
git clone https://github.com/divamidesignlabs/ai-enterprise-brain.git
cd ai-enterprise-brain
```

---

### Step 2 — Configure environment variables

#### Backend — create `.env` in the project root

Create a file named `.env` at the root of the repository and fill in your values:

#### Frontend — create `.env` inside the `frontend/` folder

### Step 3 — Install backend dependencies

```bash
cd backend
uv sync
```

`uv sync` automatically creates `.venv` and installs all dependencies. Once it completes, activate the virtual environment:

```bash
source .venv/bin/activate
```

> On Windows: `.venv\Scripts\activate`

Then go back to the project root:

```bash
cd ..
```

---

### Step 4 — Install frontend dependencies

Open a **new terminal** and run:

```bash
cd frontend
npm i
```

---

## Running the Application

You will need **two terminals** — one for the backend agents, one for the frontend.

### Terminal 1 — Backend agents

From the project root (with the venv active):

```bash
make ui
```

This starts the Tata Steel agent, UI agent, and Chanakya chat UI together. Once running:

| Service | URL |
|---------|-----|
| Chanakya chat UI | http://localhost:8010/chat |
| Tata Steel agent | http://localhost:8005 |
| UI agent | http://localhost:8011 |

To stop all agents: `make stop`

---

### Terminal 2 — Frontend

```bash
cd frontend
npm run dev
```

The frontend will be available at http://localhost:5173.