Skip to main content
PandasAI 3.0 introduces significant architectural changes. This guide covers breaking changes and migration steps. See Backwards Compatibility for v2 classes that still work.

Breaking Changes

Configuration

Configuration is now global using pai.config.set() instead of per-dataframe. Several options have been removed: Removed: save_charts, enable_cache, security, custom_whitelisted_dependencies, save_charts_path, custom_head v2:
v3:
Key Changes:
  • Global configuration applies to all dataframes
  • Charts returned as ChartResponse objects for manual handling
  • Security handled through sandbox environment
  • Caching removed for simplicity
More details: See config docs for configuration examples and more details.

LLM

LLMs are now extension-based. Install pandasai-litellm separately for unified access to 100+ models. v2:
v3:
Key Changes:
  • LLMs are now extension-based, not built-in
  • Install pandasai-litellm for unified LLM interface
  • LiteLLM supports 100+ models (GPT-4, Claude, Gemini, etc.)
  • Configure LLM globally instead of per-dataframe
  • You need to install both pandasai and pandasai-litellm
More details: See Large Language Models for supported models and configuration.

Data Connectors

Connectors are now separate extensions. Install only what you need. Cloud connectors require enterprise license. v2:
v3:
Key Changes:
  • Install specific extensions: pandasai-sql[postgres], pandasai-sql[mysql]
  • Use pai.create() with semantic layer
  • Environment variables supported: ${DB_USER}
More details: See Data Ingestion for connector setup and configuration.

Skills

Skills require a valid enterprise license for production use. See Enterprise Features for more details.
Skills use @pai.skill decorator and are automatically registered globally. v2:
v3:
Key Changes:
  • Use @pai.skill instead of @skill
  • Automatic global registration
  • No need for agent.add_skills()
  • Works with pai.chat(), SmartDataframe, and Agent
More details: See Skills for detailed usage and examples.

Agent

Agent class works mostly the same, but some methods have been removed in v3. Removed methods: clarification_questions(), rephrase_query(), explain() v2:
v3:
Key Changes:
  • clarification_questions(), rephrase_query(), and explain() have been removed
  • New follow_up() method maintains conversation context
  • Global LLM configuration required

Training

Training with vector stores requires a valid enterprise license for production use. See Enterprise Features for more details.
Training is now available through local vector stores (ChromaDB, Qdrant, Pinecone, LanceDB) for few-shot learning. The train() method is still available but requires a vector store. v2:
v3:
Key Changes:
  • Training requires a vector store (ChromaDB, Qdrant, Pinecone, LanceDB)
  • Vector stores enable few-shot learning
  • Better scalability and performance
More details: See Training the Agent for setup and examples.

Migration Steps

Step 1: Update Installation

Step 2: Update Imports

Step 3: Configure LLM Globally

Step 4: Migrate DataFrames (optional)

Check the Backwards Compatibility section for details on the difference between SmartDataframe, SmartDatalakes, and the new Semantic DataFrames (pai dataframes). In this way you can decide if migrating or not. Option A: Keep SmartDataframe (backward compatible)
Option B: Use pai.DataFrame (recommended)
Multiple DataFrames:

Step 5: Migrate Data Connectors

Step 6: Update Skills (if applicable)

Skills require a valid enterprise license for production use. See Enterprise Features for more details.

Step 7: Remove Deprecated Configuration

Migration Tests

Test your migration with these examples:

Basic Chat Test

Multi-DataFrame Test

Skills Test


Next Steps: - Review Backwards Compatibility for v2 classes - Check Migration Troubleshooting for common issues