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

feat: add pg vector index #12338

Merged
merged 2 commits into from
Jan 22, 2025
Merged

feat: add pg vector index #12338

merged 2 commits into from
Jan 22, 2025

Conversation

huangzhuo1949
Copy link
Contributor

@huangzhuo1949 huangzhuo1949 commented Jan 3, 2025

Summary

Close #12341

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database. labels Jan 3, 2025
@crazywoola
Copy link
Member

crazywoola commented Jan 3, 2025

Please link an existing issue or create one in the description. :)
This helps others to understand why you need this.

@huangzhuo1949
Copy link
Contributor Author

huangzhuo1949 commented Jan 3, 2025

Please link an existing issue or create one in the description. :) This helps others to understand why you need this.

done~

@bowenliang123
Copy link
Contributor

And how about explictly set the options (m and ef_construction) as well, making the index DDL more readable and helpful?
https://github.com/pgvector/pgvector?tab=readme-ov-file#index-options

CREATE INDEX ON table USING hnsw (embedding vector_l2_ops) WITH (m = 16, ef_construction = 64);

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 6, 2025
@huangzhuo1949
Copy link
Contributor Author

And how about explictly set the options (m and ef_construction) as well, making the index DDL more readable and helpful? https://github.com/pgvector/pgvector?tab=readme-ov-file#index-options

CREATE INDEX ON table USING hnsw (embedding vector_l2_ops) WITH (m = 16, ef_construction = 64);

thanks for this suggestion,I have added it~

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 22, 2025
@JohnJyong JohnJyong merged commit 4c3076f into langgenius:main Jan 22, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database. lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(vdb): add HNSW vector index for PG vector store
4 participants