Globe Agent Frameworks
The Globe Agent Frameworks repository represents a curated collection of techniques related to Large Language Model (LLM) prompting and programming that have proven incredibly valuable through empirical testing. Unlike complex programming libraries, which often emphasize feature richness and abstraction over practical functionality, this collection aims to provide straightforward, minimal code examples that are both comprehensible and directly applicable.
Purpose and Philosophy
The primary motivation behind this project is to address the growing complexity in open source LLM agent programming frameworks. These frameworks tend to be overly complicated and abstract, often leading to challenges in optimizing them for specific use cases. Therefore, Globe Agent Frameworks is not intended to be a library that you can simply install and use out-of-the-box. Instead, it offers distilled ideas and ready-to-use code examples showcasing effective concepts in agent programming. This initiative encourages users to fork and copy-paste both code and conceptual ideas to suit their projects.
For those who find this work interesting or beneficial, there's an open invitation to interact with the creators, @ivan_yevenko and @sincethestudy, on Twitter. Additionally, users can join the project's vibrant Discord community. Here, they can exchange ideas and join AI agent hackathons, offering a platform for further growth and collaboration.
Key Components
Reasoners
Within the reasoners/
directory, the project explores innovative concepts such as internal monologue, objective-oriented programming, and structured outputs. This aspect allows the writing of intelligent code capable of setting objectives, planning tasks, executing steps, and evaluating objectives towards completion. For example:
reasoner.set_objective("do some task")
while not reasoner.objective_complete:
thought = reasoner.internal_monlogue("I need to come up with a plan")
plan = reasoner.extract_info("Here is my plan written in list form:\n{plan}", List[str])
for step in plan:
execute_step(step)
reasoner.evaluate_objective()
Context Management
In the realm of LLMs, managing context is critical. Examples of advanced context management strategies can be found in the context_management/
folder. This includes the effective use of context and memory management practices to handle data dynamically, such as dates or user-specific information:
context = Context()
memory_manager = MemoryManager(context)
memory_manager.add_memory("date", lambda: datetime.datetime.now().strftime("%B %d, %Y"))
memory_manager.add_memory("user's birthday", "January 1st")
memory_manager.add_memory("gift recommendations", "A, B, C, D...")
with context.branch():
memory_manager.load_memories("date", "user's birthday", "gift recommendations")
plan = plan_birthday()
Code Generation
Code generation is evolving into a crucial component of programming with LLMs. The code_gen/
directory features initial examples of function generation, with a commitment to expand upon this capability continually. Code generation showcases how LLMs can facilitate new ways of function calling, adding significant value to programming practices.
Conclusion
In summary, Globe Agent Frameworks serves as a practical resource and learning tool for those engaged in LLM agent programming. By providing meaningful, stripped-down examples, it empowers developers to harness the full potential of LLMs in a manageable and effective manner. Through shared ideas and community involvement, it seeks to innovate and propel the field of AI agent programming forward.