pub struct KnowledgeApi { /* private fields */ }Expand description
Knowledge base management
Implementations§
Source§impl KnowledgeApi
impl KnowledgeApi
Sourcepub async fn create_knowledge_base(
&self,
body: &KnowledgeBaseCreate,
) -> Result<KnowledgeBase>
pub async fn create_knowledge_base( &self, body: &KnowledgeBaseCreate, ) -> Result<KnowledgeBase>
Create a knowledge base
POST /api/v1/knowledge-bases
Required scopes: memory:write.
Sourcepub async fn delete_kb_document(
&self,
id: &str,
doc_id: &str,
) -> Result<DeleteKbDocumentResponse>
pub async fn delete_kb_document( &self, id: &str, doc_id: &str, ) -> Result<DeleteKbDocumentResponse>
Delete document
DELETE /api/v1/knowledge-bases/{id}/documents/{docId}
Required scopes: memory:write.
Sourcepub async fn delete_knowledge_base(
&self,
id: &str,
) -> Result<DeleteKnowledgeBaseResponse>
pub async fn delete_knowledge_base( &self, id: &str, ) -> Result<DeleteKnowledgeBaseResponse>
Delete knowledge base
DELETE /api/v1/knowledge-bases/{id}
Required scopes: memory:write.
Sourcepub async fn get_knowledge_base(&self, id: &str) -> Result<KnowledgeBase>
pub async fn get_knowledge_base(&self, id: &str) -> Result<KnowledgeBase>
Get knowledge base
GET /api/v1/knowledge-bases/{id}
Required scopes: memory:read.
Sourcepub async fn ingest_kb_document(
&self,
kb_id: &str,
body: &IngestKbDocumentRequest,
) -> Result<IngestKbDocumentResponse>
pub async fn ingest_kb_document( &self, kb_id: &str, body: &IngestKbDocumentRequest, ) -> Result<IngestKbDocumentResponse>
Ingest document into knowledge base
POST /api/v1/knowledge-bases/{kbId}/documents
Required scopes: memory:write.
Sourcepub async fn list_kb_documents(
&self,
kb_id: &str,
) -> Result<ListKbDocumentsResponse>
pub async fn list_kb_documents( &self, kb_id: &str, ) -> Result<ListKbDocumentsResponse>
List documents in knowledge base
GET /api/v1/knowledge-bases/{kbId}/documents
Required scopes: memory:read.
Sourcepub async fn list_knowledge_bases(&self) -> Result<ListKnowledgeBasesResponse>
pub async fn list_knowledge_bases(&self) -> Result<ListKnowledgeBasesResponse>
List knowledge bases
GET /api/v1/knowledge-bases
Required scopes: memory:read.
Sourcepub async fn reindex_knowledge_base(
&self,
kb_id: &str,
) -> Result<ReindexKnowledgeBaseResponse>
pub async fn reindex_knowledge_base( &self, kb_id: &str, ) -> Result<ReindexKnowledgeBaseResponse>
Re-embed every chunk with the current model
Recovers a knowledge base that was indexed without embeddings (keyword-only) and clears embedding drift after a model change. Requires an embeddings backend: without one the answer is 503 and nothing is written.
POST /api/v1/knowledge-bases/{kbId}/reindex
Required scopes: memory:write.
Sourcepub async fn search_knowledge_base(
&self,
kb_id: &str,
body: &SearchKnowledgeBaseRequest,
) -> Result<KnowledgeBaseSearchResult>
pub async fn search_knowledge_base( &self, kb_id: &str, body: &SearchKnowledgeBaseRequest, ) -> Result<KnowledgeBaseSearchResult>
Retrieve chunks from one knowledge base
Vector search when an embeddings backend is configured, keyword scoring when it is not —
mode says which ran, and a vector pass that matches nothing falls back to keyword rather
than answering empty. status distinguishes the three outcomes a caller must render
differently: KB_EMPTY (nothing indexed yet), NO_MATCHES (indexed, nothing matched) and
RESULTS_FOUND. All three are 200: an empty result is an answer here, not a failure.
POST /api/v1/knowledge-bases/{kbId}/search
Required scopes: memory:write.
Sourcepub async fn update_knowledge_base(
&self,
id: &str,
body: &KnowledgeBaseUpdate,
) -> Result<KnowledgeBase>
pub async fn update_knowledge_base( &self, id: &str, body: &KnowledgeBaseUpdate, ) -> Result<KnowledgeBase>
Update knowledge base
WRITE SEMANTICS: merges. Measured 2026-08-31 on the wire: {name} left description intact
and vice versa, and chunk_size and embedding_model survived both. Note this is the
OPPOSITE of PUT /agents/{id}/schedule, which replaces — the verb decides nothing here, see
docs/WRITE_SEMANTICS.md.
PUT /api/v1/knowledge-bases/{id}
Required scopes: memory:write.
Trait Implementations§
Source§impl Clone for KnowledgeApi
impl Clone for KnowledgeApi
Source§fn clone(&self) -> KnowledgeApi
fn clone(&self) -> KnowledgeApi
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more