Freeact
General-purpose AI agent that acts via code actions through a unified execution interface.
Last verified:
What is Freeact?
freeact is a lightweight AI agent library that empowers language models to act as autonomous agents through executable code actions. Unlike traditional approaches where actions and tools are defined in JSON formats, freeact uses Python code as the common language for defining tool interfaces and executable code actions. This unified code-based approach enables agents to express their actions directly in code, providing a flexible and powerful method for solving complex, open-ended problems that require dynamic solution paths.
Key features include the ability to generate code actions in Python instead of function calls in JSON, execute actions in a sandboxed environment (ipybox), use any function or method from any Python package as tool definitions, store generated code actions as reusable skills in long-term memory, and support invocation and composition of MCP tools in code actions. Agents can dynamically install and utilize Python packages at runtime, learn from feedback, and compositionally build increasingly sophisticated capabilities from simpler actions.
freeact is designed for developers and researchers building AI agents who need flexible, code-based agent frameworks. It is particularly suitable for those working on complex tasks requiring dynamic solution paths, open-ended problem solving, and agents that can learn and improve from past experiences. The library supports any LLM from any provider via LiteLLM, making it accessible for various AI development use cases including research, prototyping, and production agent systems.
Freeact pricing
Pricing model: Freemium
freeact is open-source software released under the Apache-2.0 license and is completely free to use. It can be installed via pip with 'pip install freeact'. The library itself has no subscription fees or paid plans. However, users need to provide their own API keys for language models (Anthropic/Claude and/or Google/Gemini API keys), which are billed separately by those providers according to their pricing. The ipybox execution environment uses Docker containers that can be deployed locally at no additional cost or run using the provided container images.
Freeact pros
- Uses Python code instead of JSON for tool definitions and actions
- Agents can reuse code actions as skills in later steps
- Supports any LLM from any provider via LiteLLM
- Executes in secure ipybox sandbox (Docker + IPython)
- Can dynamically install Python packages at runtime
- Any Python package function can be used as tool definition
- Stores successful code actions as reusable skills in memory
- Supports MCP tool invocation and composition
- Agents learn from environmental feedback and human guidance
- Interactive skill development with agent as coding assistant
- Zero-shot prompting achieves competitive evaluation results
- Supports both local and remote sandbox deployment
- Streaming from both model responses and execution environment
- No special interface required for skills - any Python module works
- Lightweight and simple installation via pip
- CLI support for quick agent launching
- Apache-2.0 open source license
Freeact cons
- Requires API keys for Anthropic and/or Gemini
- Needs Docker installed for ipybox execution environment
- Limited evaluation data compared to established frameworks
- Relatively new project with smaller community
- Requires Python knowledge to use effectively
- Sandboxed execution may have performance overhead
- Dependencies on external services (LiteLLM, API providers)
- Limited documentation compared to mature frameworks
Frequently asked questions about Freeact
What is freeact?
freeact is a lightweight AI agent library that uses Python code for defining tool interfaces and executable code actions. Unlike traditional approaches where actions and tools are defined in JSON, freeact enables language models to act as autonomous agents through executable code actions in Python, providing flexibility for solving complex, open-ended problems.
How do I install freeact?
Install freeact using pip with the command 'pip install freeact'. After installation, create a .env file with your Anthropic API key (for Claude) and/or Google API key (for Gemini), then you can launch an agent using the CLI or a Python script.
What models does freeact support?
freeact supports usage of any LLM from any provider as a code action model via LiteLLM. This includes Claude 3.5 Sonnet, Claude 3.5 Haiku, Gemini 2.0 Flash, Qwen 2.5 Coder 32B Instruct, DeepSeek V3, DeepSeek R1, and any other model supported by LiteLLM.
What is ipybox?
ipybox is a secure execution environment built on IPython and Docker where freeact executes all code actions. It can be deployed locally or remotely and provides sandboxed code execution while giving agents access to the full Python ecosystem.
How are skills different from tools in freeact?
freeact uses the term 'skills' instead of 'tools' to convey their greater generality. Skills are code actions generated at one step that can be reused as tools in later steps. Unlike traditional frameworks, skills can be any Python module or package without requiring a specific interface implementation.
Can freeact agents improve over time?
Yes, freeact agents can autonomously improve their actions through learning from environmental feedback, execution results, and human guidance. They can store successful code actions as reusable skills in long-term memory and compose these skills to build increasingly sophisticated capabilities.
How do I launch a freeact agent with the CLI?
Use the command: 'python -m freeact.cli --model-name=anthropic/claude-3-5-sonnet-20241022 --ipybox-tag=ghcr.io/gradion-ai/ipybox:basic --skill-modules=freeact_skills.search.google.stream.api'. You can also use uvx: 'uvx freeact --ipybox-tag=ghcr.io/gradion-ai/ipybox:basic --model-name=anthropic/claude-3-7-sonnet-20250219'
Does freeact support MCP tools?
Yes, freeact supports invocation and composition of MCP (Model Context Protocol) tools in code actions. You can add MCP server data to an mcp.json file and pass it to the CLI using the --mcp-servers parameter.
What is the license for freeact?
freeact is released under the Apache-2.0 open source license, making it free to use, modify, and distribute for both personal and commercial projects.
How does freeact compare to smolagents?
freeact is similar to smolagents in its focus on code-actions, agency level, and lightweight scaffold. However, freeact additionally supports interactive development and refinement of skills with the agent as a skill coding assistant, doesn't require skills to implement a certain interface, and achieves competitive results using zero-shot prompting while smolagents uses few-shot prompting.