Knowledge base API

The agent retrieves relevant articles automatically when answering conversations. You can also drive ingestion + lookup directly.

Endpoints

MethodPathScope
GET/v1/projects/{projectId}/kb/articlesread
POST/v1/projects/{projectId}/kb/articleskb:write
GET/v1/projects/{projectId}/kb/articles/{articleId}read
PATCH/v1/projects/{projectId}/kb/articles/{articleId}kb:write
DELETE/v1/projects/{projectId}/kb/articles/{articleId}kb:write
POST/v1/projects/{projectId}/kb/articles/{articleId}/publishkb:write
GET/v1/projects/{projectId}/kb/search?q=...read

List articles

bash
curl 'https://api.rogeriq.com/api/v1/projects/prj_xxx/kb/articles?status=published&limit=20' \ -H "X-API-Key: riq_xxx"

Filters: status (draft/published/archived), category, q, cursor, limit, sort, order. Returns { data, cursor, has_more }.

Create an article

bash
curl -X POST https://api.rogeriq.com/api/v1/projects/prj_xxx/kb/articles \ -H "X-API-Key: riq_xxx" \ -H "Content-Type: application/json" \ -d '{ "title": "How refunds work", "content": "Customers can request a refund within 30 days...", "status": "published", "is_public": true, "category": "billing" }'
titlestringrequiredbody
contentstringrequiredbody

Markdown body.

statusstringbodydefault: draft

draft | published | archived.

is_publicbooleanbodydefault: true

Whether the article is reachable on the public hosted docs site.

categorystringbody

Free-form category for grouping.

Published articles are indexed in the vector store for AI agent retrieval.

bash
curl 'https://api.rogeriq.com/api/v1/projects/prj_xxx/kb/search?q=refund%20policy' \ -H "X-API-Key: riq_xxx"

Hybrid search: vector similarity + BM25 keyword. Returns the top 10 articles ranked by combined score.

json
{ "data": [ { "id": "kba_xxx", "title": "How refunds work", "score": 0.87, "...": "..." } ]}

Publish a draft

bash
curl -X POST https://api.rogeriq.com/api/v1/projects/prj_xxx/kb/articles/kba_xxx/publish \ -H "X-API-Key: riq_xxx"

Sets status to published, populates published_at (if unset), and re-indexes the article in the vector store.

Update

bash
curl -X PATCH https://api.rogeriq.com/api/v1/projects/prj_xxx/kb/articles/kba_xxx \ -H "X-API-Key: riq_xxx" \ -H "Content-Type: application/json" \ -d '{"content": "Updated body...", "status": "published"}'

Editing a published article's title or content triggers re-vectorization automatically.

Delete

bash
curl -X DELETE https://api.rogeriq.com/api/v1/projects/prj_xxx/kb/articles/kba_xxx \ -H "X-API-Key: riq_xxx"

Removes the article and its vector entries.

Crawl ingestion

For bulk import from an existing docs site, use the internal crawl endpoint:

bash
rogeriq kb crawl https://docs.example.com

Crawl progress is exposed via GET /api/projects/:pid/kb/crawl and is currently dashboard-only — not stable v1 surface.

Ask a question... ⌘I