Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt

Use this file to discover all available pages before exploring further.

Knowledge bases ingest documents asynchronously (parse → chunk → embed) and let you search the result:
  • UploadPOST /v1/knowledge-bases/{kb_id}/upload_train (multipart). Returns run ids you can poll.
  • SearchPOST /v1/knowledge-bases/{kb_id}/search.
Replace kb_id and your_api_key. Use the prefix parameter to organise and scope documents into folders.

Upload documents and wait for ingestion

Upload returns immediately with run ids; ingestion runs in the background. Poll the training runs (SDK get_runs, or the running jobs endpoint) until they complete before searching. Don’t set Content-Type yourself on the upload — let your HTTP client set the multipart boundary.
# pip install noxus-sdk
from pathlib import Path
import time
from noxus_sdk.client import Client

client = Client(api_key="your_api_key")
kb = client.knowledge_bases.get(knowledge_base_id="kb_id")

run_ids = kb.upload_document(files=[Path("path/to/document.pdf")], prefix="/")
print(f"ingestion started: {run_ids}")

# Wait for ingestion to finish
while any(
    r.status not in ("completed", "failed")
    for r in kb.get_runs(run_ids=",".join(run_ids))
):
    time.sleep(3)
print("ingestion done")

Search the knowledge base

Runs a semantic / hybrid query (depending on the KB’s retrieval settings) over the ingested content and returns the matching chunks with their source documents. Scope the search with prefix.
from noxus_sdk.client import Client

client = Client(api_key="your_api_key")
kb = client.knowledge_bases.get(knowledge_base_id="kb_id")

for result in kb.search(query="Your search query", prefix="/"):
    print(result.document_source.name)
    print(result.content)

Async / await with the SDK

Use the a-prefixed coroutines (aget, aupload_document, aget_runs, asearch) from async code so the event loop stays responsive.
Python SDK
import asyncio
from pathlib import Path
from noxus_sdk.client import Client


async def main():
    client = Client(api_key="your_api_key")
    kb = await client.knowledge_bases.aget(knowledge_base_id="kb_id")

    await kb.aupload_document(files=[Path("path/to/document.pdf")], prefix="/")

    results = await kb.asearch(query="Your search query", prefix="/")
    for r in results:
        print(r.document_source.name, r.content)


asyncio.run(main())