Model 1: Embedded SDK (In-Process)
When to Use: Python applications, Jupyter notebooks, data pipelines, or any scenario where you need the lowest possible latency and direct memory access to results.
How It Works
The Embedded SDK runs recipes directly in your Python process. No network calls, no serialization overhead—just direct function calls.Pros & Cons
- Pros
- Cons
- Zero network latency - Direct in-process execution
- Direct memory access - Work with Python objects directly
- Simplest integration - Just import and call
- Full Python ecosystem - Use any Python library alongside recipes
- Streaming support - Real-time event streaming
Step-by-Step Tutorial
1
Install PraisonAI
2
Set API Keys
3
List Available Recipes
4
Run a Recipe (Sync)
5
Run a Recipe (Streaming)
Production-Ready Example
Troubleshooting
ImportError: No module named 'praisonai'
ImportError: No module named 'praisonai'
Ensure PraisonAI is installed in your Python environment:If using a virtual environment, make sure it’s activated.
Recipe not found
Recipe not found
Check available recipes:Recipes are discovered from:
~/.praison/templates~/.config/praison/templates./.praison/templates(current directory)
API key error
API key error
Verify your API key is set:Set it in your environment:
Timeout errors
Timeout errors
Increase the timeout or check if the recipe is hanging:
Security & Ops Notes
Security Considerations
- Process isolation: Recipes run in your process—malicious recipes could access your memory
- API keys: Ensure API keys are not logged or exposed
- Input validation: Validate inputs before passing to recipes
- Resource limits: Consider memory/CPU limits for long-running recipes
API Reference
recipe.run()
| Parameter | Type | Description |
|---|---|---|
name | str | Recipe name |
input | dict | Input data for the recipe |
config | dict | Recipe configuration overrides |
session_id | str | Session ID for stateful recipes |
options | dict | Execution options (timeout_sec, trace_id, etc.) |
recipe.run_stream()
RecipeEvent objects with:
event_type: “started”, “progress”, “completed”, “error”data: Event-specific data dictionary
Next Steps
- CLI Invocation - For scripts and automation
- Local HTTP Sidecar - For polyglot environments
- Use Cases - Real-world implementation patterns

