Agent Capability Lifecycle#
Current status: Skills are not supported in the v3 Agent. The v2 agent had a full skill registration API that was deliberately removed in October 2024 during the v3 refactoring. There is currently no API or state representation for dynamically adding, updating, or removing custom skills from a running agent.
What Skills Were (v2)#
In v2, the @skill decorator (from pandasai.skills) wrapped any Python function into a callable Skill object, automatically extracting its name, signature, and docstring to inform the LLM of the capability . The agent's add_skills() method registered skills through a SkillsManager helper that enforced uniqueness by name and formatted registered skills for inclusion in the code-generation prompt.
The full v2 lifecycle API was:
| Method | Location | Purpose |
|---|---|---|
@skill / @skill("name") | pandasai/skills/__init__.py | Declare a function as a skill |
agent.add_skills(*skills) | SmartDatalake / SmartDataframe | Register skills with the agent |
SkillsManager.skill_exists(name) | pandasai/helpers/skills_manager.py | Deduplicate by name |
SkillsManager.has_skills() | pandasai/helpers/skills_manager.py | Guard prompt injection |
SkillsManager.prompt_display() | pandasai/helpers/skills_manager.py | Inject skill definitions into the LLM prompt |
SkillsManager.add_used_skill(skill) | pandasai/helpers/skills_manager.py | Track which skills were invoked |
Why Skills Were Removed#
The removal was made in commit bacee07f (2024-10-15) as part of the migration from the SmartDataframe/SmartDatalake pipeline architecture to the simpler v3 Agent. The commit deleted:
pandasai/skills/__init__.py(126 lines βSkillclass and decorator)pandasai/helpers/skills_manager.py(84 lines βSkillsManagerclass)add_skills()from all agent classes- Related prompt template references and 338 lines of tests
v3 Agent & State β No Skill Hooks#
The v3 Agent and AgentState have no skills-related fields or extension points.
AgentState is a flat dataclass holding only:
dfsβ registered dataframesmemoryβ conversation historyvectorstoreβ optional RAG storeconfig,logger,output_type, prompt/code tracking fields
The Agent constructor accepts only dfs, config, memory_size, vectorstore, description, and sandbox. There is no skills parameter, no add_skills() method, and no hook for injecting custom callables into the code-generation prompt .
The only runtime extension point in v3 is the vectorstore (train()), which adds query/code pairs and documentation to a RAG store β a different mechanism than skill injection.
Implications for Extension#
Anyone needing agent extensibility in v3 must work around the missing API:
- Workaround (prompt-level): Pass descriptions of custom functions in
descriptionat agent construction time β these go into the system prompt viaMemory. - Workaround (RAG): Use
agent.train(docs=[...])to inject callable documentation into the vectorstore, which the code generator may surface at query time . - Workaround (sandbox): Provide a custom
Sandboxinstance pre-loaded with functions in its execution environment .
None of these are equivalent to the v2 add_skills lifecycle (add/remove at runtime, LLM-visible function signatures, usage tracking).
Reference Files#
| File | Role |
|---|---|
pandasai/agent/base.py | v3 Agent β no skill API |
pandasai/agent/state.py | v3 AgentState β no skills field |
docs/v2/skills.mdx | v2 skills documentation (historical) |