Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/integrations-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ jobs:
context: .
dockerfile: Dockerfile
image_name: pmoves-yt
- name: deepresearch
git_url: https://github.com/POWERFULMOVES/PMOVES.AI.git
ref: main
context: pmoves
dockerfile: services/deepresearch/Dockerfile
image_name: pmoves-deepresearch
- name: supaserch
git_url: https://github.com/POWERFULMOVES/PMOVES.AI.git
ref: main
context: pmoves
dockerfile: services/supaserch/Dockerfile
image_name: pmoves-supaserch
# To add other integrations, duplicate one of the entries above.
# Example (commented):
# - name: open-notebook
Expand Down
59 changes: 57 additions & 2 deletions pmoves/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ up-agents-published: ## Start Agents (NATS, Agent Zero, Archon, etc.) using publ
@echo "✔ Agents started using published images. Override AGENT_ZERO_IMAGE/ARCHON_IMAGE to pin versions."

.PHONY: up-agents-ui
up-agents-ui: ## Start Agents APIs + UIs (NATS, Agent Zero, Archon, Archon UI) using published images where available
@docker compose -p $(PROJECT) -f docker-compose.yml -f docker-compose.agents.images.yml --profile agents up -d nats agent-zero archon archon-ui mesh-agent publisher-discord
up-agents-ui: ## Start Agents APIs + UIs (NATS, Agent Zero, Archon, Archon UI, DeepResearch)
@docker compose -p $(PROJECT) -f docker-compose.yml -f docker-compose.agents.images.yml --profile agents up -d nats agent-zero archon archon-ui mesh-agent deepresearch supaserch publisher-discord
@echo "✔ Agents (APIs + UIs) started. Open Agent Zero UI: $${NEXT_PUBLIC_AGENT_ZERO_UI_URL:-http://localhost:8081} Archon UI: $${NEXT_PUBLIC_ARCHON_UI_URL:-http://localhost:3737}"

.PHONY: a0-mcp-seed
Expand All @@ -511,6 +511,30 @@ archon-ui-smoke: ## Verify Archon API and UI endpoints are reachable (200)
if [ "$$ui" != "200" ]; then echo "✖ archon UI / => $$ui" && exit 1; fi; \
echo "✔ archon API/ UI healthy (API $$api, UI $$ui)"

.PHONY: deepresearch-health
deepresearch-health: ## Check DeepResearch health endpoint (200 expected)
@code=$$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8098/healthz || true); \
if [ "$$code" != "200" ]; then echo "✖ deepresearch /healthz => $$code" && exit 1; fi; \
echo "✔ deepresearch /healthz 200"

.PHONY: supaserch-health
supaserch-health: ## Check SupaSerch health endpoint (200 expected)
@code=$$(curl -s -o /dev/null -w "%{http_code}" http://localhost:$${SUPASERCH_HOST_PORT:-8099}/healthz || true); \
if [ "$$code" != "200" ]; then echo "✖ supaserch /healthz => $$code" && exit 1; fi; \
echo "✔ supaserch /healthz 200"

.PHONY: build-push-supaserch
build-push-supaserch: buildx-setup docker-login ## Build+push SupaSerch multi-arch image
@ctx=$$(pwd); \
df=$$ctx/services/supaserch/Dockerfile; \
img=$(REGISTRY)/$(IMAGE_NAMESPACE)/pmoves-supaserch:$(IMAGE_TAG); \
echo "→ Building $$img"; \
docker buildx build --platform $(TARGET_PLATFORMS) -f "$$df" -t "$$img" "$$ctx" --push

.PHONY: deepresearch-smoke
deepresearch-smoke: ## Publish a sample DeepResearch request and wait for a result (requires worker running)
@$(LOAD_ENV_SHARED) python3 tools/deepresearch_smoke.py --timeout $${DEEPRESEARCH_SMOKE_TIMEOUT:-30}

.PHONY: agents-integrations-clone agents-integrations-pull build-agents-integrations up-agents-integrations
agents-integrations-clone: ## Clone your forks into $(INTEGRATIONS_WORKSPACE)
@mkdir -p "$(INTEGRATIONS_WORKSPACE)" && cd "$(INTEGRATIONS_WORKSPACE)"; \
Expand Down Expand Up @@ -1773,3 +1797,34 @@ yt-integrations-push: ## Push fork-built image to GHCR (requires docker login gh

yt-image-local: ## Build pmoves-yt locally from services/pmoves-yt with optional YTDLP_VERSION
@bash -lc 'cd services/pmoves-yt && docker build --build-arg YTDLP_VERSION="$${YTDLP_VERSION:-}" -t ghcr.io/powerfulmoves/pmoves-yt:local .'
# -------- Multi-arch builds (local) --------
.PHONY: buildx-setup docker-login build-push-archon-ui build-push-deepresearch

REGISTRY ?= docker.io
TARGET_PLATFORMS ?= linux/amd64,linux/arm64
IMAGE_NAMESPACE ?= $(DOCKER_USERNAME)
IMAGE_TAG ?= pmoves-latest

buildx-setup: ## Enable QEMU + buildx for multi-arch builds
@docker run --privileged --rm tonistiigi/binfmt --install all >/dev/null 2>&1 || true
@docker buildx create --use --name pmoves-builder >/dev/null 2>&1 || docker buildx use pmoves-builder
@echo "✔ buildx ready (platforms: $(TARGET_PLATFORMS))"

docker-login: ## Login to registry (set DOCKER_USERNAME/DOCKER_PASS and optionally REGISTRY)
@if [ -z "$$DOCKER_USERNAME" ] || [ -z "$$DOCKER_PASS" ]; then echo "✖ Set DOCKER_USERNAME and DOCKER_PASS" && exit 1; fi
@echo "$$DOCKER_PASS" | docker login -u "$$DOCKER_USERNAME" --password-stdin $(REGISTRY)
@echo "✔ Logged in to $(REGISTRY) as $$DOCKER_USERNAME"

build-push-archon-ui: buildx-setup docker-login ## Build+push Archon UI multi-arch image
@ctx=$${ARCHON_UI_BUILD_CONTEXT:-$$(pwd)/../integrations-workspace/PMOVES-Archon/archon-ui-main}; \
df=$${ARCHON_UI_DOCKERFILE:-$$ctx/Dockerfile}; \
img=$(REGISTRY)/$(IMAGE_NAMESPACE)/pmoves-archon-ui:$(IMAGE_TAG); \
echo "→ Building $$img from $$ctx"; \
docker buildx build --platform $(TARGET_PLATFORMS) -f "$$df" -t "$$img" "$$ctx" --push

build-push-deepresearch: buildx-setup docker-login ## Build+push DeepResearch worker multi-arch image
@ctx=$$(pwd); \
df=$$ctx/services/deepresearch/Dockerfile; \
img=$(REGISTRY)/$(IMAGE_NAMESPACE)/pmoves-deepresearch:$(IMAGE_TAG); \
echo "→ Building $$img"; \
docker buildx build --platform $(TARGET_PLATFORMS) -f "$$df" -t "$$img" "$$ctx" --push
18 changes: 18 additions & 0 deletions pmoves/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,26 @@ services:
- OPEN_NOTEBOOK_API_URL=${OPEN_NOTEBOOK_API_URL}
- OPEN_NOTEBOOK_API_TOKEN=${OPEN_NOTEBOOK_API_TOKEN}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- DEEPRESEARCH_HEALTH_PORT=${DEEPRESEARCH_HEALTH_PORT:-8098}
depends_on: [nats]
profiles: ["agents"]
ports: ["8098:8098"]
networks: [pmoves]

supaserch:
build:
context: ./services
dockerfile: supaserch/Dockerfile
image: ${SUPASERCH_IMAGE:-}
restart: unless-stopped
env_file: [env.shared.generated, env.shared, .env.generated, .env.local]
environment:
- SUPASERCH_PORT=${SUPASERCH_PORT:-8099}
- NATS_URL=${NATS_URL:-nats://nats:4222}
- HIRAG_URL=${HIRAG_URL:-http://hi-rag-gateway-v2:8086}
- SUPA_REST_URL=${SUPA_REST_URL:-http://host.docker.internal:65421/rest/v1}
ports: ["${SUPASERCH_HOST_PORT:-8099}:8099"]
profiles: ["agents","workers"]
networks: [pmoves]

publisher-discord:
Expand Down
11 changes: 11 additions & 0 deletions pmoves/docs/NEXT_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ Next 48 hours
- [ ] Seed Neo4j with the brand alias dictionary (DARKXSIDE, POWERFULMOVES, plus pending community submissions) and record Cypher script locations (draft plan in `SESSION_IMPLEMENTATION_PLAN.md`).
- [ ] Outline relation-extraction passes from captions/notes to candidate graph edges; define success metrics and owner in the project tracker.
- [ ] Prepare reranker parameter sweep plan (datasets, toggles, artifact storage) for integration into CI, aligning with the prep checklist captured in `SESSION_IMPLEMENTATION_PLAN.md` and ensuring persona publish gating thresholds stay versioned.

### 3b. PMOVES‑SUPASERCH (Branded, Multimodal Deep Research)

- [x] Scaffold service + image (`pmoves-supaserch`) with `/healthz` and CI entries.
- [ ] Wire NATS subjects `supaserch.request.v1`/`supaserch.result.v1` and broker orchestration to:
- DeepResearch worker (OpenRouter/local) for planning/execution
- Archon/Agent Zero via MCP for codegen/crawling/tool use
- CHIT geometry bus for CGP emissions; persist in Supabase
- [ ] Add OpenAPI + metrics; expand Grafana dashboard panels
- [ ] Integrate SupaSerch into the Console (links + status)
- [ ] Harden continuous‑run profile for VM nodes (restart policy, network access, backpressure)
- Notes: Qwen default on GPU path is in place; sweeps should compare Qwen vs BGE vs Cohere/Azure on the real datasets under `services/retrieval-eval/datasets/` and publish artifacts.

### 4. PMOVES.YT High-Priority Lane
Expand Down
6 changes: 6 additions & 0 deletions pmoves/docs/SMOKETESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,4 +594,10 @@ make -C pmoves archon-mcp-smoke

# Verify Archon API/ UI endpoints return 200
make -C pmoves archon-ui-smoke

# DeepResearch health (worker)
make -C pmoves deepresearch-health

# DeepResearch NATS smoke (requires worker running)
make -C pmoves deepresearch-smoke
```
4 changes: 3 additions & 1 deletion pmoves/docs/services/monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ What’s wired by default
- hi-rag-gateway-v2-gpu: http://localhost:${HIRAG_V2_GPU_HOST_PORT:-8087}/hirag/healthz
- presign: http://localhost:8088/healthz
- archon: http://localhost:8091/healthz
- channel-monitor: http://localhost:8097/healthz
- channel-monitor: http://localhost:8097/healthz
- deepresearch: http://localhost:8098/healthz
- jellyfin overlay: http://localhost:9096
- tensorzero UI: http://localhost:4000
- n8n: http://localhost:5678
Expand All @@ -38,6 +39,7 @@ Env knobs

Notes
- On Docker Desktop for Windows/macOS, cAdvisor’s kernel mounts can be limited. If cAdvisor reports unhealthy or fails to start, it will auto-retry; you can also temporarily comment out the service or run only on Linux hosts. The rest of the monitoring stack (Prometheus, Grafana, Blackbox, Loki/Promtail) works cross‑platform.
- DeepResearch health is a lightweight FastAPI endpoint inside the worker (port `8098`); it reports `nats_connected` and returns 200 if the process is live.

Linking Agent Zero / Archon traces (future)
- Both services can emit OpenTelemetry (OTLP). When you enable an OTLP collector, set:
Expand Down
49 changes: 49 additions & 0 deletions pmoves/docs/services/supaserch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# PMOVES‑SUPASERCH (Multimodal Holographic Deep Research)

PMOVES‑SUPASERCH (image: `pmoves-supaserch`) is a branded, long‑running, agent‑assisted research service that:

- Orchestrates multimodal research using:
- DeepResearch worker (OpenRouter/local providers)
- Archon/Agent Zero tools via MCP (codegen, crawling, tasking)
- CHIT Geometry Bus for structured representations
- Supabase/Qdrant/Meili indices for recall
- Surfaces rich, dynamic results to users and PMOVES agents; designed to run continuously in a VM with Internet access.

## Ports & Health
- HTTP: `${SUPASERCH_HOST_PORT:-8099}` → `/healthz` returns `{ "status": "ok" }`.

## Environment
- `SUPASERCH_IMAGE` (optional override) — container image to run.
- `SUPASERCH_PORT` (default `8099`) — container HTTP port.
- `NATS_URL` — event bus for request/result envelopes.
- `SUPA_REST_URL`, `HIRAG_URL` — REST + Geometry endpoints.

## Compose
Service is defined in `pmoves/docker-compose.yml` under profile `agents`/`workers`.

## Monitoring
- Prometheus blackbox probes `/healthz` (job: `supaserch`).
- Grafana Services Overview shows “Up: SupaSerch”.

## Roadmap Tie‑ins
- Geometry/CHIT first‑class: SUPASERCH will emit geometry packets for downstream decoding.
- Agentic self‑evolving: Agent Zero can task Archon to clone repos and drive code changes (Claude/code LLMs) against local models, with optional cloud assistance.
- Continuous mode: service can run indefinitely (VM/lab nodes), enriching the knowledge graph and indices.

## Build & Publish
- Local multi‑arch push:

```bash
export DOCKER_USERNAME=…
export DOCKER_PASS=…
make -C pmoves docker-login buildx-setup \
build-push-supaserch REGISTRY=docker.io IMAGE_NAMESPACE=$DOCKER_USERNAME IMAGE_TAG=vYYYYMMDD
```

- GHCR CI: `.github/workflows/integrations-ghcr.yml` builds `pmoves-supaserch` nightly and on demand.

## Integration Points
- NATS subjects (draft): `supaserch.request.v1`, `supaserch.result.v1`
- MCP (future): `mcp://http?endpoint=http://archon_mcp:8051` for tooling
- CHIT bus: emits CGP packets to geometry gateway and Supabase channels.

18 changes: 17 additions & 1 deletion pmoves/monitoring/grafana/dashboards/services-overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,26 @@
{ "expr": "probe_success{instance=\"http://host.docker.internal:8091/healthz\"}" }
]
},
{
"type": "stat",
"title": "Up: DeepResearch",
"gridPos": { "x": 0, "y": 4, "w": 6, "h": 4 },
"targets": [
{ "expr": "probe_success{job=\"deepresearch\",instance=\"http://host.docker.internal:8098/healthz\"}" }
]
},
{
"type": "stat",
"title": "Up: SupaSerch",
"gridPos": { "x": 18, "y": 4, "w": 6, "h": 4 },
"targets": [
{ "expr": "probe_success{job=\"supaserch\",instance=\"http://host.docker.internal:8099/healthz\"}" }
]
},
{
"type": "graph",
"title": "HTTP Probe Duration",
"gridPos": { "x": 0, "y": 4, "w": 12, "h": 8 },
"gridPos": { "x": 6, "y": 4, "w": 12, "h": 8 },
"targets": [
{ "expr": "probe_duration_seconds{job=\"blackbox_http\"}", "legendFormat": "{{instance}}" }
]
Expand Down
30 changes: 30 additions & 0 deletions pmoves/monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,33 @@ scrape_configs:
- job_name: channel_monitor
static_configs:
- targets: ["channel-monitor:8097"]

- job_name: deepresearch
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://host.docker.internal:8098/healthz # deepresearch worker health
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115

- job_name: supaserch
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://host.docker.internal:${SUPASERCH_HOST_PORT:-8099}/healthz
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115
2 changes: 2 additions & 0 deletions pmoves/services/deepresearch/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
httpx==0.27.2
nats-py==2.8.0
fastapi==0.112.1
uvicorn[standard]==0.30.6
20 changes: 20 additions & 0 deletions pmoves/services/deepresearch/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ def _handle_request(payload: Dict[str, Any]) -> Tuple[Optional[ResearchRequest],

import httpx
from nats.aio.client import Client as NATS
from fastapi import FastAPI
import uvicorn
from nats.aio.msg import Msg

from services.common.events import envelope
Expand Down Expand Up @@ -580,6 +582,24 @@ async def main() -> None:
await nc.connect(servers=[nats_url])
LOGGER.info("DeepResearch worker connected to NATS at %s", nats_url)

# Lightweight health server (optional blackbox probe)
app = FastAPI(title="DeepResearch Health")

@app.get("/healthz")
async def healthz(): # type: ignore[override]
return {
"status": "ok",
"nats_connected": bool(nc.is_connected),
}

async def _serve_health():
port = int(os.getenv("DEEPRESEARCH_HEALTH_PORT", "8098"))
config = uvicorn.Config(app, host="0.0.0.0", port=port, log_level="info")
server = uvicorn.Server(config)
await server.serve()

asyncio.create_task(_serve_health())

async def cb(msg: Msg) -> None:
await _handle_request(msg, runner, publisher, nc)

Expand Down
16 changes: 16 additions & 0 deletions pmoves/services/supaserch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*

COPY services/supaserch/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /tmp/requirements.txt

COPY services /app/services
ENV PYTHONPATH=/app
ENV SUPASERCH_PORT=8099
CMD ["uvicorn", "services.supaserch.app:app", "--host", "0.0.0.0", "--port", "8099"]

29 changes: 29 additions & 0 deletions pmoves/services/supaserch/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from __future__ import annotations

import os
from typing import Any, Dict

from fastapi import FastAPI

app = FastAPI(title="PMOVES-SUPASERCH", version="0.1.0")


@app.get("/healthz")
async def healthz() -> Dict[str, Any]:
return {
"status": "ok",
"service": "pmoves-supaserch",
"chit": True,
"geometry_bus": True,
}


@app.get("/v1/search")
async def search(q: str) -> Dict[str, Any]:
# Placeholder multimodal deep research aggregator; will orchestrate:
# - OpenDeepResearch / DeepResearch worker
# - Archon / Agent Zero tool calls (MCP)
# - CHIT geometry bus for structured outputs
# - Supabase/Qdrant/Meili indexes
return {"query": q, "results": [], "notes": "stub"}

5 changes: 5 additions & 0 deletions pmoves/services/supaserch/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fastapi==0.112.1
uvicorn[standard]==0.30.6
httpx==0.27.2
nats-py==2.8.0

Loading
Loading