Open source: github.com/SugarSong404/RAGret.
curl -sS -H "X-API-Key: $RAGRET_API_KEY" "$BASE/api/subscribe-indexes". curl -sS -G "$BASE/api/search/INDEX_NAME" -H "X-API-Key: $RAGRET_API_KEY" --data-urlencode "query=…"
Parse JSON result (or use format=text).
http://127.0.0.1:8765.curl commands above, or the response indicates a missing / invalid RAGRET_API_KEY (or similar 401/403), ask the user to set RAGRET_API_KEY in their local environment (do not ask for the raw secret in chat). Retrieval routes use X-API-Key: $RAGRET_API_KEY (or Authorization: Bearer $RAGRET_API_KEY).# 1) API root (no trailing slash)
export BASE_URL='https://ragret.example.com'
# 2) User declares API key in local environment first
# export RAGRET_API_KEY='sk-...'
# 3) List knowledge bases in key scope (owned + subscribed)
curl -sS -H "X-API-Key: ${RAGRET_API_KEY}" "${BASE_URL}/api/subscribe-indexes"
# 4) Search index "product_docs"
curl -sS -G "${BASE_URL}/api/search/product_docs" \
-H "X-API-Key: ${RAGRET_API_KEY}" \
--data-urlencode "query=How do we handle refunds within 30 days?"
# Response is JSON: read .result (multi-line string of ranked passages).
# Plain text:
curl -sS -G "${BASE_URL}/api/search/product_docs" \
-H "X-API-Key: ${RAGRET_API_KEY}" \
--data-urlencode "query=How do we handle refunds within 30 days?" \
--data-urlencode "format=text"
source: when useful.共 1 个版本