Skip to content

feat(neo4j): implement InsertDocuments for Neo4jVectorIndex#1636

Open
abhicris wants to merge 1 commit into0xPlaygrounds:mainfrom
kcolbchain:feat/neo4j-insert-documents
Open

feat(neo4j): implement InsertDocuments for Neo4jVectorIndex#1636
abhicris wants to merge 1 commit into0xPlaygrounds:mainfrom
kcolbchain:feat/neo4j-insert-documents

Conversation

@abhicris
Copy link
Copy Markdown

Summary

  • Implements the InsertDocuments trait for Neo4jVectorIndex, enabling document insertion with embeddings
  • Uses UNWIND $items AS item CREATE (n:Label) SET n = item Cypher pattern for efficient batch insertion
  • Flattens serialized document properties directly onto the node (object docs) or stores as a document property (non-object docs)
  • Stores embedding vector and embedded_text alongside document properties
  • Adds node_label field to IndexConfig so the correct label is used for inserted nodes
  • get_index now fetches labelsOrTypes from SHOW VECTOR INDEXES and populates node_label automatically

Partial fix for #565 (Neo4j provider; other providers can follow the same pattern)

Test plan

  • cargo check -p rig-neo4j passes
  • Integration test with a live Neo4j instance: insert documents, then query via top_n to verify round-trip

🤖 Generated with Claude Code

Adds InsertDocuments trait implementation for the Neo4j vector store,
enabling document insertion with embeddings via UNWIND + CREATE Cypher
queries. Also fetches the node label from the vector index metadata
(labelsOrTypes) so inserted nodes match the index automatically.

Partial fix for 0xPlaygrounds#565

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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