GithubHelp home page GithubHelp logo

agents's Introduction

Globe Agent Frameworks

This repo is a collection of useful LLM prompting/programming techniques that we've empirically found to be very useful. All the examples use the OpenAI ChatGPT API using a custom wrapper that you can install with:

pip install chatgpt-wrapper

RANT:

We made this because open source LLM agent programming frameworks are becoming absurdly complicated and over-abstracted. Libraries seem to be designed with virality as the primary objective rather than functionality, so they are extremely feature dense and bloated. They are so abstracted away from the actual prompts being sent to LLMs that you can't possibly optimize for your usecase.


This repo is NOT a library in the sense that you can install it and use it via an API. Instead, we distill the most useful ideas we've found into minimal reproducable code examples that showcase useful concepts in the space of agent programming.

The goal is to encourage forking and copy-pasting of both code and ideas.

If you find this code useful or interesting, tag @ivan_yevenko and/or @sincethestudy on twitter and share your agent code. You should also join our discord to share what you're working on. We run AI agent hackathons like this one and discord is the best way to find out about them.

Reasoners

In the reasoners/ folder, we introduce the concepts of internal monologue, objective-oriented programming and structured outputs. It lets us write code that looks like this:

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

The context_management/ folder shows some examples of more advanced context management for LLMs

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 the new function calling. Check out the code_gen/ folder for an example of function generation. We'll be adding to this folder over time.


made by Ivan Yevenko

agents's People

Contributors

iyevenko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.