pip install -qU langchain-community로 langchain-community를 설치해야 합니다
설치
LangChain에서 VLite를 사용하려면vlite package를 설치해야 합니다:
VLite Import하기
기본 예제
이 기본 예제에서는 텍스트 문서를 로드하고 VLite vector database에 저장합니다. 그런 다음 쿼리를 기반으로 관련 문서를 검색하기 위해 유사도 검색을 수행합니다. VLite는 텍스트의 chunking과 embedding을 자동으로 처리하며, 텍스트를 미리 chunking하거나 해당 chunk를 VLite database에 embedding하여 이러한 매개변수를 변경할 수 있습니다.Text와 Document 추가하기
add_texts와 add_documents method를 사용하여 VLite vector database에 text 또는 document를 추가할 수 있습니다.
유사도 검색
VLite는 저장된 document에 대한 유사도 검색을 수행하는 method를 제공합니다.Max Marginal Relevance 검색
VLite는 Max Marginal Relevance (MMR) 검색도 지원하며, 이는 쿼리와의 유사성과 검색된 document 간의 다양성을 모두 최적화합니다.Document 업데이트 및 삭제
update_document와 delete method를 사용하여 VLite vector database의 document를 업데이트하거나 삭제할 수 있습니다.
Document 검색하기
get method를 사용하여 ID 또는 metadata를 기반으로 VLite vector database에서 document를 검색할 수 있습니다.
VLite Instance 생성하기
다양한 method를 사용하여 VLite instance를 생성할 수 있습니다:추가 기능
VLite는 vector database 관리를 위한 추가 기능을 제공합니다:Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.