SDKs
SDK Design Patterns
How to structure your code for maximum reliability.
The StateBase SDK is designed to be injected into your existing agent loop. Here are the three most common ways to integrate.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How to structure your code for maximum reliability.
def ask_agent(session_id, user_query):
# 1. Get context
context = sb.sessions.get_context(session_id, query=user_query)
# 2. Call LLM
answer = call_llm(context, user_query)
# 3. Log turn
sb.sessions.add_turn(session_id, input=user_query, output=answer)
return answer