Ingest, search, and manage vector-backed knowledge bases with the Noxus SDK
client.knowledge_bases manages KBs and their documents: ingestion (upload & train), listing, semantic search, and export/import. A KB stores documents as vectors so agents and workflows can retrieve from them.
Upload local files (they ingest & train asynchronously — returns run ids):
run_ids = client.knowledge_bases.upload_document( kb_id, files=["./guide.pdf", "./faq.md"], prefix="/manuals")# wait for ingestion to finish:for run in client.knowledge_bases.get_runs(kb_id, run_ids=",".join(run_ids)): run.wait()
Train from a source (URL / connector / etc. via a Source):
from noxus_sdk.resources.knowledge_bases import Sourceclient.knowledge_bases.train_document(kb_id, source=Source(...), prefix="/")
Create a bare document row (e.g. a folder or a placeholder):
from noxus_sdk.resources.knowledge_bases import CreateDocumentdoc = client.knowledge_bases.create_document( kb_id, CreateDocument(name="notes.txt", prefix="/misc"))
status is one of trained | training | error | uploaded | folder. Omit it to list all statuses (the SDK loops them for you). Prefer the iterator to walk every document without hand-rolling pages:
# one page, one statusclient.knowledge_bases.list_documents(kb_id, status="trained", page=1, page_size=10)# every document, every status, auto-paginatedfor doc in client.knowledge_bases.iter_documents(kb_id): print(doc.name, doc.status, doc.size, doc.content_type)# only documents mid-ingestionclient.knowledge_bases.list_ingestion_documents(kb_id)