Skip to content

Foundation: native Neo4j 5.x vector index for schema embeddings #30

Description

@peter7775

Problem Statement

Planned AI features (semantic schema search, transformation rule suggestions, text-to-Cypher) need to store and query vector embeddings. The application currently has no vector infrastructure at all (no vector/embedding references anywhere in the codebase).

Proposed Solution

  • After the Neo4j and driver upgrades land, add a Cypher migration/setup step that creates a VECTOR INDEX on nodes representing schema elements (columns/tables), using Neo4j 5.13+ syntax.
  • Extend the domain model (internal/domain/models/) with an embedding vector field for schema nodes.
  • Add repository methods wrapping db.index.vector.queryNodes() in internal/infrastructure/persistence/neo4j/repository.go.

Alternative Solutions

Store embeddings outside Neo4j (pgvector, in-memory). Simpler to start with, but prevents combined graph+vector queries in a single Cypher statement.

Use Case

Foundation for: semantic schema search, transformation rule suggestions, text-to-Cypher.

Priority Level

Nice to have

Implementation Ideas

  • Vector dimension depends on the chosen embedding model (see the EmbeddingProvider port issue).
  • Decide between cosine and euclidean similarity in the Neo4j vector index config.

Additional Context

Depends on: "Upgrade Neo4j server from 4.4 to 5.13+" and "Migrate neo4j-go-driver from v4 to v5". Related to: "EmbeddingProvider port" issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseDatabase related changes - MySQL, Neo4j, queriesenhancementImprovement to existing functionalityfeatureNew feature or functionalityneeds-discussionRequires team discussion before implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions