[Unit]
Description=Obsidian Vault Reindex Endpoint
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/will/lab/swarm/scripts/obsidian-reindex-server.py
Restart=on-failure
RestartSec=5
Environment=PORT=18810
Environment=RAG_COLLECTION=obsidian_bge_npu
Environment=RAG_EMBED_MODEL=bge-base-en-v1.5-int8-ov
Environment=OLLAMA_BASE_URL=http://127.0.0.1:18817
# Optional request-time second-stage reranking. Disabled by default so :18810
# keeps working when the :18818 prototype is stopped or not yet approved live.
Environment=RAG_RERANK_ENABLED=false
Environment=RAG_RERANK_URL=http://127.0.0.1:18818/rerank
Environment=RAG_RERANK_INITIAL_K=20
Environment=RAG_RERANK_TOP_K=5
Environment=RAG_RERANK_TIMEOUT_MS=3000
Environment=RAG_RERANK_REQUIRE_NPU_PROOF=true

[Install]
WantedBy=default.target
