Keystone
Import documents and retrieve knowledge through the Keystone REST API. Use for uploading files, URLs, or Markdown to a knowledge base; hybrid search within a...
justaboyhai-wq
@justaboyhai-wq
What This Skill Does
REST API client for importing documents (files, URLs, Markdown) into a Keystone knowledge base and performing hybrid search across one or multiple knowledge bases. Requires KEYSTONE_BASE_URL and KEYSTONE_API_KEY environment variables.
Replaces manually building custom RAG pipelines or document ingestion scripts by providing a ready-made API wrapper for uploading, searching, and managing knowledge entries.
When to Use It
- Upload a PDF or document to a knowledge base for indexing
- Import a web page URL into a knowledge base with multimodal support
- Search a single knowledge base using hybrid (semantic + keyword) search
- Cross-search multiple knowledge bases with a single query
- Browse or list all knowledge entries in a knowledge base
- Check the parsing status of a recently uploaded document
Install
$ openclaw skills install @justaboyhai-wq/keystoneKeystone knowledge base
Use the Keystone REST API to import content and retrieve grounded context from the user's knowledge bases. Never expose the API key in messages, commands logged to shared output, or saved files.
Setup
- In Keystone, open Settings → API Integration and create or copy an API key.
- Configure the agent environment with the public Keystone API address. The
address must end with
/api/v1and be reachable from the agent runtime.
export KEYSTONE_BASE_URL="https://keystone.example.com/api/v1"
export KEYSTONE_API_KEY="sk-your-api-key"
For a local deployment used by an agent on the same computer, the usual base
URL is http://localhost:8080/api/v1.
Credential check
Before making an API request, ensure both values exist. If either is missing, ask the user to configure it; do not guess or substitute a token.
if [ -z "$KEYSTONE_BASE_URL" ] || [ -z "$KEYSTONE_API_KEY" ]; then
echo "Missing Keystone credentials. Set KEYSTONE_BASE_URL and KEYSTONE_API_KEY."
exit 1
fi
Request helper
All JSON API requests use X-API-Key. Keep the endpoint relative to the base
URL so deployments behind a reverse proxy continue to work.
keystone_api() {
local method="$1" endpoint="$2" body="$3"
curl --fail-with-body -sS -X "$method" "$KEYSTONE_BASE_URL/$endpoint" \
-H "X-API-Key: $KEYSTONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Request-ID: $(uuidgen 2>/dev/null || date +%s)" \
${body:+-d "$body"}
}
For uploads, use curl -F directly. Do not set Content-Type manually for a
multipart request.
Choose the right API
| User intent | Endpoint | Notes |
|---|---|---|
| List knowledge bases | GET /knowledge-bases | Select a KB by id or name before importing/searching. |
| View KB details | GET /knowledge-bases/:id | Inspect indexing and configuration. |
| Upload a file | POST /knowledge-bases/:id/knowledge/file | Multipart field: file; optional enable_multimodel. |
| Import a web page | POST /knowledge-bases/:id/knowledge/url | JSON: url, optional enable_multimodel. |
| Create Markdown knowledge | POST /knowledge-bases/:id/knowledge/manual | JSON: title, content, optional tag_id. |
| Check processing | GET /knowledge/:id | Poll parse_status after an import. |
| Browse KB entries | GET /knowledge-bases/:id/knowledge | Use page, page_size, optional tag_id. |
| Edit Markdown knowledge | PUT /knowledge/manual/:id | JSON: title, content. |
| Delete a knowledge entry | DELETE /knowledge/:id | Confirm destructive actions with the user first. |
| Search one KB | GET /knowledge-bases/:id/hybrid-search | JSON body: query_text, match_count, thresholds. |
| Search several KBs | POST /knowledge-search | JSON: query, knowledge_base_ids. |
Common workflows
Upload a file and wait for parsing
# First find the target knowledge base and its id.
keystone_api GET "knowledge-bases"
# Upload. The response contains data.id (knowledge id).
curl --fail-with-body -sS -X POST "$KEYSTONE_BASE_URL/knowledge-bases/<kb_id>/knowledge/file" \
-H "X-API-Key: $KEYSTONE_API_KEY" \
-F 'file=@document.pdf' \
-F 'enable_multimodel=true'
# Poll until data.parse_status is completed or failed.
keystone_api GET "knowledge/<knowledge_id>"
Import a URL or Markdown
keystone_api POST "knowledge-bases/<kb_id>/knowledge/url" \
'{"url":"https://example.com/article","enable_multimodel":true}'
keystone_api POST "knowledge-bases/<kb_id>/knowledge/manual" \
'{"title":"Meeting notes","content":"# Q1 review\n\nKey points..."}'
Retrieve knowledge
# Hybrid retrieval within one knowledge base. This GET endpoint expects a JSON body.
keystone_api GET "knowledge-bases/<kb_id>/hybrid-search" \
'{"query_text":"deployment process","match_count":5}'
# Search across selected knowledge bases.
keystone_api POST "knowledge-search" \
'{"query":"deployment process","knowledge_base_ids":["kb-1","kb-2"]}'
Response handling
- Successful responses put data in
data(lists are usuallydata[]). - Knowledge processing progresses from
pendingtoprocessing, thencompletedorfailed. Checkerror_messagebefore retrying a failure. - Hybrid-search results include
content,score,knowledge_id,knowledge_title, and chunk metadata. Use them as source context and say when no relevant result was returned. - Paginated knowledge lists return
total,page, andpage_size.
Safety and error handling
- Do not upload, import, overwrite, or delete anything without the user's explicit target knowledge base and confirmation for destructive actions.
- Treat
401as invalid/missing API credentials,403as insufficient access,404as a wrong resource id,413as an oversized upload, and429as a rate limit requiring a pause before retry. - For a failed parse, inspect
error_message; retry withPOST /knowledge/:id/reparseonly when the user asks to retry.
Top skills in this category
Self-Improving + Proactive Agent
@ivangdavilaSelf-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when...
ontology
@oswalpalashTyped knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linkin...
Humanizer
@biostartechnologyRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Obsidian
@steipeteWork with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
YouTube Watcher
@michaelgatharaFetch and read transcripts from YouTube videos. Use when you need to summarize a video, answer questions about its content, or extract information from it.