Perplexity with Agno - Perplexity
Summary
Agno, an open-source Python framework, now offers native support for Perplexity's web-grounded Sonar models, enabling developers to integrate them into Agno agents, teams, and workflows. The integration allows access to Perplexity models like `sonar`, `sonar-pro`, `sonar-reasoning`, `sonar-reasoning-pro`, and `sonar-deep-research` via a unified `Agent` abstraction. Installation requires `pip install agno openai`, with the Perplexity API key set as an environment variable. The `Perplexity` model class supports standard OpenAI parameters, along with specific options such as `id`, `api_key`, `base_url`, `max_tokens`, `top_k`, `retries`, `delay_between_retries`, and `exponential_backoff`. It also facilitates structured output using Pydantic models and streaming responses.
Key takeaway
For AI Engineers building agentic workflows, Agno's native Perplexity integration simplifies incorporating web-grounded Sonar models. You can leverage its unified `Agent` abstraction for tasks requiring up-to-date information, structured output, or streaming responses. Be aware that tool calling with Perplexity models through Agno may be less reliable than with `OpenAIChat` or `Claude` for complex orchestrations.
Key insights
Agno integrates Perplexity's Sonar models, offering a unified framework for agent development with web-grounded AI.
Principles
- Unified agent abstraction simplifies model integration.
- Open-source frameworks enhance developer flexibility.
Method
Install Agno and OpenAI SDK, set `PERPLEXITY_API_KEY`, then instantiate `Agent` with `Perplexity` model and desired `id` for web-grounded AI tasks.
In practice
- Use `Perplexity(id="sonar-pro")` for advanced models.
- Define Pydantic `BaseModel` for structured output.
- Enable `stream=True` for real-time response generation.
Topics
- Agno Framework
- Perplexity Integration
- Sonar Models
- Agent Development
- Structured Output
Best for: AI Engineer, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by perplexity.ai via Google News.