Skip to content

Commit 2955fe6

Browse files
committed
chore: add index-kb make target and configurable QDRANT_HOST
1 parent 4d0d8e1 commit 2955fe6

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: worker api scheduler all
1+
.PHONY: worker api scheduler all index-kb
22

33
worker:
44
poetry run taskiq worker backend.workers.broker:broker backend.workers.tasks
@@ -9,5 +9,8 @@ scheduler:
99
api:
1010
poetry run uvicorn backend.api.main:app --host 127.0.0.1 --port 8001 --reload
1111

12+
index-kb:
13+
PYTHONPATH=. poetry run python scripts/index_knowledge_base.py
14+
1215
all:
1316
make -j 3 api worker scheduler

scripts/index_knowledge_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ async def index_collection(collection_name: str, data_dir: str):
4848
)
4949

5050
# 3. Connect to Qdrant (local tunnel / host)
51+
qdrant_host = os.environ.get("QDRANT_HOST", "127.0.0.1")
5152
qdrant_port = int(os.environ.get("EXTERNAL_QDRANT_PORT", 6333))
52-
client = AsyncQdrantClient(host="127.0.0.1", port=qdrant_port)
53-
sync_client = QdrantClient(host="127.0.0.1", port=qdrant_port)
53+
client = AsyncQdrantClient(host=qdrant_host, port=qdrant_port)
54+
sync_client = QdrantClient(host=qdrant_host, port=qdrant_port)
5455

5556
vector_store = QdrantVectorStore(
5657
collection_name=collection_name,

0 commit comments

Comments
 (0)