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

Skip to content

Conversation

ivybae
Copy link
Contributor

@ivybae ivybae commented Jan 8, 2025

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

- MongoDB Atlas Initialization
- Load sample data
- Work in progress: Vector search
@ivybae ivybae self-assigned this Jan 8, 2025
@ivybae ivybae requested review from IHAGI-c and ro-jun January 8, 2025 14:11
IHAGI-c
IHAGI-c previously approved these changes Jan 9, 2025
Copy link
Contributor

@IHAGI-c IHAGI-c 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:

    • Mac
  • Template Rule 준수 여부:

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인:

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토:

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인:

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인:

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:
    내용이 매우 친절하게 작성되어 좋은거 같습니다! 고생하셨습니다!

@ivybae
Copy link
Contributor Author

ivybae commented Jan 9, 2025

@IHAGI-c 하섬님, 안녕하세요! 꼼꼼히 확인해주셔서 감사드립니다~
이미지 파일명 검토 부분은 check 해제가 되어있어서요, 혹시 가이드와 다른 부분이 있을까요?

ro-jun
ro-jun previously approved these changes Jan 9, 2025
Copy link
Contributor

@ro-jun ro-jun 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

    • Windows / Mac / Linux (해당 OS를 기재해주세요)
  • Template Rule 준수 여부:

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인:

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토:

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인:

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인:

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:

  1. set_env에 노트북 제목이 아닌 "LANGCHAIN_PROJECT": "09-Ollama", 로 되어있습니다!
  2. Deploy a cluster 진행하기 앞서 Atlas 링크 연결해줘도 좋을 것 같습니다! (사용자 접근 편하게)
  3. Atlas Search에 검색기 생성된거 캡쳐해서 보여주어도 좋을 것 같습니다!
  4. 추후 MongoDB Compass를 통해 연결, 데이터 추가 및 변경하는 내용 추가해도 좋을 것 같습니다

@sohyunwriter sohyunwriter self-requested a review January 12, 2025 03:09
- Modify implementation to load the sample data as a PDF file.
- Working in progress: Manage vector store
- Add Documents to vector store
- Delete Documents to vector store
- Query documents from vector store
- Update index definition to add filter condition.
- Add comparison query operators
@ivybae ivybae dismissed stale reviews from ro-jun and IHAGI-c via d8e5683 January 15, 2025 14:58
@ivybae
Copy link
Contributor Author

ivybae commented Jan 15, 2025

@ro-jun 호준님, 안녕하세요!
기타 의견으로 주셨던 1~3번 내용은 모두 반영했구요, 4번은 이번 구현에서는 포함시키기 어려워 제외했습니다!

Copy link
Contributor

@ro-jun ro-jun left a comment

Choose a reason for hiding this comment

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

필수 내용

  1. 인덱스 생성 , 조회, 삭제
  2. upsert, parallel_upsert
  3. 문서 조회/삭제(필터)
  4. db에 맞는 전처리
  5. key 발급방법

차주 확장 내용

  1. 검색기
  2. 하이브리드 서치
  3. tokenizer
  4. sparse encoder
  5. 멀티모달

[Review Checklist]

  • Review OS: Win

    • Windows / Mac / Linux (해당 OS를 기재해주세요)
  • Template Rule 준수 여부: O

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인: O

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토: O

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인: O

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인: O

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:

  1. 제가 장소를 이동하여 MongoDB Atlas와의 연결 시 SSL 핸드셰이크 실패 문제가 발생하였는데, MongoDB Atlas 대시보드에서 Network Access에 자신 IP를 추가하여 해결했습니다! 잦은 문제 발생이 예상되면 넣어도 좋을 것 같습니다!

  2. 저희 VectorStore 필수 내용 중 인덱스(조회, 삭제), upsert, 문서(필터)(조회, 삭제) 부분이 없는거 같습니다.!

@IHAGI-c IHAGI-c self-requested a review January 17, 2025 04:58
Copy link
Contributor

@IHAGI-c IHAGI-c left a 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: 고생하셨습니다! 덕분에 많은 공부가 되었습니다.
    한가지 궁금한게 저희팀 이번주 과업이 upsert, filter_delete 등의 내용이 있었는데 해당 내용들은 다음주에 진행하실 예정이실까요!?

@ivybae
Copy link
Contributor Author

ivybae commented Jan 17, 2025

