feat(skillogy): target a managed, persistent Neo4j (database env + seed-on-empty)#759
Merged
Merged
Conversation
_build_backend() hardcoded the default database ("neo4j") for every
deployment. Managed Neo4j (e.g. Aura Free) names the database after the
instance id, so the skillogy server could not target it without patching
the module at build time. Read SKILLOGY_NEO4J_DATABASE (default "neo4j",
unchanged for compose/self-hosted); Neo4jBackend already accepts the
database kwarg.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The skill graph is persistent — a managed Neo4j (Aura), or a self-hosted instance with a data volume (docker-compose mounts neo4j_data:/data). Yet _maybe_ingest replayed the whole ~6000-statement skills.cypher on every boot, gated by SKILLOGY_AUTO_INGEST=1. The MERGE dump made that correct but pure waste: it re-touches thousands of already-present nodes for no net change, and against a slow/remote managed backend the re-ingest can be cut off mid-run by a scale-down. Replace the boolean toggle with an automatic guard: seed skills.cypher only when the graph is empty (health().skill_count == 0). A fresh/first- boot database self-heals; a populated one is a cheap no-op count check. Adding a skill is now an out-of-band incremental ingest (rebuild the cypher for the new SKILL.md and apply it), not something a boot re-derives. SKILLOGY_AUTO_INGEST is removed (env, Dockerfile ENV, docker-compose) — persistence is the model, so the toggle has no purpose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two coupled changes that let skillogy run against a managed, persistent Neo4j (e.g. Aura Free) instead of an ephemeral, re-seeded-every-boot one.
1. Honor
SKILLOGY_NEO4J_DATABASE_build_backend()hardcoded the default database name (neo4j). Managed Neo4j names the database after the instance id, so the server could not connect without patching the module at image-build time. ReadSKILLOGY_NEO4J_DATABASE(defaultneo4j, unchanged for compose / self-hosted);Neo4jBackendalready accepts thedatabasekwarg.2. Seed on empty instead of re-ingesting every boot
The skill graph is persistent — a managed Neo4j, or the self-hosted compose instance (which mounts
neo4j_data:/data). Yet the boot path replayed the whole ~6000-statementskills.cypheron every boot, gated bySKILLOGY_AUTO_INGEST=1. TheMERGEdump made that correct but pure waste (re-touches thousands of already-present nodes), and against a slow/remote managed backend the re-ingest can be cut off mid-run by a scale-down, leaving a partial graph.Replace the boolean toggle with an automatic guard: seed only when the graph is empty (
health().skill_count == 0). A fresh/first-boot DB self-heals; a populated one is a cheap no-op count check. Adding a skill becomes an out-of-band incremental ingest, not something a boot re-derives.SKILLOGY_AUTO_INGESTis removed entirely (env read, DockerfileENV, docker-compose).Behavior change to note
An image upgrade that adds skills no longer auto-applies them on boot against an already-populated persistent DB; apply the delta out of band. Fresh/ephemeral databases are unaffected (empty → seed).
Test
tests/unit/skillogy/test_seed.py— populated graph is never re-seeded; empty graph seeds exactly once. Managed backend verified live against an Aura Free instance (database == instance id).🤖 Generated with Claude Code