diff --git a/README.md b/README.md index 2fec2ce..6e5fdb9 100644 --- a/README.md +++ b/README.md @@ -21,35 +21,61 @@ --- -## 💬 How to Use +## 🚀 Quick Start (Deploy & Run) -### 1. Connecting Nodes -Download the **Agent Node Bundle** from the "Nodes" page in the dashboard. Unzip and run `./run.sh` (Linux/macOS) or `run.bat` (Windows). The node will automatically connect to your Hub using the pre-configured security token. +Follow these steps to pull the code, launch the system locally, and configure your mesh: -### 2. Using Skills -Skills like **Browser Automation** and **Terminal Control** are available directly in your chat sessions. You can attach specific nodes to a session to give the AI hands-on access to those environments. +### 1. Pull the Code and Launch +```bash +git clone https://gitbucket.jerxie.com/git/yangyangxie/cortex-hub.git +cd cortex-hub +# Launch the interactive setup wizard +bash setup.sh +``` + +**The Setup Wizard will:** +1. Prompt you for an Admin Email address. +2. Automatically generate secure cryptographic keys and an initial `CORTEX_ADMIN_PASSWORD`. +3. Spin up the entire system via Docker Compose in the background. +4. Output your generated login credentials directly in the terminal—**save them!** + +**What components are spawned?** +When the Docker stack boots, the following services initialize: +* **`ai-hub` (API)**: The core Python API (FastAPI) handling orchestration, websocket streaming, RAG logic, and the SQLite Database (`cortex.db`). +* **`ai-frontend` (UI)**: The React-based dashboard served directly to your browser on port `8002`. +* **`browser-service`**: A dedicated high-performance Playwright container handling asynchronous heavy web scraping and visual rendering. + +* **Frontend UI**: [http://localhost:8002](http://localhost:8002) --- -## 🚀 Quick Start (Local Development) +## ⚙️ Initial Configuration -The easiest way to get started is using the pre-configured **Dev Container** or local Docker Compose. +Open the Frontend UI in your browser and sign in using the **Admin Email** and the auto-generated **Initial Password** from the setup script. Once authenticated, follow these steps to bootstrap your mesh: -### Prerequisites -* **Docker** & **Docker Compose** -* **Python 3.11+** (if running without Docker) -* **Node.js 18+** (for frontend development) +### 1. Set up your AI Provider +Navigate to the **Configuration** page via the sidebar. In the Settings pane, input and save your API Keys (e.g., Gemini, DeepSeek). The system requires a valid LLM provider to reason and execute tasks. -### 1. Configure Secrets & Keys -Most configurations and API Keys (Gemini, DeepSeek, TTS, STT) can be set dynamically via the visual **Settings** pane within the Web UI after booting. For deeper system overrides (like database location or custom proxy headers), you may review and edit `ai-hub/app/config.yaml`. +### 2. Configure Access Control +Access to nodes and skills is governed by granular Role-Based Access Control (RBAC). +1. Navigate to the **Groups** or **Admin** section. +2. Define a **User Group** and assign your user account to it. +3. Assign necessary system resources (Skills, Node access mappings, restricted Models) to this group so its members can utilize them. -### 2. Launch the Stack -Initialize the Hub (Backend, Frontend, Browser Service, and SQLite Database) in one command: -```bash -docker compose up -d --build -``` -* **Frontend**: [http://localhost:8002](http://localhost:8002) -* **API Docs**: [http://localhost:8000/docs](http://localhost:8000/docs) +### 3. Add a New Node into the Agent Mesh +To give the AI hands-on execution power, you must register and deploy a new "Node": +1. Navigate to the **Swarm Nodes** page in the UI. +2. Click **Register Node** to generate a unique Node Slug and an Invite Auth Token. +3. In your terminal (on the machine you want to use as a node), run the node deployment script: + ```bash + bash add_node.sh + # It will prompt you for the Node ID and Auth Token you just generated! + ``` +4. Watch the node's pulsing indicator turn green on your Swarm dashboard! +*(Note: We have extensively tested agent nodes on **macOS and Linux**. Windows deployment is not supported yet.)* + +### 4. Start Using Swarm Control +With your LLM configured and your local node connected, you can now enter **Swarm Control** or start a Chat session! You can attach specific nodes to your chat, granting the AI agent secure hands-on access to the file systems and terminals of those environments to complete workflows autonomously. ---