Skip to content

Add an opt-in --ingest-on-startup flag

Choose a tag to compare

@ZmeiGorynych ZmeiGorynych released this 13 May 09:21
· 380 commits to main since this release
c3cd312

SLayer 0.6.1 Release Notes

A maintenance release: one PR since 0.6.0 adds an opt-in boot-time auto-ingest path for long-running servers. No schema changes; no breaking changes.

--ingest-on-startup for slayer serve and slayer mcp (DEV-1392)

A new opt-in flag on slayer serve and slayer mcp runs idempotent auto-ingestion across every configured datasource before the server starts listening, so an agent that connects immediately after boot finds the catalog already populated instead of racing the first ingest.

Three equivalent entry points: the --ingest-on-startup CLI flag, the SLAYER_INGEST_ON_STARTUP env var (truthy values 1 / true / yes; flag wins over env), and the ingest_on_startup=True kwarg on create_app / create_mcp_server for programmatic embedders.

Sequential, sync-before-listen ? uvicorn / mcp.run don't start until ingestion finishes ? and continue-on-failure per datasource so one broken connection string can't block the rest. Only storage.list_datasources() raising prevents server startup. Drift entries discovered during ingest are printed to stderr but never auto-applied; destructive cleanup stays gated behind slayer validate-models --force-clean.

All progress output goes to stderr so slayer mcp stdio JSON-RPC stays protocol-safe.

When the embedding-search third channel is active (embedding_search extra installed + provider key in the environment), startup ingest also refreshes per-datasource embeddings through the existing _refresh_datasource_embeddings hook, which hash-skips entities whose content hasn't changed.

The recommended MCP setup snippets in docs/getting-started/mcp.md now include embedding_search in the uvx --from 'motley-slayer[...]' extras list and document the provider-key contract (OPENAI_API_KEY by default; override the model with SLAYER_EMBEDDING_MODEL=voyage/... plus the matching provider key).

Implementation refactors: _friendly_db_error moved from slayer/mcp/server.py to slayer/engine/ingestion.py; _print_ingest_addition / _print_ingest_drift_and_errors moved from slayer/cli.py to slayer/engine/ingestion.py and gained a file= kwarg (resolved at call time, not import time, so contextlib.redirect_stdout callers are honoured).

46 tests in tests/test_startup_ingest.py cover orchestrator behaviour, CLI flag plumbing, env-var precedence, demo-then-ingest ordering, programmatic kwarg paths, and propagation of list_datasources errors.

Schema versions

SlayerModel remains version 6, SlayerQuery remains version 3, DatasourceConfig remains version 1. No storage migrations were needed for this release.