Demo: Skill Learning
What you'll see
You run a goal. AI Partner solves it by generating and executing code. After the goal succeeds, it automatically extracts a reusable skill from the solution. The next time you ask for anything similar, it matches the skill, runs the saved code directly, and completes in seconds instead of 60–90 seconds — no LLM generation needed.
Prerequisites
- AI Partner running
- Any LLM provider configured
Part 1: First run (generates and learns)
Type this goal:
Get the current stock price for RELIANCE.NS from Yahoo Finance.
Format the result as: "RELIANCE.NS: ₹{price} ({change}%)"
and print it to the chat.
What happens:
✅ Decomposing goal...
✅ SkillLearner: checking skill library... no match found
✅ ReAct iteration 1: web_fetch Yahoo Finance page for RELIANCE.NS
✅ ReAct iteration 2: execute_python (extract price from HTML)
→ Output: "RELIANCE.NS: ₹2,847.50 (+0.8%)"
✅ Goal validator: success criteria met
✅ SkillLearner: saving skill "fetch_stock_price" (v1)
Total time: ~45 seconds
Result in the Learned Skills panel (sidebar → Learned Skills):
Skill: fetch_stock_price
Version: v1
Keywords: stock price, Yahoo Finance, NSE, ticker
Runtime: Python
Successes: 1
Source: auto-learned (goal_exec_xyz123)
Part 2: Second run (uses the skill directly)
Type this:
What's the current price of INFY.NS?
What happens:
✅ SkillLearner: match found → "fetch_stock_price" (similarity: 0.94)
✅ Executing saved skill with TICKER=INFY.NS
→ Output: "INFY.NS: ₹1,634.20 (-0.2%)"
✅ Done
Total time: ~4 seconds (no web search decomposition, no LLM generation)
The skill is a parameterized template. The executor substitutes {{TICKER}} automatically based on your goal.
Viewing and managing skills
Go to sidebar → Learned Skills to see all saved skills:
┌─────────────────────────────────────────────────────────────────┐
│ Learned Skills [+ New] │
├─────────────────────────────────────────────────────────────────┤
│ fetch_stock_price Python v1 ⭐ 8 successes auto-learned │
│ competitor_research Python v2 ⭐ 5 successes auto-learned │
│ github_trending Python v1 ⭐ 3 successes auto-learned │
│ weekly_summary_email Python v1 ⭐ 1 success manual │
└─────────────────────────────────────────────────────────────────┘
Click any skill to see:
- The stored script template (with
{{PLACEHOLDER}}variables) - The keyword/embedding match pattern
- Version history (v1, v2, ...)
- Success rate over the last 30 days
Creating a skill manually (before running any goal)
You don't have to wait for a successful run. You can write skills in advance and they'll be matched immediately.
Go to Learned Skills → + New Skill:
Name: daily_portfolio_check
Keywords: portfolio, stock prices, watchlist, my stocks
Runtime: Python
Tags: finance, stocks, monitoring
Script:
import yfinance as yf
import os
tickers = os.environ.get('TICKERS', 'RELIANCE.NS,INFY.NS,TCS.NS').split(',')
for ticker in tickers:
stock = yf.Ticker(ticker)
info = stock.fast_info
print(f"{ticker}: ₹{info.last_price:.2f} ({info.day_change_percent:+.1f}%)")
Save it. The next time you ask "check my portfolio stocks", this script runs directly — no generation step.
Manual skills are labelled with a "manual" badge in the skills panel to distinguish them from auto-learned ones.
Skill promotion to MCP tools
When a skill reaches 5+ successful uses with an 80%+ success rate, it gets promoted to a first-class MCP tool:
✅ Skill "fetch_stock_price" promoted to MCP tool
Tool name: fetch_stock_price
Now available in Tool Marketplace → Learned Skills
Once promoted, the agent can call it as a tool during any reasoning step — not just as a matched script. It becomes part of the agent's permanent toolkit.
How skill matching works
When a new goal arrives:
Goal: "What's the HDFC Bank share price today?"
↓
SkillLearner.findMatch(goal):
1. Keyword check: ["HDFC", "share price", "today"]
→ matches "fetch_stock_price" keywords: ["stock price", "Yahoo Finance", "ticker"]
→ keyword score: 0.72
2. Embedding similarity: embed(goal) vs embed(skill description)
→ semantic score: 0.91
Combined score: 0.87 → above threshold (0.75)
→ Use skill "fetch_stock_price"
If the combined score is below threshold, the skill is skipped and the full ReAct loop runs to generate a fresh solution — which may then produce a new, better skill.
Skill versioning
When the agent generates a solution that performs better than the current skill (higher success rate), it saves it as a new version:
fetch_stock_price v1: 6/10 successes (60%) — superseded
fetch_stock_price v2: 19/20 successes (95%) — current
Old versions are kept for audit/rollback but the current version is always used for matching.
Variations to try
Run these goals in sequence and watch the skill library grow:
1. "Get the top 10 trending Python GitHub repos today"
2. "What are the trending JavaScript repos on GitHub?"
3. "List the trending Go repositories on GitHub this week"
After goal 1, a skill is saved for GitHub trending. Goals 2 and 3 use it directly (with LANGUAGE=JavaScript and LANGUAGE=Go substituted). By goal 3, the skill has 3 successes and is well on its way to MCP promotion.