Quick Start Guide
Add comprehensive observability to your agents with just 1 decorator per function. Integration takes under 5 minutes.
Prerequisites
Python 3.8+
orNode.js 16+
An existing AI agent or LLM application
Step 1: Installation
Install the SDK
Choose your preferred language
Python
pip install runlog-aiTypeScript/JavaScript
npm install @runlog/sdkStep 2: Basic Setup
Add the Decorator
Just 1 line per function - no code changes needed
from runlog import runlog
# Just add the decorator - that's it!
@runlog(service="my-agent", env="development")
def handle_user_query(user_input: str):
# Your existing agent code stays exactly the same
context = search_knowledge_base(user_input)
response = llm.generate(prompt=user_input, context=context)
if response.confidence < 0.8:
return escalate_to_human(user_input)
return response.text
# RunLog now automatically tracks every stepStep 3: TypeScript Example
Same Simplicity in TypeScript
One decorator line for full observability
import { runlog } from "@runlog/sdk";
// Just add the decorator - that's it!
@runlog({ service: "my-agent", env: "development" })
async function processUserQuery(input: string): Promise<string> {
// Your existing agent code stays exactly the same
const context = await searchKnowledgeBase(input);
const response = await llm.generate({
prompt: input,
context: context
});
return response;
}
// Full observability with zero code changesStep 4: Add Safety Policies
Automatic Policy Enforcement
Policies apply automatically to decorated functions
# Create a policy file: policies.yaml
policies:
- id: cost_limit
when: { cost: { gt: 0.50 } }
action: deny
- id: sensitive_operations
when: { input: { contains: "transfer" } }
action: require_approval
# Your decorated functions automatically follow these policies!
@runlog(service="banking", policies="./policies.yaml")
def handle_banking_request(user_input: str):
# No policy code needed - it's automatic
return process_request(user_input)Next Steps
Continue learning about RunLog AI capabilities