Skip to content

feat(skillogy): target a managed, persistent Neo4j (database env + seed-on-empty)#759

Merged
PurpleCHOIms merged 2 commits into
mainfrom
feat/skillogy-neo4j-database-env
Jul 8, 2026
Merged

feat(skillogy): target a managed, persistent Neo4j (database env + seed-on-empty)#759
PurpleCHOIms merged 2 commits into
mainfrom
feat/skillogy-neo4j-database-env

Conversation

@PurpleCHOIms

@PurpleCHOIms PurpleCHOIms commented Jul 8, 2026

Copy link
Copy Markdown
Member

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. Read SKILLOGY_NEO4J_DATABASE (default neo4j, unchanged for compose / self-hosted); Neo4jBackend already accepts the database kwarg.

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-statement skills.cypher on every boot, gated by SKILLOGY_AUTO_INGEST=1. The MERGE dump 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_INGEST is removed entirely (env read, Dockerfile ENV, 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

PurpleCHOIms and others added 2 commits July 8, 2026 14:11
_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>
@PurpleCHOIms PurpleCHOIms changed the title feat(skillogy): honor SKILLOGY_NEO4J_DATABASE for managed Neo4j backends feat(skillogy): target a managed, persistent Neo4j (database env + seed-on-empty) Jul 8, 2026
@PurpleCHOIms PurpleCHOIms merged commit 8035a1c into main Jul 8, 2026
25 checks passed
@PurpleCHOIms PurpleCHOIms deleted the feat/skillogy-neo4j-database-env branch July 8, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant