Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Manage knowledge bases with the Python SDK
client.knowledge_bases
from chatatp_studio import ChatATPClient async with ChatATPClient(api_key="chatatp_sk_...") as client: knowledge_base = await client.knowledge_bases.create( "Product docs", description="Support documentation", agent_id=7, # optional: attach while creating )
await client.knowledge_bases.upload( knowledge_base["id"], "./manual.pdf", ) documents = await client.knowledge_bases.documents(knowledge_base["id"]) stats = await client.knowledge_bases.stats(knowledge_base["id"]) for document in documents["data"]: print(document["name"], document["status"], document["chunk_count"])
indexed
failed
chunk_count
char_count
error_message
await client.knowledge_bases.add_url( knowledge_base["id"], "https://docs.example.com", ) result = await client.knowledge_bases.search( knowledge_base["id"], "How do I reset my password?", top_k=5, ) print(result["context"], result["has_context"])
await client.knowledge_bases.attach( 7, knowledge_base["id"], enabled=True, auto_context=True, max_context_chunks=5, context_threshold=0.3, )