Skip to content

Skills

Skills extend agent capabilities with custom logic. There are three skill types:

Return text content when called by the agent. Useful for injecting domain knowledge, templates, or instructions.

Example: A “greeting_policy” prompt skill that returns your company’s greeting guidelines.

Call an external HTTP endpoint when invoked. The endpoint receives the skill name, arguments, and context, and returns a JSON response the agent can use.

Example: A “check_inventory” webhook skill that calls your inventory API.

Execute custom JavaScript code in the agent’s sandbox. Module skills are registered as callable functions that the agent invokes during its reasoning loop.

Your code runs as a function body with args as the input parameter. All sandbox primitives are available:

  • search(query, topK?, storeID?) — Semantic search
  • fetch(url, opts?) — HTTP requests (whitelist enforced)
  • remember(key, value) / recall(key) / memories() — Session memory
  • listStores() / getDocument(id) — Document access
  • log(message) — Console output
  • data — Persistent object across calls

A skill named summarize_search with this code:

var results = search(args.query, args.top_k || 3);
if (results.length === 0) {
return "No results found for: " + args.query;
}
var summaries = results.map(function(r) {
return "- " + r.content.substring(0, 200);
});
return "Found " + results.length + " results:\n" + summaries.join("\n");

The agent calls it via think: summarize_search({query: "refund policy", top_k: 5})

  1. Go to Space Config > Skills
  2. Click New Skill
  3. Select type JavaScript Module
  4. Enter a name (must be a valid JS identifier, e.g. fetch_weather)
  5. Write your code in the editor
  6. Click Validate to check for syntax errors
  7. Click Create
  • ES5.1 only — The Goja runtime supports ES5.1 JavaScript (no arrow functions, no let/const, no template literals)
  • 30-second timeout — Long-running code is terminated
  • No direct network access — Use the fetch() primitive (whitelist enforced)
  • No filesystem access — The sandbox is isolated
client.CreateSkill(ctx, sdk.CreateSkillInput{
Name: "summarize_search",
Description: "Search and summarize results",
Type: "module",
Prompt: `var results = search(args.query, 3); return results.map(function(r) { return r.content; }).join("\n");`,
})