-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework Global architecture #226
Comments
one of the potential changes is about, if in some moment LLM and Memory can be considered as a Tool, and define a Memory architecture that cover the "short","middle","long_term", and functionalities behind. |
Discussion notes:
|
I would say that from very basic perspectivean Agent is a unit that can be run with an input and return an output everything else is "extra". Actually It should be an interface. classDiagram
class IAgent~TInput, TOutput~ {
<<interface>>
+boolean isRunning
+run(input TInput) TOutput
}
interface IAgent<TInput,TOutput> {
isRunning: boolean;
run(input: TInput): TOutput;
}
class ReproAgent implements IAgent<string, string> {
get isRunning() {
return false; // This wil be useful for long running tasks not here
}
run(input: string) {
return input;
}
}
const myReproAgent = new ReproAgent();
console.log(myReproAgent.run("Hello world!")); |
Next steps:
|
By considering both the LLM and Memory as tools within the agent architecture, we can maintain their original functions while achieving a more modular and flexible design. The LLM-as-a-tool approach encapsulates its capabilities behind a simple “function-like” interface, making it easy to swap models or adjust prompts. Similarly, treating Memory as a tool allows layering short-, medium-, and long-term storage for efficiently retrieving previously seen data. For example, when categorizing incoming issues that may arrive in various languages, the LLM tool can standardize them into a consistent category ID, while the Memory tool caches these mappings for repeated queries, reducing unnecessary LLM calls. This scenario illustrates how the LLM’s classification ability can be utilized without requiring full agentic behavior, and how both LLM and Memory tools can seamlessly fit into the original agent architecture. I’m happy to provide two prototype implementations: one using only the LLM tool, and another integrating the Memory tool for caching repeated patterns. Additionally, by selecting smaller, more specialized models for these tasks, we can improve overall efficiency and reduce the system’s carbon footprint. |
Proposal: We could consider introducing dependency injection as a way to make the agent’s architecture more modular and dynamically configurable. With dependency injection, an LLM could be leveraged not only to define prompts and tools, but also to generate a comprehensive configuration for an entire agent—covering which models to use, how Memory layers are structured, and what tools are available. By allowing a capable LLM (e.g., Claude 3.5 Sonnet) to produce a dependency injection configuration file based on a given goal, we can instantiate the complete agent directly from this configuration. This approach streamlines the setup process, enables rapid experimentation, and paves the way for easily swapping models or adjusting prompts, all while retaining flexibility to incorporate advanced patterns such as Memory-as-a-tool or LLM-as-a-tool. |
Another potentially valuable enhancement to consider—one that could be analyzed and validated during this architecture review—is enabling the system to generate new tools on-the-fly through code generation. Imagine a scenario where, during execution, the agent identifies a requirement for a tool that doesn’t yet exist. Instead of failing or halting, it could invoke code generation capabilities to create that missing tool dynamically. Such a generated tool would ideally have at least three core operations: a primary function to perform the desired task, a validation mechanism (akin to unit tests) to ensure that the generated code meets the intended specifications, and an input validation method to prevent runtime errors or unexpected behavior. While this feature would extend the agent’s flexibility and adaptability, it might be beyond the minimal “core” definition of the agent framework. Instead, it could be treated as an advanced module or extension, layered on top of the core agent architecture. This way, the foundational design remains simple and robust, while more sophisticated functionality—like on-demand tool generation—is available as an optional enhancement that teams can integrate when it makes strategic sense. |
Related ticket #254 |
Goal
Out of scope for the moment: changing the communication structure of an agent
Proposed Functional Architecture
The text was updated successfully, but these errors were encountered: