Python SDK
You can use the TinyClient to build custom agents, automation scripts, or CI/CD pipelines.
Initialization & Login
from tiny_foundation import TinyClient
# Initialize the client
client = TinyClient(api_url="https://tiny-foundation.spikinglabs.com")
# Authenticate
client.login("[email protected]", "your-password")
access_token = client.credentials.access_token
Pushing and Approving Documents
# Push a draft document
client.push_document(
workspace_id="workspace-uuid",
access_token=access_token,
title="architecture/system-design",
content="# System Design\n\nThis is the content of the document."
)
# Approve the document to trigger downstream pipelines
client.approve_document(
workspace_id="workspace-uuid",
access_token=access_token,
document_id="architecture/system-design",
message="Approved system design"
)
Working with the Knowledge Graph
# Trigger the graph extraction pipeline manually (if needed)
client.trigger_graphify("workspace-uuid", access_token)
# Fetch the built graph
graph = client.get_graph("workspace-uuid", access_token)
print(f"Graph has {len(graph['nodes'])} nodes and {len(graph['edges'])} edges.")
for node in graph['nodes'][:5]:
print(f"- {node['label']} ({node['type']})")