snapshot: NODE1 production state 2026-02-09
Complete snapshot of /opt/microdao-daarion/ from NODE1 (144.76.224.179).
This represents the actual running production code that has diverged
significantly from the previous main branch.
Key changes from old main:
- Gateway (http_api.py): expanded from ~40KB to 164KB with full agent support
- Router: new /v1/agents/{id}/infer endpoint with vision + DeepSeek routing
- Behavior Policy: SOWA v2.2 (3-level: FULL/ACK/SILENT)
- Agent Registry: config/agent_registry.yml as single source of truth
- 13 agents configured (was 3)
- Memory service integration
- CrewAI teams and roles
Excluded from snapshot: venv/, .env, data/, backups, .tgz archives
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
117
config/README.md
117
config/README.md
@@ -1,43 +1,106 @@
|
||||
# Config — конфігурація проекту
|
||||
# DAGI Agent Registry
|
||||
|
||||
## Як додавати нових агентів (NODA1 / Gateway)
|
||||
## Єдине джерело істини для всіх агентів
|
||||
|
||||
Агенти реєструються в **gateway-bot** і підключаються до Router. Для нового агента:
|
||||
Файл `agent_registry.yml` — ЄДИНЕ місце для визначення агентів.
|
||||
|
||||
### 1. Код у `gateway-bot/http_api.py`
|
||||
**НЕ редагуйте вручну:**
|
||||
- `gateway-bot/*_prompt.txt` (крім контенту промптів)
|
||||
- `services/router/router-config.yml` agents section
|
||||
- `services/crewai-service/` agent definitions
|
||||
|
||||
- Додати конфігурацію через `load_agent_config()`:
|
||||
- `agent_id`, `name`, `prompt_path` (файл у `gateway-bot/`), `telegram_token_env` (ім’я змінної середовища для Telegram-токена), `default_prompt`.
|
||||
- Додати запис у **AGENT_REGISTRY**: `"new_agent_id": NEW_AGENT_CONFIG`.
|
||||
- Додати webhook endpoint: `@router.post("/new_agent_id/telegram/webhook")` → `handle_telegram_webhook(NEW_AGENT_CONFIG, update)`.
|
||||
## Класи агентів
|
||||
|
||||
### 2. Файли в репо
|
||||
| Клас | Опис | Telegram |
|
||||
|------|------|----------|
|
||||
| `top_level` | Domain orchestrator, user-facing або private | public/whitelist/off |
|
||||
| `internal` | Platform service agent | off |
|
||||
|
||||
- **Prompt:** `gateway-bot/new_agent_id_prompt.txt` — system prompt агента.
|
||||
- На сервері (NODA1) у env контейнера gateway додати змінну з Telegram-токеном бота (наприклад `NEW_AGENT_TELEGRAM_BOT_TOKEN`).
|
||||
## Як додати нового агента
|
||||
|
||||
### 3. Router
|
||||
1. **Додайте запис в `agent_registry.yml`:**
|
||||
|
||||
Router приймає запити на `POST /v1/agents/{agent_id}/infer`. Якщо Router має окремий список агентів (наприклад `router_agents.json`), додати туди `new_agent_id`.
|
||||
```yaml
|
||||
- id: new_agent
|
||||
display_name: "New Agent"
|
||||
class: top_level
|
||||
visibility: public
|
||||
scope: global
|
||||
telegram_mode: public
|
||||
public_channels:
|
||||
telegram: true
|
||||
canonical_role: "Brief role description"
|
||||
mission: |
|
||||
Multi-line mission description.
|
||||
domains: [domain1, domain2]
|
||||
routing:
|
||||
priority: 70
|
||||
keywords: [keyword1, keyword2]
|
||||
llm_profile: reasoning
|
||||
prompt_file: new_agent_prompt.txt
|
||||
crewai:
|
||||
enabled: true
|
||||
orchestrator: true
|
||||
team:
|
||||
- role: "Team Member 1"
|
||||
skills: [skill1, skill2]
|
||||
handoff_contract:
|
||||
accepts_from: [daarwizz]
|
||||
can_delegate_to: [new_agent_team]
|
||||
```
|
||||
|
||||
### 4. Після змін на НОДА1
|
||||
2. **Створіть prompt файл:**
|
||||
```bash
|
||||
touch gateway-bot/new_agent_prompt.txt
|
||||
```
|
||||
|
||||
- Задеплоїти зміни (git pull у `/opt/microdao-daarion`).
|
||||
- Перезапустити Gateway: `docker restart dagi-gateway-node1`.
|
||||
- Перевірити: `curl -s http://localhost:9300/health | jq '.agents'` — новий агент має бути в списку з `prompt_loaded: true` і `telegram_token_configured: true`.
|
||||
3. **Валідуйте:**
|
||||
```bash
|
||||
python3 tools/agents validate
|
||||
```
|
||||
|
||||
---
|
||||
4. **Згенеруйте конфіги:**
|
||||
```bash
|
||||
python3 tools/agents generate
|
||||
```
|
||||
|
||||
## Інші конфіги у `config/`
|
||||
5. **Smoke test:**
|
||||
```bash
|
||||
python3 tools/agents smoke --id new_agent
|
||||
```
|
||||
|
||||
- **agents_city_mapping.yaml** — маппінг агентів для city/platform.
|
||||
- **data_cleanup_allowlist.yml** — allowlist для очистки даних.
|
||||
- **brand/** — конфіги брендів.
|
||||
## CLI команди
|
||||
|
||||
---
|
||||
```bash
|
||||
# Список всіх агентів
|
||||
python3 tools/agents list
|
||||
|
||||
## Документація
|
||||
# Валідація registry
|
||||
python3 tools/agents validate
|
||||
|
||||
- **PROJECT-MASTER-INDEX.md** — єдина точка входу до документації, швидкі команди.
|
||||
- **docs/NODA1-AGENT-ARCHITECTURE.md** — архітектура агентів на НОДА1.
|
||||
- **docs/NODA1-AGENT-VERIFICATION.md** — перевірка агентів на НОДА1.
|
||||
# Генерація конфігів
|
||||
python3 tools/agents generate
|
||||
|
||||
# Smoke test агента
|
||||
python3 tools/agents smoke --id <agent_id>
|
||||
```
|
||||
|
||||
## Feature Flags
|
||||
|
||||
В `agent_registry.yml`:
|
||||
|
||||
```yaml
|
||||
feature_flags:
|
||||
registry_enabled: true # Master switch
|
||||
generate_prompts: true # Generate gateway/agent_registry.json
|
||||
generate_router_config: true # Generate config/router_agents.json
|
||||
generate_crewai_config: true # Generate config/crewai_agents.json
|
||||
```
|
||||
|
||||
## Згенеровані файли
|
||||
|
||||
Не редагуйте напряму:
|
||||
|
||||
- `gateway-bot/agent_registry.json` - Gateway agent metadata
|
||||
- `config/router_agents.json` - Router agent configs
|
||||
- `config/crewai_agents.json` - CrewAI orchestrator/worker definitions
|
||||
|
||||
Reference in New Issue
Block a user