Loading...
Loading...
Interact with the Denser Retriever API to build and query knowledge bases. Use this skill whenever the user wants to create a knowledge base, upload documents (files or URLs), search/query a knowledge base, list or delete knowledge bases or documents, check document processing status, or check account usage/balance. Also trigger when the user mentions 'denser retriever', 'knowledge base', 'document search', 'semantic search', 'RAG pipeline', or wants to index and search their files.
npx skill4agent add denser-org/claude-skills denser-retrievercurlDENSER_API_KEYhttps://retriever.denser.ai/api/open/v1echo $DENSER_API_KEY| Operation | Method | Endpoint |
|---|---|---|
| Get usage | GET | |
| Get balance | GET | |
| Create KB | POST | |
| List KBs | GET | |
| Update KB | POST | |
| Delete KB | POST | |
| Upload file (presign) | POST | |
| Import file | POST | |
| Import text | POST | |
| List documents | GET | |
| Delete document | POST | |
| Check doc status | GET | |
| Search/query | POST | |
references/api_reference.mdcurl -s -X POST "https://retriever.denser.ai/api/open/v1/createKnowledgeBase" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "My KB", "description": "Optional description"}' | python3 -m json.toolidcurl -s -X POST "https://retriever.denser.ai/api/open/v1/presignUploadUrl" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"knowledgeBaseId": "KB_ID", "fileName": "document.pdf", "size": FILE_SIZE_BYTES}' | python3 -m json.toolcurl -s -X PUT "PRESIGNED_UPLOAD_URL" --data-binary @/path/to/document.pdfcurl -s -X POST "https://retriever.denser.ai/api/open/v1/importFile" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fileId": "FILE_ID"}' | python3 -m json.toolcurl -s -X GET "https://retriever.denser.ai/api/open/v1/getDocumentStatus?documentId=DOC_ID" \
-H "x-api-key: $DENSER_API_KEY" | python3 -m json.toolstatus"processed""failed""timeout"curl -s -X POST "https://retriever.denser.ai/api/open/v1/query" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "your search query", "knowledgeBaseIds": ["KB_ID"], "limit": 10}' | python3 -m json.toolcurl -s -X POST "https://retriever.denser.ai/api/open/v1/importTextContent" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"knowledgeBaseId": "KB_ID", "title": "My Document", "content": "Full text content here..."}' | python3 -m json.toolknowledgeBaseIdscurl -s -X POST "https://retriever.denser.ai/api/open/v1/query" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "your search query", "limit": 10}' | python3 -m json.toolKB_ID="your-kb-id"
for file in /path/to/files/*; do
FILE_NAME=$(basename "$file")
FILE_SIZE=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null)
# Get presigned URL
PRESIGN=$(curl -s -X POST "https://retriever.denser.ai/api/open/v1/presignUploadUrl" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"knowledgeBaseId\": \"$KB_ID\", \"fileName\": \"$FILE_NAME\", \"size\": $FILE_SIZE}")
UPLOAD_URL=$(echo "$PRESIGN" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['uploadUrl'])")
FILE_ID=$(echo "$PRESIGN" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['fileId'])")
# Upload file
curl -s -X PUT "$UPLOAD_URL" --data-binary @"$file"
# Trigger import
curl -s -X POST "https://retriever.denser.ai/api/open/v1/importFile" \
-H "x-api-key: $DENSER_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"fileId\": \"$FILE_ID\"}"
echo "Uploaded: $FILE_NAME (fileId: $FILE_ID)"
doneDOC_ID="your-document-id"
while true; do
STATUS=$(curl -s -X GET "https://retriever.denser.ai/api/open/v1/getDocumentStatus?documentId=$DOC_ID" \
-H "x-api-key: $DENSER_API_KEY" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['status'])")
echo "Status: $STATUS"
if [ "$STATUS" = "processed" ] || [ "$STATUS" = "failed" ] || [ "$STATUS" = "timeout" ]; then
break
fi
sleep 3
done{"success": true, "data": { ... }}{"success": false, "message": "Error details", "errorCode": "ERROR_CODE"}STORAGE_LIMIT_EXCEEDEDKNOWLEDGE_BASE_LIMIT_EXCEEDEDINSUFFICIENT_CREDITSINPUT_VALIDATION_FAILEDgetBalancegetDocumentStatuspresignUploadUrlimportFilescorecontenttitledocument_idmetadata