Providing Resources to Other Modules
Learn how to define shared Tools, Workspaces, and Instructions in your Kit's `provide` section.
Providing Resources to Other Modules
A key feature of Genbase is the ability for Modules to collaborate by sharing resources. As a Kit developer, you define what your Kit is capable of sharing in the provide
section of your kit.yaml
. This allows Modules created from your Kit to grant specific capabilities or data access to other Modules. (See Provide Concept).
The provide
Section in kit.yaml
The optional top-level provide
key in kit.yaml
is where you declare the resources your Kit makes available for sharing.
Definable Resources
You can define the following under the provide
key:
-
tools
(Optional, List of Objects):- Declares Kit Tools that consuming Modules can invoke.
- The structure for each tool (
name
,path
,description
) is identical to defining tools withinprofiles
. - Crucially: When a consuming Module's Agent calls a provided tool, the tool code executes in an isolated Docker container using the Provider Module's environment variables, dependencies, and workspace context. Only the result is returned to the consuming Agent.
-
instructions
(Optional, List of Objects):- Declares Instruction Files that provide context about the shared resources.
- The structure (
name
,path
,description
) is identical to defining instructions withinprofiles
. - This information can be made available to the consuming Module's Agent to help it understand how to use the provided Tools or interpret the provided Workspace content.
-
workspace
(Optional, Object):- If this object exists (even if empty,
{}
), it signifies that Modules created from this Kit can share their entire Workspace. - When Module A provides its workspace to Module B, Module A's Git repository is added as a read-only Git submodule inside Module B's repository, typically at
/repo/workspaces/{module_a_id}/
. description
: (Optional, String) Briefly describes the purpose or content of the shared workspace.
- If this object exists (even if empty,
How Consumers Use Provided Resources
- Establishing the Link: A user or administrator must explicitly create the
ModuleProvide
link between two running Module instances using the Studio UI (Managing Provisions) or the API. Simply defining resources inprovide
doesn't automatically link modules. - Consuming Tools: Once Module A provides an Tool (e.g.,
lookup_user_id
) to Module B, that tool name becomes available as a potential tool call for Module B's Agent when it interacts with its Profiles. The Agent'sset_context
method (potentially viaIncludeOptions(provided_tools=True)
) can be configured to include these provided tools in the list of tools passed to the LLM. - Consuming Workspace: Once Module A provides its Workspace to Module B, any Tool executed by Module B can access the files within Module A's workspace by reading from the path
/repo/workspaces/{module_a_id}/...
inside its Docker execution container. - Consuming Instructions: Instructions defined in the
provide
section of Module A's Kit can be included in theprofile_data.instructions
list passed to Module B's Agent, providing context on how to use Module A's provided resources.
Design Considerations
- Only
provide
Tools and Instructions that make sense for external consumption. Keep internal helper functions private. - Ensure provided Tools have clear descriptions for the consuming LLM/Agent.
- Document the purpose and structure of a provided Workspace clearly in the
provide.workspace.description
or a README. - Remember that provided Tools execute within the Provider's context – they have access to the Provider's environment variables and workspace, not the Consumer's.
Defining resources in the provide
section is how you turn your Kit from a standalone capability into a collaborative component within the larger Genbase ecosystem.