Metadata-Version: 2.4
Name: nsflow
Version: 0.5.8
Summary: A Neuro-San powered Smart Agent Network Framework
Author: Deepak
License-Expression: LicenseRef-CognizantAcademicSource
Project-URL: Homepage, https://github.com/leaf-ai/nsflow
Project-URL: Repository, https://github.com/leaf-ai/nsflow
Project-URL: Documentation, https://github.com/leaf-ai/nsflow#readme
Keywords: NsFlow,NeuroSan,agent-network
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: fastapi-cors>=0.0.6
Requires-Dist: fastapi>=0.115.8
Requires-Dist: graphviz==0.20.3
Requires-Dist: jupyterlab==4.4.0
Requires-Dist: pyhocon>=0.3.61
Requires-Dist: uvicorn>=0.34.0
Requires-Dist: websockets>=14.2
Requires-Dist: wsproto>=1.2.0
Requires-Dist: nbformat>=5.10.4
Requires-Dist: pydantic>=2.9.2
Requires-Dist: python-dotenv==1.0.1
Dynamic: license-file

# NSFlow - A FastAPI based client for NeuroSan

NSFlow is a framework that enables users to explore, visualize, and interact with smart agent networks. It integrates **NeuroSan** for intelligent agent-based interactions.

![Project Logo](docs/snapshot01.png)

---
## **Installation & Running NSFlow**

NSFlow can be installed and run in **three different ways:**

### **1️⃣ Run NSFlow using git repo**
To simplify execution, NSFlow provides a CLI command to start both the backend and frontend simultaneously.

#### **Step 1: Clone the repository**
```bash
git clone https://github.com/leaf-ai/nsflow.git
```

#### **Step 2: Install NSFlow dependencies**
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-private.txt
```

#### **Step 3: Run Everything with a Single Command**
```bash
python -m nsflow.run
```

By default, this will start:
- **backend** (FastAPI + NeuroSan) here: `http://127.0.0.1:4173/docs` or `http://127.0.0.1:4173/redoc`
- **frontend** (React) here: `http://127.0.0.1:4173`

---

### **2️⃣ Run NSFlow with a Wheel**
You can run NSFlow inside a **Docker container**, which includes both the backend and frontend.

#### **Step 1: Build the Frontend**
```bash
sh build_scripts/build_frontend.sh
```

#### **Step 2: Build the Wheel**
```bash
sh build_scripts/build_wheel.sh
```

Note: The above script output should show that the wheel contains a module `prebuilt_frontend`

---

### **3️⃣ Development & Contribution (Manually Start Frontend & Backend)**
If you want to contribute, ensure you have the necessary dependencies installed:
To start the frontend and backend separately, follow these steps:

#### **Step 1: Clone the Repository**
```bash
git clone https://github.com/your-org/nsflow.git
cd nsflow
```

#### **Step 2: Install Dependencies**
Make sure you have **Python 3.12** and **Node.js (with Yarn)** installed.

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-private.txt
cd frontend; yarn install
```

#### **Step 3: Start the Backend & Frontend on separately**
Backend:
```bash
cd .. # Back to project root
python -m nsflow.run --dev
```

Frontend:
On another terminal window
```bash
cd frontend
yarn dev
```

By default:
- **backend** will be available at: `http://127.0.0.1:8005`
- **frontend** will be available at: `http://127.0.0.1:5173`

**OR**

#### **Step 3: Start the prebuilt Frontend served with Backend**
Note: 
- Ensure that `./nsflow/prebuilt_frontend/dist` dir exists in your project
- run `sh build_scripts/build_frontend.sh` to create the above dist if it is not present

```bash
cd .. # Back to project root
python -m nsflow.run
```

- **frontend** will be available at: `http://127.0.0.1:4173`
- **backend** will be available at: `http://127.0.0.1:4173/docs`
- 
---