@ro-jun @IHAGI-c 안녕하세요, 호준님. 하섬님. 리뷰 감사드립니다. 말씀해주신 내용은 아직 MongoDB 에서는 지원을 안하고 있는 줄 알고 생략했던 것인데요! 어제 더 찾아보니 다른 패키지에서 지원되는 것이 있어 오늘, 내일 중으로 업데이트할 예정입니다.

- Add Vector Search Index
- Modify Data Preprocessing
@sohyunwriter
Copy link
Contributor

sohyunwriter commented Jan 19, 2025

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

정말 고생 많으셨습니다!! 잘 작동하네요.
mongodb-atlas 연결이 꽤 어렵네요ㅠㅠ 고생 많으셨어요.

  1. 중간에 documents 전체 출력하는 코드가 있는데 이 부분 아예 삭제해주세요!
  2. 그리고 "Delete All"하고 search 돌릴 수도 있으니 멘트 한 번만 중간에 넣어주실 수 있을까요? 디스코드에 말씀해주신 거요!! (아래 코드 돌리려면 다시 어디서부터 어디까지 셀 실행해야 한다 멘트 한 문장 정도만 넣어주시면 좋을 것 같습니다!!)

1), 2) 해서 커밋 다시 날려주시면 바로 제가 병합할게요!!

@ivybae
Copy link
Contributor Author

ivybae commented Jan 19, 2025

@sohyunwriter 소현님, 감사합니다!
Delete All 이후에 다시 이전으로 돌아가지 않고 bulk insert 하는 섹션을 추가하려고 합니다~
2번 구현은 오늘~내일 중으로 마무리하고 말씀드리겠습니다!

- Add CRUD Operations with PyMongo
- Change image assets
@ivybae
Copy link
Contributor Author

ivybae commented Jan 19, 2025

@sohyunwriter 소현님, 말씀하신 내용 모두 반영했습니다.

  • 1번. 처음부터 끝까지 다시 한번 실행해서 출력결과 업데이트했으니 한번 확인부탁드릴게요.
  • 2번. 데이터가 있는 상태에서 semantic search를 수행하도록 순서를 변경했고, 마지막 섹션 CRUD Operations with PyMongo 내용이 추가되었습니다.
    주말까지 고생많으십니다, 감사합니다!

@ivybae
Copy link
Contributor Author

ivybae commented Jan 19, 2025

@ro-jun @IHAGI-c 안녕하세요, 호준님. 하섬님. 말씀해주셨던 주제들 대부분 업데이트하고 멘션드립니다~!

  • txt 파일 구조 유지하도록 Data Preprocessing 섹션 추가
  • 인덱스(조회, 삭제) -> Atlas Vector Search Indexes 섹션 추가
  • upsert -> CRUD Operations with PyMongo 섹션 추가
  • 문서(필터)(조회, 삭제) -> CRUD Operations with PyMongo 섹션 추가
    • 문서 필터 조회는 Query vector store 섹션에서도 semantic search 실행시 MQL Operator 활용해 필터링합니다.

그 외

  • parallel은 별도로 구현이 필요해 다음주에 보완하려고 합니다~
  • @ro-jun 호준님이 공유해주신 'Network Access'는 빈번하게 발생한다기 보다는 딱 말씀해주신 상황에서 발생하는 건데요. 처음에 회원가입하고 초기설정할 때는 현 위치의 IP Address가 기본으로 추가되서 문제 상황을 경험하지 못하셨을거에요. 이 파일 분량이 너무 길어지고 있어 우선은 해당 설명은 추가하지 않았는데요. 필요하다고 느끼시면 다음주에 추가하겠습니다!

바쁘신 와중에 리뷰해주셔서 감사합니다 :)

sohyunwriter
sohyunwriter previously approved these changes Jan 19, 2025
Copy link
Contributor

@sohyunwriter sohyunwriter left a comment

Choose a reason for hiding this comment

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

수정 후 동작 모두 잘 되는 것 확인했습니다! 정말 고생 많으셨습니다!!

@IHAGI-c IHAGI-c requested review from IHAGI-c and ro-jun January 19, 2025 11:11
Copy link
Contributor

@IHAGI-c IHAGI-c left a 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: 고생하셨습니다! Mac OS 환경에서만 그러는지 모르겠는데 코드를 실행하다보면 몇가지 에러가 나타나네요 ㅠㅠ 한번 확인해주시면 감사하겠습니다!

