Python Client Library
Get Started with the Python Client
The official Python client makes it easy to integrate Ontbo's cognitive context API into your applications.
Installation
pip install ontboThe Python client is available on PyPI and can be installed with pip.
Quick Start
Get up and running with Ontbo in just a few lines of code. This example shows how to create a profile, add conversation data, and query for relevant facts.
from ontbo import Ontbo, SceneMessage
# Initialize the client with your API key
ontbo = Ontbo(token="<YOUR_API_KEY_HERE>")
# Create a user profile
profile = ontbo.create_profile("alice_test")
# Create a scene (conversation context)
scene = profile.create_scene("scene_test")
# Add messages to the scene
scene.add_messages(
[SceneMessage(content="Hello, my name is Alice!")],
update_now=True
)
# Query for relevant facts about the user
facts = profile.query_facts("What is the user's name?")
print(facts)That's it!
In just a few lines, you've created a cognitive context layer that can understand and remember user information. The profile will automatically extract and store relevant facts from the conversation.
Browse for Extra Samples
Explore our collection of code samples and examples to see the Ontbo Python client in action.
GitHub Samples Repository
Our samples repository contains real-world examples, integration patterns, and advanced use cases that demonstrate the full power of the Ontbo Python client.
Resources
Ready to Get Started?
Install the Python client and start building intelligent applications with cognitive context.