This guide helps you migrate your codebase to adapt to the major refactor accompanying the launch of Agno.
This refactor includes comprehensive updates to namespaces to improve clarity and consistency. Pay close attention to the following changes:
phi
namespaces are now replaced with agno
to reflect the updated structure.phi.model.x
➔ agno.models.x
agno.models
namespace, consolidating related functionality in a single location.phi.knowledge_base.x
➔ agno.knowledge.x
agno.knowledge
.phi.document.reader.xxx
➔ agno.document.reader.xxx_reader
_reader
suffix for clarity and consistency.Tools
suffix. For example, DuckDuckGo
➔ DuckDuckGoTools
.
The multi-modal interface now uses specific types for different media inputs and outputs:
Images:
Image
class, providing additional metadata and control over image handling.Audio:
Audio
class, allowing specification of content and format.Video:
Video
class, enabling better handling of video data.RunResponse
now includes updated artifact types:
RunResponse.images
is a list of type ImageArtifact
:
RunResponse.audio
is a list of type AudioArtifact
:
RunResponse.videos
is a list of type VideoArtifact
:
RunResponse.response_audio
is of type AudioOutput
:
Hermes
➔ OllamaHermes
AzureOpenAIChat
➔ AzureOpenAI
CohereChat
➔ Cohere
DeepSeekChat
➔ DeepSeek
GeminiOpenAIChat
➔ GeminiOpenAI
HuggingFaceChat
➔ HuggingFace
For example:
PgAgentStorage
➔ PostgresAgentStorage
SqlAgentStorage
➔ SqliteAgentStorage
MongoAgentStorage
➔ MongoDbAgentStorage
S2AgentStorage
➔ SingleStoreAgentStorage
SqlWorkflowStorage
➔ SqliteWorkflowStorage
PgWorkflowStorage
➔ PostgresWorkflowStorage
MongoWorkflowStorage
➔ MongoDbWorkflowStorage
phi.knowledge.pdf.PDFUrlKnowledgeBase
➔ agno.knowledge.pdf_url.PDFUrlKnowledgeBase
phi.knowledge.csv.CSVUrlKnowledgeBase
➔ agno.knowledge.csv_url.CSVUrlKnowledgeBase
Embedders now all take id instead of model as a parameter. For example:
OllamaEmbedder(model="llama3.2")
-> OllamaEmbedder(id="llama3.2")
phi.document.reader.arxiv
➔ agno.document.reader.arxiv_reader
phi.document.reader.docx
➔ agno.document.reader.docx_reader
phi.document.reader.json
➔ agno.document.reader.json_reader
phi.document.reader.pdf
➔ agno.document.reader.pdf_reader
phi.document.reader.s3.pdf
➔ agno.document.reader.s3.pdf_reader
phi.document.reader.s3.text
➔ agno.document.reader.s3.text_reader
phi.document.reader.text
➔ agno.document.reader.text_reader
phi.document.reader.website
➔ agno.document.reader.website_reader
guidelines
, prevent_hallucinations
, prevent_prompt_leakage
, limit_tool_access
, and task
have been removed from the Agent
class. They can be incorporated into the instructions
parameter as you see fit.For example:
The Agno CLI has been refactored from phi
to ag
. Here are the key changes:
The commands ag ws up dev
and ag ws up prod
have to be used instead of ag ws up
to start the workspace in development and production mode respectively.
ag ping
-> Check if you are authenticatedphi ws setup
-> Replaced by ag setup
The infrastructure-related code has been reorganized for better clarity:
/libs/infra/agno_docker
and has a separate PyPi package agno-docker
./libs/infra/agno_aws
and has a separate PyPi package agno-aws
.We recommend installing these packages in applications that you intend to deploy to AWS using Agno, or if you are migrating from a Phidata application.
The specific path changes are:
import phi.aws.resource.xxx
➔ import agno.aws.resource.xxx
import phi.docker.xxx
➔ import agno.docker.xxx
Follow the steps above to ensure your codebase is compatible with the latest version of Agno AI. If you encounter any issues, don’t hesitate to contact us on Discourse or Discord.
This guide helps you migrate your codebase to adapt to the major refactor accompanying the launch of Agno.
This refactor includes comprehensive updates to namespaces to improve clarity and consistency. Pay close attention to the following changes:
phi
namespaces are now replaced with agno
to reflect the updated structure.phi.model.x
➔ agno.models.x
agno.models
namespace, consolidating related functionality in a single location.phi.knowledge_base.x
➔ agno.knowledge.x
agno.knowledge
.phi.document.reader.xxx
➔ agno.document.reader.xxx_reader
_reader
suffix for clarity and consistency.Tools
suffix. For example, DuckDuckGo
➔ DuckDuckGoTools
.
The multi-modal interface now uses specific types for different media inputs and outputs:
Images:
Image
class, providing additional metadata and control over image handling.Audio:
Audio
class, allowing specification of content and format.Video:
Video
class, enabling better handling of video data.RunResponse
now includes updated artifact types:
RunResponse.images
is a list of type ImageArtifact
:
RunResponse.audio
is a list of type AudioArtifact
:
RunResponse.videos
is a list of type VideoArtifact
:
RunResponse.response_audio
is of type AudioOutput
:
Hermes
➔ OllamaHermes
AzureOpenAIChat
➔ AzureOpenAI
CohereChat
➔ Cohere
DeepSeekChat
➔ DeepSeek
GeminiOpenAIChat
➔ GeminiOpenAI
HuggingFaceChat
➔ HuggingFace
For example:
PgAgentStorage
➔ PostgresAgentStorage
SqlAgentStorage
➔ SqliteAgentStorage
MongoAgentStorage
➔ MongoDbAgentStorage
S2AgentStorage
➔ SingleStoreAgentStorage
SqlWorkflowStorage
➔ SqliteWorkflowStorage
PgWorkflowStorage
➔ PostgresWorkflowStorage
MongoWorkflowStorage
➔ MongoDbWorkflowStorage
phi.knowledge.pdf.PDFUrlKnowledgeBase
➔ agno.knowledge.pdf_url.PDFUrlKnowledgeBase
phi.knowledge.csv.CSVUrlKnowledgeBase
➔ agno.knowledge.csv_url.CSVUrlKnowledgeBase
Embedders now all take id instead of model as a parameter. For example:
OllamaEmbedder(model="llama3.2")
-> OllamaEmbedder(id="llama3.2")
phi.document.reader.arxiv
➔ agno.document.reader.arxiv_reader
phi.document.reader.docx
➔ agno.document.reader.docx_reader
phi.document.reader.json
➔ agno.document.reader.json_reader
phi.document.reader.pdf
➔ agno.document.reader.pdf_reader
phi.document.reader.s3.pdf
➔ agno.document.reader.s3.pdf_reader
phi.document.reader.s3.text
➔ agno.document.reader.s3.text_reader
phi.document.reader.text
➔ agno.document.reader.text_reader
phi.document.reader.website
➔ agno.document.reader.website_reader
guidelines
, prevent_hallucinations
, prevent_prompt_leakage
, limit_tool_access
, and task
have been removed from the Agent
class. They can be incorporated into the instructions
parameter as you see fit.For example:
The Agno CLI has been refactored from phi
to ag
. Here are the key changes:
The commands ag ws up dev
and ag ws up prod
have to be used instead of ag ws up
to start the workspace in development and production mode respectively.
ag ping
-> Check if you are authenticatedphi ws setup
-> Replaced by ag setup
The infrastructure-related code has been reorganized for better clarity:
/libs/infra/agno_docker
and has a separate PyPi package agno-docker
./libs/infra/agno_aws
and has a separate PyPi package agno-aws
.We recommend installing these packages in applications that you intend to deploy to AWS using Agno, or if you are migrating from a Phidata application.
The specific path changes are:
import phi.aws.resource.xxx
➔ import agno.aws.resource.xxx
import phi.docker.xxx
➔ import agno.docker.xxx
Follow the steps above to ensure your codebase is compatible with the latest version of Agno AI. If you encounter any issues, don’t hesitate to contact us on Discourse or Discord.