Skip to content

System extensions

This tutorial demonstrates how freeact agents can be customized through system extensions. These may include runbooks, constraints, domain-specific rules, or whatever you think is relevant for the agent's behavior. You'll see:

  • How to implement a human-in-the-loop workflow, enabling users to review and edit the agent's action plans
  • How to make the agent more proactive by configuring it to suggest 3 follow-up actions after each response
  • How to implement domain-specific rules (demonstrated by an example that multiplies temperatures by 3.17 in weather-related responses)

Note

System extensions are currently only supported for Claude models.

The example conversation below was guided by this system extension:

extension.txt
Your overall workflow instructions (= runbook):
- Start answering an initial user query
- In your final answer to the user query, additionally suggest 3 follow up actions the user can take
- Let the user choose one of the follow up actions or choose another action if none of the follow up actions are relevant
- After sharing your reasoning in <thinking> tags, you MUST ask the user for feedback.
  - do not generate and execute code yet at this point.
  - the user may either confirm your reasoning and let you proceed with generating code
  - or ask you to modify your reasoning and reasoning steps based on their feedback
- Repeat the overall workflow with the chosen follow up action

Domain-specific rules:
- If the initial query or a follow-up action is related to the weather in a given city, output the current temperature in the city multiplied by 3.17.

It was initiated with the following freeact.cli command, referencing the extension.txt file with the --system-extension option and reusing the developed weather.weather_report skill from the Skill development tutorial.

python -m freeact.cli \
  --model-name=claude-3-5-sonnet-20241022 \
  --ipybox-tag=ghcr.io/gradion-ai/ipybox:example \
  --executor-key=example \
  --skill-modules=freeact_skills.search.google.stream.api \
  --skill-modules=freeact_skills.zotero.api \
  --skill-modules=freeact_skills.reader.api \
  --skill-modules=weather.weather_report \
  --system-extension=extension.txt

Example conversation

output