Overview
While other frameworks have separate concepts for tools, state, and schemas, Agentica’s unique model unifies all of these into a single concept: Scope. After all, it’s just code. Agentica agents can operate via REPL and RPC, so they can directly access anything you pass to them. This includes:- Functions which replace the need for bespoke “tools”
- Variables which replace the need for explicit “state” objects
- Types which replace the need for special “schemas”
Types Replace Schemas
Instead of defining schemas in a special format, just pass your classes. The agent will instantiate them, and if your validation logic fails, the error is passed back to the agent to fix.Functions Replace Tools
Instead of wrapping functions in special tool definitions or separating the concept of functions and tools, just pass your functions directly.Variables Replace State
Instead of creating special state management objects or context managers, just pass your variables directly. Because Agentica passes by reference, you can include stateful objects like database connections and API clients that can’t be serialized.Summary: Why Scope
Scope matches how programming works. In any programming language, functions have scope—they can access variables, call other functions, and use types. Agentica’s magic functions and agents work the same way. If magic functions are just functions, they naturally have scope and we match that expectation. Everything is data. Because Agentica treats everything—functions, variables, types, even SDK clients—as data, you can pass anything to anything. This includes:- Passing functions to magic functions and visa-versa; typed function composition and hand-offs.
- Passing
Agentobjects to other agents (enabling dynamic multi-agent systems). - Passing SDK clients, database connections, or any object that is live in your codebase.