Stores 퀵스타트 — 파일을 검색 가능한 지식 베이스로
Stores 퀵스타트 — 파일을 검색 가능한 지식 베이스로
Mixedbread의 Stores는 파싱과 인덱싱, 검색, 리랭킹을 하나의 워크플로로 묶는 최신 검색 방식이에요. 파일을 올려 지식 베이스를 만들고 자연어 쿼리로 탐색하는 흐름을 시작해 볼게요.
먼저 준비물이에요.
- API Key — API Keys 페이지에서 발급
- SDK 설치 — 선호하는 언어로 설치
Python
pip install mixedbread
TypeScript / npm
npm install @mixedbread/sdk
클라이언트를 만들고 Store를 생성해요.
from mixedbread import Mixedbread
from pathlib import Path
mxbai = Mixedbread(api_key="YOUR_API_KEY")
store = mxbai.stores.create(name="my-knowledge-base")
파일을 업로드하고 자연어로 검색해요.
file_result = await mxbai.stores.files.upload_and_poll(
store_identifier=store.id, file=Path("document.pdf")
)
results = await mxbai.stores.search(
query="What are the key features?",
store_identifiers=[store.id],
top_k=3,
)
커스텀 메타데이터를 붙이면 조직화와 필터링이 쉬워져요.
file_result = mxbai.stores.files.upload_and_poll(
store_identifier=store.id,
file=Path("./document.pdf"),
metadata={
"category": "documentation",
"department": "engineering",
"tags": ["api", "tutorial"],
},
)
CLI도 제공돼요. 일회성 인증 후 Store를 만들고 업로드·검색할 수 있어요.
# API 키 저장 (일회성 설정)
mxbai config keys add YOUR_API_KEY default
# Store 생성
mxbai store create "my-knowledge-base"
# 파일 업로드·처리 (PDF, 이미지, 문서, 코드)
mxbai store upload "my-knowledge-base" ./documents/
더 알아보기
- https://www.mixedbread.com/docs/quickstart — Stores 퀵스타트
- https://www.mixedbread.com/docs/stores/search — Store 검색