Skip to main content
This guide helps you migrate your codebase to adapt to the major refactor accompanying the launch of Agno.

General Namespace Updates

This refactor includes comprehensive updates to namespaces to improve clarity and consistency. Pay close attention to the following changes:
  • All phi namespaces are now replaced with agno to reflect the updated structure.
  • Submodules and classes have been renamed to better represent their functionality and context.

Interface Changes

Module and Namespace Updates

  • Models:
    • phi.model.xagno.models.x
      • All model classes now reside under the agno.models namespace, consolidating related functionality in a single location.
  • Knowledge Bases:
    • phi.knowledge_base.xagno.knowledge.x
      • Knowledge bases have been restructured for better organization under agno.knowledge.
  • Document Readers:
    • phi.document.reader.xxxagno.document.reader.xxx_reader
      • Document readers now include a _reader suffix for clarity and consistency.
  • Toolkits:
    • All Agno toolkits now have a Tools suffix. For example, DuckDuckGoDuckDuckGoTools.
      • This change standardizes the naming of tools, making their purpose more explicit.

Multi-Modal Interface Updates

The multi-modal interface now uses specific types for different media inputs and outputs:

Inputs

  • Images:
    • Images are now represented by a dedicated Image class, providing additional metadata and control over image handling.
  • Audio:
    • Audio files are handled through the Audio class, allowing specification of content and format.
  • Video:
    • Videos have their own Video class, enabling better handling of video data.

Outputs

  • 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:
      • This response audio corresponds to the model’s response in audio format.

Model Name Changes

  • HermesOllamaHermes
  • AzureOpenAIChatAzureOpenAI
  • CohereChatCohere
  • DeepSeekChatDeepSeek
  • GeminiOpenAIChatGeminiOpenAI
  • HuggingFaceChatHuggingFace
For example:

Storage Class Updates

  • Agent Storage:
    • PgAgentStoragePostgresAgentStorage
    • SqlAgentStorageSqliteAgentStorage
    • MongoAgentStorageMongoDbAgentStorage
    • S2AgentStorageSingleStoreAgentStorage
  • Workflow Storage:
    • SqlWorkflowStorageSqliteWorkflowStorage
    • PgWorkflowStoragePostgresWorkflowStorage
    • MongoWorkflowStorageMongoDbWorkflowStorage

Knowledge Base Updates

  • phi.knowledge.pdf.PDFUrlKnowledgeBaseagno.knowledge.pdf_url.PDFUrlKnowledgeBase
  • phi.knowledge.csv.CSVUrlKnowledgeBaseagno.knowledge.csv_url.CSVUrlKnowledgeBase

Embedders updates

Embedders now all take id instead of model as a parameter. For example:
  • OllamaEmbedder(model="llama3.2") -> OllamaEmbedder(id="llama3.2")

Reader Updates

  • phi.document.reader.arxivagno.document.reader.arxiv_reader
  • phi.document.reader.docxagno.document.reader.docx_reader
  • phi.document.reader.jsonagno.document.reader.json_reader
  • phi.document.reader.pdfagno.document.reader.pdf_reader
  • phi.document.reader.s3.pdfagno.document.reader.s3.pdf_reader
  • phi.document.reader.s3.textagno.document.reader.s3.text_reader
  • phi.document.reader.textagno.document.reader.text_reader
  • phi.document.reader.websiteagno.document.reader.website_reader

Agent Updates

  • 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:

CLI and Infrastructure Updates

Command Line Interface Changes

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.

New Commands

  • ag ping -> Check if you are authenticated

Removed Commands

  • phi ws setup -> Replaced by ag setup

Infrastructure Path Changes

The infrastructure-related code has been reorganized for better clarity:
  • Docker Infrastructure: This has been moved to a separate package in /libs/infra/agno_docker and has a separate PyPi package agno-docker.
  • AWS Infrastructure: This has been moved to a separate package in /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.xxximport agno.aws.resource.xxx
  • import phi.docker.xxximport 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.