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

Add Oracle23ai as a vector datasource #5342

Merged
merged 24 commits into from
Jun 21, 2024
Merged

Add Oracle23ai as a vector datasource #5342

merged 24 commits into from
Jun 21, 2024

Conversation

tmuife
Copy link
Contributor

@tmuife tmuife commented Jun 18, 2024

Description

Add Oracle23ai as a new vector datasource

Oracle23ai Easily bring the power of similarity search to your business data without having to manage and integrate multiple databases. AI Vector Search enables you to search structured and unstructured data based on its semantics or meaning, in addition to its values. Native vector capabilities can help large language models (LLMs) deliver more-accurate and contextually relevant results with retrieval-augmented generation (RAG).

Change/Add List:

api/config.py
api/controllers/console/datasets/datasets.py
api/core/rag/datasource/vdb/vector_factory.py
api/core/rag/datasource/vdb/vector_type.py
api/requirements.txt
api/core/rag/datasource/vdb/oracle/oraclevector.py
docker/startupscripts/create_user.sql
api/tests/integration_tests/vdb/oracle/test_oraclevector.py
docker/docker-compose.yaml

Dependence:

oracledb==2.2.1

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update, included: Dify Document
  • Dependency upgrade

How Has This Been Tested?

  1. run docker build with a test tag, for example 'langgenius/dify-api:test'
  2. change the images in docker-compose.yml to use the test image you just build( api and work services)
  3. comment Weaviate vector store, and uncomment oracle vector store(don't forget the volumes)
  4. change VECTOR_STORE value to oracle

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. dependencies Pull requests that update a dependency file 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database. 📚 documentation Improvements or additions to documentation labels Jun 18, 2024
@crazywoola crazywoola requested a review from takatost June 18, 2024 04:19
@takatost takatost requested review from JohnJyong and removed request for takatost June 19, 2024 04:46
@takatost
Copy link
Collaborator

there are some conflicts that need to be resolved, thx!

@tmuife
Copy link
Contributor Author

tmuife commented Jun 19, 2024

conflicts fixed, thx!

Copy link
Collaborator

@takatost takatost left a comment

Choose a reason for hiding this comment

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

Due to the current version being in the transition period from pip to poetry, we need to add oracledb = "~2.2.1" to api/pyproject.toml [tool.poetry.dependencies]. Thank you very much.

@tmuife
Copy link
Contributor Author

tmuife commented Jun 19, 2024

Yeah, I added the oracledb dependency in pyproject.toml. By the way, I don’t have much experience with pull requests, so if there is anything I can do, please let me know and I will do my best to push this feature. Thanks!

@tmuife
Copy link
Contributor Author

tmuife commented Jun 19, 2024

In "API Tests" when goes to "Set Up Vector Store" step, i can't see docker/docker-compose.oracle.yaml runs, what am i missing?

@takatost
Copy link
Collaborator

In "API Tests" when goes to "Set Up Vector Store" step, i can't see docker/docker-compose.oracle.yaml runs, what am i missing?

Oh, starting an oracle DB in GitHub action might be a disaster, don't you think? 😅

Proper unit testing is beneficial for us.

@tmuife
Copy link
Contributor Author

tmuife commented Jun 20, 2024

In "API Tests" when goes to "Set Up Vector Store" step, i can't see docker/docker-compose.oracle.yaml runs, what am i missing?

Oh, starting an oracle DB in GitHub action might be a disaster, don't you think? 😅

Proper unit testing is beneficial for us.

Because the docker image is relatively large, it may require more resources, yeah 😅

@tmuife tmuife requested a review from takatost June 20, 2024 02:47
takatost
takatost previously approved these changes Jun 20, 2024
Copy link
Collaborator

@takatost takatost left a comment

Choose a reason for hiding this comment

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

Thanks!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 20, 2024
@takatost
Copy link
Collaborator

Need to fix the issues with lint and testing.

@tmuife
Copy link
Contributor Author

tmuife commented Jun 20, 2024

Need to fix the issues with lint and testing.

Pls check, Thanks.

@takatost
Copy link
Collaborator

Need to fix the issues with lint and testing.

Pls check, Thanks.

Ops, still having issues.

@tmuife
Copy link
Contributor Author

tmuife commented Jun 20, 2024

Need to fix the issues with lint and testing.

Pls check, Thanks.

Ops, still having issues.

Sorry, a mistake, overwritten by conflict file.

@tmuife
Copy link
Contributor Author

tmuife commented Jun 20, 2024

Need to fix the issues with lint and testing.

Pls check, Thanks.

Ops, still having issues.

Sorry, a mistake, overwritten by conflict file.

What can i do for this "Python Style Expected — Waiting for status to be reported"

@tmuife tmuife requested a review from takatost June 20, 2024 08:21
@takatost
Copy link
Collaborator

Test failed, maybe you can add some mock logic 😅

@tmuife
Copy link
Contributor Author

tmuife commented Jun 20, 2024

Test failed, maybe you can add some mock logic 😅

Thanks, i went into the details, and i think now i know how to do more test in my local env.

Copy link
Contributor Author

@tmuife tmuife left a comment

Choose a reason for hiding this comment

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

add start oracle docker in api-tests.yaml

@takatost
Copy link
Collaborator

You can use dev/reformat under the root directory to fix lint issues. If it can't be fixed, you'll need to manually resolve it based on the error.

  Error: /workspace/docker/docker-compose.oracle.yaml:19:1: [error] too many blank lines (1 > 0) (empty-lines)
  Error: /workspace/docker/docker-compose.yaml:589:1: [error] too many blank lines (1 > 0) (empty-lines)

@tmuife
Copy link
Contributor Author

tmuife commented Jun 21, 2024

You can use dev/reformat under the root directory to fix lint issues. If it can't be fixed, you'll need to manually resolve it based on the error.

  Error: /workspace/docker/docker-compose.oracle.yaml:19:1: [error] too many blank lines (1 > 0) (empty-lines)
  Error: /workspace/docker/docker-compose.yaml:589:1: [error] too many blank lines (1 > 0) (empty-lines)

Got, do it right now

Copy link
Collaborator

@takatost takatost left a comment

Choose a reason for hiding this comment

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

thanks!

@takatost takatost merged commit 6a09409 into langgenius:main Jun 21, 2024
7 checks passed
@tmuife
Copy link
Contributor Author

tmuife commented Jun 22, 2024

thanks!

This feature, I mean support for Oracle 23 ai as a vector data source, which version will it be released with?

XiaoLey pushed a commit to XiaoLey/dify that referenced this pull request Jun 22, 2024
Co-authored-by: walter from vm <walter.jin@oracle.com>
ZhouhaoJiang added a commit that referenced this pull request Jun 24, 2024
* refs/heads/deploy/dev: (273 commits)
  chore: host required
  fix: monitor copywrite
  feat: make show citations enable default
  chore: use singular style in middleware config class name (#5502)
  refactor: extract hosted service configs into dify config (#5504)
  fix: summary of duckduckgo_search (#5488)
  fix: zhipu tool calling, this PR fixes the bug described in issue #5496 (#5469)
  fix: tongyi json output (#5396)
  fix: firecrawl apikey not start with fc- (#5498)
  fix lock
  refactor: extract db configs and celery configs into dify config (#5491)
  refactor: extract storage provider configs into dify configs (#5443)
  chore: use singular style in config class name (#5489)
  chore: remove pip support for api service (#5453)
  Add Oracle23ai as a vector datasource (#5342)
  build: support Poetry for depencencies tool in api's Dockerfile (#5105)
  feat: add ops trace encrypt_config decrypt_config obfuscate_config
  feat: add remove tracing app
  fix: max_tokens of qwen-plus & qwen-plus-chat (#5480)
  feat: add support for Vertex AI claude-3-5-sonnet@20240620 (#5475)
  ...
@takatost takatost mentioned this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file 📚 documentation Improvements or additions to documentation 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants