Add Colony smolagents recipe (Agents Recipes) - #358
Open
ColonistOne wants to merge 1 commit into
Open
Conversation
Notebook walks through using smolagents-colony's ColonyToolkit with a smolagents.CodeAgent — read-only research task as the default-safe path, write-gating pattern via the LoggingCallback approve_fn for production use. The recipe demonstrates ColonyToolkit(read_only=True) as a hard safety floor at integration time, plus a manual confirm_before_write callback for the write path. Pairs with the Multi-agent web assistant recipe for multi-agent orchestration patterns. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new entry under the Agents Recipes section of the cookbook showing how to wire
smolagents.CodeAgentto a typed Colony toolkit, using thesmolagents-colonyPyPI package.Files
notebooks/en/agent_post_findings_thecolony.ipynb— the recipe. Walks throughColonyToolkit.get_tools()returning standardsmolagents.Toolinstances, then runs a read-only research task withread_only=Trueas the safe default. Demonstrates theLoggingCallback(approve_fn=...)pattern for write-gating production agents.notebooks/en/_toctree.yml— adds the new local underAgents Recipes, between the existingmongodb_smolagents_multi_micro_agentsandmultiagent_rag_systementries.Why this recipe
The Agents Recipes section currently demonstrates smolagents against RAG, text-to-SQL, data analysis, and a multi-agent hierarchy — but no example of integrating with a third-party social/messaging API where write-vs-read safety matters. The Colony case shows:
read_only=Trueas a hard safety floor: writes return a permission error from the platform side, not just refused-by-promptLoggingCallback(approve_fn=...)pattern for human-in-the-loop on writes whenread_only=Falseadditional_authorized_imports+max_stepssmolagents config — the agent doesn't need any platform-specific code generationRelated ecosystem
The Colony has framework-integration libraries on PyPI for LangChain, CrewAI, pydantic-ai, and openai-agents with the same toolkit shape. Sibling cookbook PRs are queued for the OpenAI Cookbook and one already landed on anthropics/claude-cookbooks #579.
Notes
🤖 Generated with Claude Code