Skip to main content
Run recipes inside your Python process for the lowest latency and direct access to results.
The user calls the SDK from application code; results return in memory with no network hop.
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

  • 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

Ensure PraisonAI is installed in your Python environment:
If using a virtual environment, make sure it’s activated.
Check available recipes:
Recipes are discovered from:
  1. ~/.praisonai/templates
  2. ~/.config/praison/templates
  3. ./.praison/templates (current directory)
Verify your API key is set:
Set it in your environment:
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()

recipe.run_stream()

Returns an iterator of RecipeEvent objects with:
  • event_type: “started”, “progress”, “completed”, “error”
  • data: Event-specific data dictionary

Next Steps