Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch: add ElasticsearchRetriever #18587

Merged
merged 3 commits into from Mar 6, 2024

Conversation

maxjakob
Copy link
Contributor

@maxjakob maxjakob commented Mar 5, 2024

Implement Retriever interface for Elasticsearch.

I opted to only expose the body, which gives you full flexibility, and none the other 68 arguments of the search method.

Added a user agent header for usage tracking in Elastic Cloud.

@efriis efriis added the partner label Mar 5, 2024
@efriis efriis self-assigned this Mar 5, 2024
Copy link

vercel bot commented Mar 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 6, 2024 0:40am

@maxjakob maxjakob marked this pull request as ready for review March 5, 2024 17:17
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 5, 2024
@maxjakob
Copy link
Contributor Author

maxjakob commented Mar 5, 2024

CC @joemcelroy

@dosubot dosubot bot added Ɑ: retriever Related to retriever module 🔌: elasticsearch Primarily related to elastic/elasticsearch integrations 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Mar 5, 2024
Comment on lines 29 to 30
langchain = { path = "../../langchain", develop = true }
langchain-community = { path = "../../community", develop = true }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the factoring out of text splitters allow us to remove either of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, community can be removed here since it's pulled in via langchain anyways. Added a PR: #18644

(We need langchain for the chat history test.)

from langchain.memory import ConversationBufferMemory

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Mar 6, 2024
@efriis efriis enabled auto-merge (squash) March 6, 2024 00:40
@efriis efriis merged commit ee7a795 into langchain-ai:master Mar 6, 2024
20 checks passed
thebhulawat pushed a commit to thebhulawat/langchain that referenced this pull request Mar 6, 2024
Implement
[Retriever](https://python.langchain.com/docs/modules/data_connection/retrievers/)
interface for Elasticsearch.

I opted to only expose the `body`, which gives you full flexibility, and
none the other 68 arguments of the [search
method](https://elasticsearch-py.readthedocs.io/en/v8.12.1/api/elasticsearch.html#elasticsearch.Elasticsearch.search).

Added a user agent header for usage tracking in Elastic Cloud.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
bechbd pushed a commit to bechbd/langchain that referenced this pull request Mar 29, 2024
Implement
[Retriever](https://python.langchain.com/docs/modules/data_connection/retrievers/)
interface for Elasticsearch.

I opted to only expose the `body`, which gives you full flexibility, and
none the other 68 arguments of the [search
method](https://elasticsearch-py.readthedocs.io/en/v8.12.1/api/elasticsearch.html#elasticsearch.Elasticsearch.search).

Added a user agent header for usage tracking in Elastic Cloud.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
Implement
[Retriever](https://python.langchain.com/docs/modules/data_connection/retrievers/)
interface for Elasticsearch.

I opted to only expose the `body`, which gives you full flexibility, and
none the other 68 arguments of the [search
method](https://elasticsearch-py.readthedocs.io/en/v8.12.1/api/elasticsearch.html#elasticsearch.Elasticsearch.search).

Added a user agent header for usage tracking in Elastic Cloud.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: elasticsearch Primarily related to elastic/elasticsearch integrations 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PR looks good. Use to confirm that a PR is ready for merging. partner Ɑ: retriever Related to retriever module size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants