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 usingpai.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:
- Global configuration applies to all dataframes
- Charts returned as
ChartResponse
objects for manual handling - Security handled through sandbox environment
- Caching removed for simplicity
LLM
LLMs are now extension-based. Installpandasai-litellm
separately for unified access to 100+ models.
v2:
- 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
andpandasai-litellm
Data Connectors
Connectors are now separate extensions. Install only what you need. Cloud connectors require enterprise license. v2:- Install specific extensions:
pandasai-sql[postgres]
,pandasai-sql[mysql]
- Use
pai.create()
with semantic layer - Environment variables supported:
${DB_USER}
Skills
Skills require a valid enterprise license for production use. See Enterprise
Features for more details.
@pai.skill
decorator and are automatically registered globally.
v2:
- Use
@pai.skill
instead of@skill
- Automatic global registration
- No need for
agent.add_skills()
- Works with
pai.chat()
,SmartDataframe
, andAgent
Training
Training with vector stores requires a valid enterprise license for production
use. See Enterprise Features for more details.
train()
method is still available but requires a vector store.
v2:
- Training requires a vector store (ChromaDB, Qdrant, Pinecone, LanceDB)
- Vector stores enable few-shot learning
- Better scalability and performance
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)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