추가로 한가지 제안사항이 있는데, 함수 등을 실행했을 때, 함수를 실제로 돌려서 이 함수를 실행 했을때 어떤 내용이 리턴 되는지 출력값으로 나올 수 있도록 수정되면 더 완벽할거 같습니다! :)
이 내용은 제안 사항이니 한번 고려만 해주시면 감사하겠습니다!

" relevance_score_fn=\"cosine\",\n",
")"
]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

이 셀을 Mac OS 에서 출력하면 다음과 같은 이슈가 나옵니다:

Motor library is not installed. Asynchronous methods will fall back to using run_in_executor, which is less efficient. Install motor with pip install motor for improved performance.

motor 라는 비동기 작업을 위한 패키지가 필요해 보이는데 확인 한번 해주시고 package.install 에 넣어주시면 감사하겠습니다!

Copy link
Contributor Author

@ivybae ivybae Jan 20, 2025

Choose a reason for hiding this comment

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

@IHAGI-c 저도 Mac OS 환경인데 이러한 오류 메시지는 처음 봐서요, 처음 리뷰하실 때도 이와 같은 메시지가 나타났었나요? 이 코드는 첫번째 버전에서 수정한 내용이 아니라서요!

"vector_store.similarity_search_with_score(\n",
" query=query, k=10, pre_filter={\"index\": {\"$lte\": 123}}\n",
")"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

이 셀에서 다음과 같은 에러가 나옵니다:

OperationFailure: PlanExecutor error during aggregation :: caused by :: Path 'index' needs to be indexed as number, full error: {'ok': 0.0, 'errmsg': "PlanExecutor error during aggregation :: caused by :: Path 'index' needs to be indexed as number", 'code': 8, 'codeName': 'UnknownError', '$clusterTime': {'clusterTime': Timestamp(1737286786, 1), 'signature': {'hash': b'\xf0s\x19\xc2x\x10\xd2\x1d\xb8\xb6\xf9\xc6\x87\xaf\x8d\x8f\xdcBs\x93', 'keyId': 7398206829513146371}}, 'operationTime': Timestamp(1737286786, 1)}

create_vector_search_index 할때, filters=[{"numericPath": "index", "type": "number"}], 이런식으로 타입을 명시적으로 지정해줘야 하는데 타입 지정이 안되어 있어서 나오는 에러 같습니다.

한번 확인 후 수정해주시면 감사하겠습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

요 부분 저도 비슷하게 오류가 발생했는데 Atlas Search에 생성되기 전에 실행시키셨을 수도 있어요!
Atlas Search 생성 확인 후 실행하면 될 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@IHAGI-c 이 부분 확인해봤는데요. @ro-jun 호준님 말씀처럼 아직 search index가 update가 되기 전에 호출하면 발생하는 에러로 보입니다. search index의 ready 상태 여부를 확인할 수 있는 함수는 없는 것 같아 이 부분은 이번주에 개선 작업을 하면서 방법을 고민해봐야할 것 같습니다!

Copy link
Contributor

@ro-jun ro-jun 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 / Mac / Linux (해당 OS를 기재해주세요)
  • Template Rule 준수 여부:

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인:

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토:

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인:

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인:

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:
    의견 반영 후 내용 추가 하시느라 고생하셨습니다.

loader = TextLoader("./data/the_little_prince.txt")
documents = loader.load()

디스코드에서 말씀드린 인코딩만 해결되면 문제 없이 될 것 같습니다!

@ro-jun ro-jun self-requested a review January 19, 2025 11:49
ro-jun
ro-jun previously approved these changes Jan 19, 2025
- Add TextLoader encoding
@ivybae ivybae dismissed stale reviews from ro-jun and sohyunwriter via 32152af January 20, 2025 01:06
@ivybae
Copy link
Contributor Author

ivybae commented Jan 20, 2025

@ro-jun 호준님, TextLoader에 encoding 설정 추가했습니다.
@IHAGI-c 하섬님, 코멘트 내용 확인부탁드립니다~!
그리고 함수 호출 결과를 출력하는 코드는 이번주에 공통 포맷으로 결정되는 사항을 따르겠습니다~

@IHAGI-c IHAGI-c self-requested a review January 20, 2025 05:52
Copy link
Contributor

@IHAGI-c IHAGI-c left a 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: 고생하셨습니다! 리뷰 모두 완료하였습니다!

@teddylee777 teddylee777 merged commit ae84f84 into LangChain-OpenTutorial:main Jan 20, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants