Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

XaviereKU
Copy link
Contributor

[N-2] 09-VectorStore / 08-PGVector
utils/pgvector_interface.py 파일 추가
09-PGVector.ipynb 수정

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)

🖥️ 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, 한국어 기술 가능}     

If no one reviews your PR within a few days, please @-mention one of teddylee777, musangk, BAEM1N

@XaviereKU XaviereKU self-assigned this Mar 3, 2025
@XaviereKU XaviereKU requested review from BokyungisaGod and removed request for realjoonha March 3, 2025 09:43
@realjoonha
Copy link
Contributor

안녕하세요 @XaviereKU 님, 고생 많으셨습니다. 계속 업데이트하시길래 타이밍을 놓친 것 같기도 한데 소현님 보경님과 따로 말씀 나누신 것으로 이해하면 될까요? (리뷰어에서 저를 제외하신 것 같아서요!) 두 분께서 진행하신다고 하면 저야 감사한 일이긴 한데요 ㅎㅎ

간략하게 훑어봤을 때 처음부터 종호님께서 맡으셨다면 좋았겠다는 생각이 들만큼 높은 완성도로 작업해주셔서 감사한 마음만 들었습니다.
한가지만 첨언하자면 현재 langchain_postgres를 전혀 쓰지 않고 별도 구현한 util 기반으로 작동하는 방식으로 작업해주셔서 package install에서 해당 패키지 설치가 필요없고, 다만 psycopg2 설치가 필요해보입니다. (미설치시 별도 구현한 인터페이스 실행 시 오류 발생)
langchain_postgres가 잘 관리되고 있는 패키지인지가 불명확해서 버리는 건 큰 이슈가 없을 것 같은데, 해당 패키지는 psycopg3 기반이라서 별도 설명 없이는 혼동을 주거나 충돌이 발생할 수 있을 것 같아요. 참고 부탁드립니다 :)

@XaviereKU
Copy link
Contributor Author

안녕하세요 @XaviereKU 님, 고생 많으셨습니다. 계속 업데이트하시길래 타이밍을 놓친 것 같기도 한데 소현님 보경님과 따로 말씀 나누신 것으로 이해하면 될까요? (리뷰어에서 저를 제외하신 것 같아서요!) 두 분께서 진행하신다고 하면 저야 감사한 일이긴 한데요 ㅎㅎ

간략하게 훑어봤을 때 처음부터 종호님께서 맡으셨다면 좋았겠다는 생각이 들만큼 높은 완성도로 작업해주셔서 감사한 마음만 들었습니다. 한가지만 첨언하자면 현재 langchain_postgres를 전혀 쓰지 않고 별도 구현한 util 기반으로 작동하는 방식으로 작업해주셔서 package install에서 해당 패키지 설치가 필요없고, 다만 psycopg2 설치가 필요해보입니다. (미설치시 별도 구현한 인터페이스 실행 시 오류 발생) langchain_postgres가 잘 관리되고 있는 패키지인지가 불명확해서 버리는 건 큰 이슈가 없을 것 같은데, 해당 패키지는 psycopg3 기반이라서 별도 설명 없이는 혼동을 주거나 충돌이 발생할 수 있을 것 같아요. 참고 부탁드립니다 :)

확인 감사합니다!
package install 부분에 psycopg와 psycopg-binary를 추가하였습니다.
별도로 pgvector_interface.py 파일에서도 psycopg2를 쓰던 부분이 있었는데 현재 상태에선 필요 없어서 정리하였습니다.

@XaviereKU
Copy link
Contributor Author

pgvector_interface.py에 Description은 추가 예정입니다.

Copy link
Contributor

@changwonjeon changwonjeon left a 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

  • Template Rule 준수 여부: 이상없음

  • Table of Contents 링크 확인: 확인필요

    • 마지막 링크 Query vector store -> Similarity Search
  • 이미지 파일명 검토: 해당없음

  • 최신 import 방식 사용 여부: 확인필요

    • 사용되지 않은 패키지가 import 되는 듯 하여, 확인이 필요합니다.
  • 코드 동작 확인: 이상없음

  • 제출 파일 확인: 이상없음

  • 기타 의견:

리뷰어팀 전창원입니다.
코드 작성하시느라 고생 많으셨습니다.
윈도우11 환경에서 이상없이 코드 실행되는 것을 확인하였습니다.

다만, 몇개 오타인듯 하여 제안드렸으니 확인 부탁드리며,
패키지와 ToC 관련 코멘트 확인 부탁드립니다.

끝으로 윈도우에서는 Docker 설치가 약간 제약이 있으니
https://docs.docker.com/desktop/setup/install/windows-install
위 링크 하나 추가해주시면 어떨까 합니다.
이상입니다. 감사합니다!

"\n",
"In this tutorial we will use ```text-embedding-3-large``` model of OpenAI.\n",
"\n",
"If creation is successful, the method will return ```pgVectorDocumentManger``` class that can handle actual data.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"If creation is successful, the method will return ```pgVectorDocumentManger``` class that can handle actual data.\n",
"If creation is successful, the method will return ```pgVectorDocumentManager``` class that can handle actual data.\n",

(오타) 'a'가 하나 빠진듯 합니다!

"- [What is PGVector?](#what-is-pgvector)\n",
"- [Initialization](#initialization)\n",
"- [Manage vector store](#manage-vector-store)\n",
"- [Query vector store](#query-vector-store)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"- [Query vector store](#query-vector-store)\n",
"- [Similarity search](#similarity-search)\n",

Query vector store 는 해당 내용이 없는 듯 하고,
Similarity search으로 작성되어 수정이 필요한 듯 합니다.

"source": [
"## Initialization\n",
"\n",
"If you are successfully run the pgvector container, you can use ```pgVectorIndexManager``` from ```pgvector_interface``` in utils directory to handle collections.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"If you are successfully run the pgvector container, you can use ```pgVectorIndexManager``` from ```pgvector_interface``` in utils directory to handle collections.\n",
"If you are successfully running the pgvector container, you can use ```pgVectorIndexManager``` from ```pgvector_interface``` in utils directory to handle collections.\n",

오타인듯 하여 확인 요청 드려봅니다.

Comment on lines 75 to 79
" \"langchain_postgres\",\n",
" \"langchain_openai\",\n",
" \"pgvector\",\n",
" \"psycopg\",\n",
" \"psycopg-binary\",\n",
Copy link
Contributor

@changwonjeon changwonjeon Mar 4, 2025

Choose a reason for hiding this comment

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

Suggested change
" \"langchain_postgres\",\n",
" \"langchain_openai\",\n",
" \"pgvector\",\n",
" \"psycopg\",\n",
" \"psycopg-binary\",\n",
" \"langchain_openai\",\n",
" \"pgvector\",\n",

패키지 몇개 빼고 실행해도, 이상없이 실행되었습니다.
필요한 패키지인지 확인 부탁드립니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

conda 이용하여 python3.11 환경을 새로 만들고 테스트해보았습니다.
sqlalchemy를 이용하여 postgresql을 활용하는데 engine으로 사용하기 때문에 psycopg, psycopg-binary는 필요한 것으로 보입니다.

@XaviereKU XaviereKU requested a review from changwonjeon March 5, 2025 01:11
@XaviereKU
Copy link
Contributor Author

@changwonjeon 리뷰해주신 사항 수정, 보완하였습니다.
확인 부탁드립니다.
감사합니다!

Copy link
Contributor

@changwonjeon changwonjeon left a 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

  • Template Rule 준수 여부: 이상없음

  • Table of Contents 링크 확인: 이상없음

  • 이미지 파일명 검토: 해당없음

  • 최신 import 방식 사용 여부: 이상없음

  • 코드 동작 확인: 이상없음

  • 제출 파일 확인: 이상없음

  • 기타 의견:
    리뷰어팀 전창원입니다.
    윈도우11 환경에서 코드 이상없이 실행되는 것을 확인하였습니다.
    작성하느라 고생많으셨습니다. 감사합니다!

Copy link
Contributor

@BokyungisaGod BokyungisaGod left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 :)

@teddylee777 teddylee777 merged commit 228b00a into LangChain-OpenTutorial:main Mar 17, 2025
1 of 2 checks passed
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.

5 participants