Skip to main content

Documentation Index

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

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

KnowledgeBases.acreate provisions a new managed knowledge base. The returned KnowledgeBase is empty until you aadd_documents(...) to populate it.
from xpander_sdk import KnowledgeBases

kb = await KnowledgeBases().acreate(
    name="Q4 Reports",
    description="Quarterly earnings",
)
print(kb.id, kb.total_documents)   # kb-…, 0

Parameters

ParameterTypeRequiredDefaultDescription
namestrYes–Display name.
descriptionstrNo""Description. Useful for cataloging.

Returns KnowledgeBase

A new KnowledgeBase with total_documents=0. Use kb.aadd_documents([...]) to populate it.

Examples

Create + populate

kbs = KnowledgeBases()

kb = await kbs.acreate(
    name="Engineering RFCs",
    description="All historical RFC documents.",
)

await kb.aadd_documents([
    "https://docs.acme.com/rfc/0001-architecture.md",
    "https://docs.acme.com/rfc/0002-deployment.md",
])
aadd_documents accepts a list of URLs the platform fetches and ingests. See the KnowledgeBase reference.

Sync version

kb = KnowledgeBases().create(name="My KB", description="...")

Errors

Raises ModuleException on failure.