-
Notifications
You must be signed in to change notification settings - Fork 282
[N-2] 09-VectorStore / 05-Qdrant.ipynb #232
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
Conversation
[Title] 05-Qdrant [Version] initial [Language] ENG [Package] langsmith, langchain_openai, langchain_qdrant, fastembed, qdrant_client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฅ๏ธ OS: Mac
โ
Checklist
- Template: Tutorials follows the required template.
- Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
- Image: Image filenames follow guidelines.
- *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
- Code Execution: Code runs without errors.
- Comments: ์์ฑํ์๋๋ผ, ๊ณ ์ํ์
จ์ต๋๋ค! Template ์ ์ฉ ๊ด๋ จ ๋ฆฌ๋ทฐ๋ด์ฉ ๊ณต์ ๋๋ ค์! ๐๐ปโโ๏ธ
- ํ
ํ๋ฆฟ rule
## Environment Setup
ํ ํ๋ฆฟ์ด ์์ด์ง ๊ฒ ๊ฐ์ต๋๋ค! ๋ฐ์ ๋ถํ๋๋ฆฝ๋๋ค~!
images
ํด๋๋ช ์ผ๋ก pngํ์ผ์ด ์ ์ฅ๋๊ณ ์๋๋ฐ์.
-
data
ํด๋๋ก ์ฌ์ฉํ๊ธฐ๋ก ๊ท์น์ด ์ ํด์ง ๊ฒ์ผ๋ก ์๊ณ ์์ด์.images
ํ์๋ก ํ์ผ์ด ๋ค์ ๊ทธ๋ฆผ ์ฒ๋ผ๊ด๋ฆฌ๋๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. (๋ค์ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ด)
- backtick, bold๋ ์ข ์ฐ์ space๋ฅผ ๊ผญ ๋์์ฃผ์ธ์! -> ๊ด๋ จ ๋ด์ฉ์ ์์ ํ ์ปค๋ฐํ์ต๋๋ค!
- ํ๊ฒฝ์ค์ / ํจํค์ง ์ค์น ๊ฐ์ด๋์ pip command๋ ๊ผญ !pip๊ฐ ์๋
%pip
๋ก ์์ ๋ถํ๋๋ฆฝ๋๋ค!
- ํ
ํ๋ฆฟ rule
[Title] 05-Qdrant [Version] fix [Language] ENG [Package] langsmith, langchain_openai, langchain_qdrant, fastembed, qdrant_client
@namyoungkim ์๋
ํ์ธ์! |
[Title] 05-Qdrant [Version] initial [Language] ENG [Package] langsmith, langchain_openai, langchain_qdrant, qdrant_client, langchain_core, fastembed Langchain and Qdrant VectorStore Tutorial - A tutorial on using Langchain's `langchain_qdrant` class to work with `Qdrant vector store`.
๐ฅ๏ธ OS: Mac
์ ๋ด์ฉ ํ์ธ ๋ถํ๋๋ฆด๊ฒ์~! ์์ฑํ์๋ผ ์๊ณ ํ์ จ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค! ๐๐ปโโ๏ธ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Review Checklist]
-
Review OS:
- Windows / Mac / Linux (Windows)
-
Template Rule ์ค์ ์ฌ๋ถ:
- Template Rule ๊ฐ์ด๋๋ฅผ ์ค์ํ์๋๊ฐ? (Check ํ๊ธฐ)
-
Table of Contents ๋งํฌ ํ์ธ:
- Table of Contents์ ๋งํฌ๊ฐ ์ํํ๊ฒ ๋์ํ๋์ง ํ์ธํ์๋๊ฐ? (Check ํ๊ธฐ)
-
์ด๋ฏธ์ง ํ์ผ๋ช ๊ฒํ :
- ์ด๋ฏธ์ง๊ฐ ํฌํจ๋์ด ์๋ค๋ฉด, ์ด๋ฏธ์ง์ ํ์ผ๋ช ์ด ๊ฐ์ด๋๋ฅผ ์ค์ํ์๋๊ฐ? (Check ํ๊ธฐ)
-
์ต์ import ๋ฐฉ์ ์ฌ์ฉ ์ฌ๋ถ:
- import ๊ตฌ๋ฌธ์ด ์์ legacy ๋ฐฉ์์ด ์๋ ์ต์ ๋ฒ์ ์ ๋ฐ๋ฅด๋๊ฐ? (Check ํ๊ธฐ)
-
์ฝ๋ ๋์ ํ์ธ:
- ๋ชจ๋ ์ฝ๋๊ฐ ์ค๋ฅ ์์ด ๋์ํ๋๊ฐ? (Check ํ๊ธฐ)
- Warning ๋ฐ์ ์ ์ฝ๋ฉํธ์ ์ ์ด์ฃผ์ธ์.
-
์ ์ถ ํ์ผ ํ์ธ:
- ๊ผญ ํ์ํ ํ์ผ๋ค๋ง ์ ์ถ๋์๋๊ฐ?
- ํํ ๋ฆฌ์ผ ์ธ ์ค์ ํ์ผ์ด๋ ๋ค๋ฅธ ๋ถ์ด ์์ ํ ํ์ผ์ด ํฌํจ๋์๋์ง Files Changed์์ ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค. (Check ํ๊ธฐ)
- ๊ผญ ํ์ํ ํ์ผ๋ค๋ง ์ ์ถ๋์๋๊ฐ?
-
๊ธฐํ ์๊ฒฌ:
"ํน์ด์ฌํญ ์์ต๋๋ค."
"์ฝ๋์ ์ ๋ฐ์ ์ธ ๊ตฌ์กฐ๊ฐ ๊น๋ํ์ง๋ง, ํจ์ ์ด๋ฆ์ด ์กฐ๊ธ ๋ ๋ช
ํํ๊ฒ ์์ฑ๋๋ฉด ๊ฐ๋
์ฑ์ด ๋์ฑ ํฅ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์: process()
๋์ process_and_validate()
์ฌ์ฉ."
"์ฃผ์์ด ๋น๊ต์ ์ ์ ํธ์ด๋ผ ์ฝ๋์ ์๋๋ฅผ ํ์ ํ๊ธฐ ์ด๋ ค์ด ๋ถ๋ถ์ด ์์์ต๋๋ค. ์ฃผ์ ํจ์์ ๋ณต์กํ ๋ก์ง์ ์ถ๊ฐ์ ์ธ ์ค๋ช ์ ์์ฑํด ์ฃผ์๋ฉด ์ข๊ฒ ์ต๋๋ค."
"ํ์ฌ ๋ฐ๋ณต๋ฌธ ๋ด์์ ๋์ผํ ๋ฐ์ดํฐ๋ฅผ ์ฌ๋ฌ ๋ฒ ํธ์ถํ๊ณ ์์ต๋๋ค. ํด๋น ๋ฐ์ดํฐ๋ฅผ ๋ฐ๋ณต๋ฌธ ์ธ๋ถ๋ก ๋นผ๋ด ์บ์ฑํ๋ฉด ์ฑ๋ฅ ์ต์ ํ์ ๋์์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค."
์๋
ํ์ธ์ ๋ฌธํ์ข
๋,
Qdrant ํํ ๋ฆฌ์ผ์ ๊ฒํ ํ ๊ฒฐ๊ณผ, ๋ค์๊ณผ ๊ฐ์ ์ฃผ์ ์์ ์ฌํญ์ด ํ์ํด๋ณด์
๋๋ค.
- ํ์ฌ [Note] ํ์๊ฐ ์ผ๋ฐ ํ ์คํธ๋ก ๋์ด ์์ผ๋, ๊ฐ์ด๋๋ผ์ธ์ ๋ฐ๋ผ **[Note]**๋ก ๋ณผ๋ ์ฒ๋ฆฌ๊ฐ ํ์ํฉ๋๋ค.
2.ํ์ฌ ์ด๋ฏธ์ง ํ์ผ๋ค์ด 'data' ํด๋์ ์์นํด ์์ผ๋, ๊ฐ์ด๋๋ผ์ธ์ ๋ฐ๋ผ 'assets' ํด๋๋ก ์ด๋ํ๊ณ ๋งํฌ๋ค์ด ๋ฌธ๋ฒ์ผ๋ก ์ฐธ์กฐํด์ผ ํฉ๋๋ค.
3.'Dense Vector Search', 'Sparse Vector Search', 'Hybrid Search' ์น์ ์ ๋ชฉ์ฐจ์ ์๋๋ฐ, 'Multimodal Search'๊ณผ ๋ค๋ฅธ ๋ ๋ฒจ์ผ๊น์?
ํํ ๋ฆฌ์ผ ์์ฑํ์๋๋ผ ๊ณ ์ ๋ง์ผ์ จ์ต๋๋ค!
[Title] 05-Qdrant [Version] fix [Language] ENG [Package] langsmith, langchain_openai, langchain_qdrant, qdrant_client, langchain_core, fastembed Langchain and Qdrant VectorStore Tutorial - A tutorial on using Langchain's `langchain_qdrant` class to work with `Qdrant vector store`.
์๋ ํ์ธ์! ๋ฆฌ๋ทฐ์์ฑํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
์๋
ํ์ธ์! ๋ฆฌ๋ทฐํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฅ๏ธ OS: Mac
โ
Checklist
- Template: Tutorials follows the required template.
- Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
- Image: Image filenames follow guidelines.
- *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
- Code Execution: Code runs without errors.
- Comments:
์์ ํด์ฃผ์ ๋ด์ฉ ํ์ธํ์ต๋๋ค!
์ฝ๋๋ฅผ ์คํํด๋ณด๋ฉด, DB์ ๋ฐ์ดํฐ ์ ์ฌํ ๋, ๋ค์ ์๋ฌ๊ฐ ๋จ๋ค์ ๐ฅฒ

