Skip to content

Conversation

gkswns0531
Copy link

@gkswns0531 gkswns0531 commented Jul 21, 2025

I would like to sincerely thank the MS GraphRAG team for creating such an outstanding project. It’s truly impressive, and I’ve been very eager to use it myself. However, since the environment I work in is based entirely on ElasticSearch, I ran into compatibility limitations with the existing vector store options. To address this, I implemented ElasticSearch support myself and am submitting this PR in the hope that it can be merged into the main project.

Description

Adds ElasticSearch vector store support to GraphRAG following the existing LanceDB implementation pattern. Enables enterprise organizations with ElasticSearch infrastructure to use GraphRAG without additional vector databases.

What's Implemented

  • ElasticSearchVectorStore: Complete BaseVectorStore interface implementation
  • Factory Integration: Added to VectorStoreFactory with elasticsearch type
  • Enterprise Features: KNN search, bulk operations, dynamic vector dimensions
  • Full Compatibility: Zero breaking changes, works alongside existing stores

Testing

  • 11 integration tests - 100% pass rate
  • Validated: Real GraphRAG indexing/search workflows

Usage

vector_store:
  default_vector_store:
    type: elasticsearch
    url: "http://localhost:9200"
    es_index_name: "graphrag_entities"

Files Changed

  • graphrag/vector_stores/elasticsearch.py (+217 lines) - Core implementation
  • tests/integration/vector_stores/test_elasticsearch.py (+315 lines) - Tests
  • graphrag/vector_stores/factory.py (+4 lines) - Factory integration
  • pyproject.toml (+1 line) - Dependency

Impact

  • No Breaking Changes: Existing code continues to work
  • Enterprise Ready: Leverages existing ElasticSearch infrastructure
  • Production Tested: Validated with real GraphRAG workflows

Related Issues

#2001

Checklist

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary).
  • I have added appropriate unit tests (if applicable).

…ility

- Implement ElasticSearchVectorStore following BaseVectorStore interface
- Add comprehensive integration tests with 100% coverage
- Support dynamic vector dimensions like LanceDB
- Include KNN search optimization with cosine similarity
- Add bulk operations with automatic index refresh
- Ensure full compatibility with existing GraphRAG workflows
- Follow Microsoft coding standards and patterns

Addresses enterprise RAG infrastructure compatibility needs
where organizations already have ElasticSearch deployments.
@gkswns0531
Copy link
Author

@microsoft-github-policy-service agree

@gkswns0531 gkswns0531 changed the title feat: Add ElasticSearch vector store support with enterprise compatib… feat: Add ElasticSearch vector store support Jul 21, 2025
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