Saltar al contenido principal

Entity Graph And Service Control

AlphaSwarm now treats the entity graph as the canonical relationship layer for instruments, companies, datasets, pipeline assets, and service metadata. Postgres remains the compatibility store for existing APIs, while Neo4j is the graph backend when ALPHASWARM_GRAPH_STORE=neo4j.

Local Services​

Start the local stack with the visualization overlay:

docker compose -f alphaswarm_platform/compose/docker-compose.yml -f alphaswarm_platform/compose/docker-compose.viz.yml --profile visualization up -d

Neo4j is part of the base compose file and is exposed on:

  • Browser: http://localhost:7474
  • Bolt: bolt://localhost:7687

Relevant env keys:

ALPHASWARM_GRAPH_STORE=neo4j
ALPHASWARM_NEO4J_URI=bolt://localhost:7687
ALPHASWARM_NEO4J_USER=neo4j
ALPHASWARM_NEO4J_PASSWORD=aqpneo4j
ALPHASWARM_NEO4J_DATABASE=neo4j
ALPHASWARM_ENTITY_GRAPH_SYNC_ENABLED=true

Entity Sync​

The active instrument cache reads from the existing instruments table and upserts each instrument as a security entity with identifiers for vt_symbol, ticker, and any instrument metadata identifiers.

Dataset registration for market-bar datasets links dataset versions to the instrument entities they describe. Airbyte and Dagster metadata syncs also write service nodes and relationships so the graph can show ingestion and pipeline context around datasets.

Useful endpoints:

  • GET /registry/entities/graph/explorer
  • GET /registry/entities/instruments/active
  • POST /registry/entities/instruments/sync
  • POST /registry/entities/instruments/load-template

Service Manager​

The service manager aggregates health/config/logs for:

  • Trino
  • Polaris
  • Iceberg
  • Superset
  • Airbyte
  • Dagster
  • Neo4j

Useful endpoints:

  • GET /service-manager/health
  • GET /service-manager/{service}/health
  • GET /service-manager/{service}/logs
  • POST /service-manager/{service}/actions

Lifecycle actions and logs are guarded by ALPHASWARM_SERVICE_CONTROL_ENABLED=true because they invoke Docker Compose from inside the API process.

UI​

  • /data/entity-graph exposes the Neo4j-backed entity graph and active instrument list (in alphaswarm_client).
  • As of this review, alphaswarm_client ships API client helpers for the service-manager (src/lib/api/serviceManager.ts) and Dagster (src/lib/api/dagster.ts) endpoints above, but no route currently mounts a /data/services or /workflows/data page consuming them — the service-health-cards and Dagster-assets UI described here is not yet wired up in the frontend.