ํ์ ์์์๋ฌ๊ฐ ๋ฐ์ํด์ ํ์ธํด๋ณด๋, ๋ฌด๋ฃ๋ก ์ฃผ๋ Qdrant ํด๋ฌ์คํฐ ์ฑ๋ฅ์ด ์ข์ง ์์ ๊ฒ ๊ฐ๋ค์.
ํ
์คํธ๋ฅผ ํด๋ณด๋ batch_size=10
๋ก ์ถ๊ฐ ์ต์
๊ฐ์ ์ง์ ํด์ ์คํํ๋ฉด ์๊ฐ์ด 1๋ถ ์ ๋ ๊ฑธ๋ฆฌ์ง๋ง ์ ์ ์ ์ฌ๋๋ ๊ฒ์ ํ์ธํ์ต๋๋ค.
vector_store.add_documents(documents=split_docs, ids=uuids, batch_size=10)
์์ ํ ๋ถ๋ถ์ ๋ค์ ๊ทธ๋ฆผ 4๊ฐ๋ก ์บก์ณํด์ ์ ๋ฌ๋๋ฆฝ๋๋ค~!
์ ๋ง ๋ฐ์ํ๋ ์๋ฌ์ธ์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง, ํ์ธํ ๊ฒํ ํ์ ํ ๋ฐ์ ๋ถํ๋๋ฆฝ๋๋ค!
๊ณ ์ํ์
จ์ต๋๋ค. ๐๐ปโโ๏ธ
[Title] 05-Qdrant [Version] fix [Language] ENG [Package] langsmith, langchain_openai, langchain_qdrant, qdrant_client, langchain_core, fastembed Langchain and Qdrant VectorStore Tutorial - A tutorial on using Langchain's `langchain_qdrant` class to work with `Qdrant vector store`.
[Title] 05-Qdrant [Version] fix [Language] ENG [Package] langsmith, langchain_openai, langchain_qdrant, qdrant_client, langchain_core, fastembed Langchain and Qdrant VectorStore Tutorial - A tutorial on using Langchain's `langchain_qdrant` class to work with `Qdrant vector store`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฅ๏ธ OS: Mac
โ
Checklist
- Template: Tutorials follows the required template.
- Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
- Image: Image filenames follow guidelines.
- *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
- Code Execution: Code runs without errors.
- Comments:
์์ ํด์ฃผ์ ๋ด์ฉ ํ์ธํ๊ณ ์ฝ๋ ์ ์์ ์ผ๋ก ์คํ๋๋ ๊ฒ ํ์ธํ์ต๋๋ค.
์ ๋ ์์ธ์ ์กฐ๊ธ ๋ ๋ดค๋๋ฐ์.
๋คํธ์ํฌ ์๋๋ ํ๊ฒฝ์ ์ํฅ์ ๋ฐ๋ ๊ฒ ๊ฐ๋ค์. (์ ํฌ ์ง ์์ดํ์ด ํ๊ฒฝ ๋๋ฌธ์ธ๊ฒ ๊ฐ์ต๋๋ค.)
ํด๋ผ์ฐ๋ DB๋ฅผ ํ์ฉํ๋ ๊ฒฝ์ฐ, ๋ฐ์ดํฐ๋ฅผ ์
๋ก๋ํ ๋, ๋คํธ์ํฌ ํ๊ฒฝ์ ๋ฐ๋ผ์ ์ปค๋ฅํธํ์์ด๋ ๋ฐฐ์น์ฌ์ด์ฆ ์กฐ์ ํ ์ ์๋๋ก ๊ด๋ จ ๋ด์ฉ๋ ๊ฐ์ด๋๋ก ํฌํจ์ํค๊ฑฐ๋ ์ฝ๋์ ๋ฐ์ํด์ผ ํ ๊ฒ ๊ฐ๋ค๋ ์๊ฐ์ด ๋ค์์ด์.
์ ๊ฐ ์์ฑํ ์๋ผ์คํฑ์์น์์๋ ๋์ผํ ์ด์๊ฐ ์์ด์ ๋ฐฉ๊ธ ๋ฐ์ํ๊ฑฐ๋ ์!
๊ณ ์ํ์ จ์ต๋๋ค~!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฅ๏ธ OS: Win/Mac/Linux
โ
Checklist
- Template: Tutorials follows the required template.
- Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
- Image: Image filenames follow guidelines.
- *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
- Code Execution: Code runs without errors.
- Comments: {Write freely, ํ๊ตญ์ด ๊ธฐ์ ๊ฐ๋ฅ}
์ ๋ง ๊ณ ์ ๋ง์ผ์
จ์ด์. ๊ธฐ๋ฅ ๊ฐ๋ฐ ์์ ์งฑ์ด๋ค์!!
initialization ํ๋ ๋ถ๋ถ์ ๋์ค์ ์๊ฐ ๋์๋ฉด ์ด๋ค ์ฐ๊ฒฐ ๋ฐฉ๋ฒ์ผ๋ก ์ฌ์ฉํ๋ค ๋ฑ ์ฐ๊ฒฐ ๋ฐฉ๋ฒ ๊ด๋ จํด์ ์ข๋ง ๋ ์ค๋ช
์ถ๊ฐํด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์. ํฌ๊ฒ ์ค์ํ ๋ถ๋ถ์ ์๋๋ ๋ณํฉํ๊ฒ ์ต๋๋ค.
763d6f8
into
LangChain-OpenTutorial:main
[Title] 05-Qdrant
[Version] initial
[Language] ENG
[Package] langsmith, langchain_openai, langchain_qdrant, fastembed, qdrant_client
{PR Message - Write freely, remove this bracket if unnecessary}
Author Checklist
PR Title Format: I have confirmed that the PR title follows the correct format. (e.g., [N-2] 07-Text Splitter / 07-RecursiveCharacterTextSplitter)
Committed Files: I have ensured that no unnecessary files (e.g., .bin, .gitignore, poetry.lock, pyproject.toml) are included. These files are not allowed.
(Optional) Related Issue: If this PR is linked to an issue, I have referenced the issue number in the PR message. (e.g., Fixes Update 01-PromptTemplate.ipynbย #123)
โ Do not include unnecessary files (e.g., .bin, .gitignore, poetry.lock, pyproject.toml) or other people's code. If included, close the PR and create a new PR.
Review Template (Intial PR)
If no one reviews your PR within a few days, please @-mention one of teddylee777, musangk, BAEM1N