Skip to main content
PandasAI v3 maintains backward compatibility for SmartDataframe, SmartDatalake, and Agent. However, we recommend migrating to the new pai.DataFrame() and pai.chat() methods for better performance and features.

SmartDataframe

SmartDataframe continues to work in v3 with the same API. However, you must configure the LLM globally.

Using SmartDataframe in v3 (Legacy)

While SmartDataframe works, we recommend using pai.DataFrame() for better integration with v3 features:
Benefits of pai.DataFrame():
  • Better integration with semantic layer
  • Improved context management
  • Enhanced performance
  • Access to v3-specific features
  • Cleaner API

SmartDatalake

SmartDatalake still works but is no longer necessary. You can query multiple dataframes directly with pai.chat().

Using SmartDatalake in v3 (Legacy)

Query multiple dataframes directly without SmartDatalake:
Benefits of pai.chat():
  • No need to instantiate SmartDatalake
  • Cleaner, more intuitive API
  • Better performance
  • Semantic layer support
  • Easier to add/remove dataframes dynamically

Agent

The Agent class works mostly the same way in v3 as it did in v2, but some methods have been removed. The main requirement is to configure the LLM globally.
Key Change: Configure LLM globally with pai.config.set() instead of passing it per-agent.

New Agent Methods in v3

PandasAI v3 introduces new Agent methods that enhance conversational capabilities:
  • follow_up(query): Continue conversations without clearing memory (maintains context)
Note: The clarification_questions(), explain() and rephrase_query() methods have been removed in v3. These methods provide enhanced conversational capabilities not available in v2. For detailed information about Agent usage, see the Agent documentation. For information about using Skills with Agent, see the Skills documentation.