Giter Club home page Giter Club logo

waggle-dance's Introduction

๐Ÿ๐Ÿ’ƒ waggledance.ai

License CI CodeQL

Join Discord Server GitHub Repo stars

๐ŸฆšFeatures | ๐Ÿ“Roadmap | ๐Ÿ› ๏ธContribute | ๐ŸƒRun Locally | ๐ŸŒบOpen Core

Quick Start

  • Cloud Preview Try the cloud preview โ†—
  • Join the Discord
  • โญ๏ธ Help with algorithm: star this repo

You can also build and deploy yourself! However, you must configure your environment.

waggledance.ai is an experimental application focused on achieving user-specified goals. It provides a friendly but opinionated user interface for building agent-based systems. The project focuses on explainability, observability, concurrent generation, and exploration. Currently in pre-alpha, the development philosophy prefers experimentation over stability as goal-solving and Agent systems are rapidly evolving.

waggledance.ai takes a goal and passes it to a Planner Agent which streams an execution graph for sub-tasks. Each sub-task is executed as concurrently as possible by Execution Agents. To reduce poor results and hallucinations, sub-results are reviewed by Criticism Agents. Eventually, the Human in the loop (you!) will be able to chat with individual Agents and provide course-corrections if needed.

It was originally inspired by Auto-GPT, and has concurrency features similar to those found in gpt-researcher. Therefore, core tenets of the project include speed, accuracy, observability, and simplicity. Additionally, many other agentic systems are written in Python, so this project acts as a small counter-balance, and is accessible to the large number of Javascript developers.

An (unstable) API is also available via tRPC as well an API implemented within Next.js. The client-side is mostly responsible for orchestrating and rendering the agent executions, while the API and server-side executes the agents and stores the results. This architecture is likely to be adjusted in the future.

bar

๐Ÿฆš Highlighted Features

  • LLMs go brrrโ€ฆ waggledance.ai starts by planning a highly concurrent execution graph. Some sub-task branches are not dependent, and can run concurrently.
  • Adversarial agents that review results.
  • Vector database for long-term memory.
  • Explainable results and responsive UI: Graph visualizer, sub-task (agent) results, agent logs and events.

๐Ÿฅž Tech Stack

Typescript ๏น’ Langchain.js ๏น’ T3 ๏น’ Prisma ๏น’ tRPC ๏น’ Weaviate ๏น’ Postgres ๏น’ OpenAI API ๏น’ MUI Joy

๐Ÿ“ Roadmap

Live Project Roadmap Board ๏น’ ๐Ÿ› ๏ธContribute

Basically, anything and everything goes! Though multi-agent systems have a long and storied past, this project is all about marrying the past techniques with the latest research.

๐Ÿ“ˆ Star History

Star History Chart

๐Ÿƒ Running Locally and Development

waggledance.ai can be deployed locally using Docker or manually using Node.js. Configuration of .env vars is required.

Docker

docker-compose up --build

Dependencies

  • Required: Node JS LTS โ‰ง v18.17.0 (LTS recommended)
  • pnpm is used in examples but npm or yarn may work as well.
  • Recommended: Turbo - pnpm add turbo --global or use pnpx turbo in place of turbo below.

โš™๏ธ Configure Your Environment

๐Ÿ˜ Setting up Postgres

Refer to .env.example and env-schema.mjs for the required environment variables. Currently only Postgres via Prisma is supported. You can use a local Postgres instance (it is recommended to use Docker) or a cloud provider such as Supabase.

Once you have set up, secured, and configured your Postgres, run the following commands:

pnpm db:generate
pnpm db:push
  • db:generate creates the local typings and DB info from the schema.prisma file (./packages/db/prisma/schema.prisma).
  • db:push pushes the schema to the database provider (PostgreSQL by default).
  • Run these commands on first install and whenever you make changes to the schema.

Run Development

turbo dev
# or
pnpm dev

This project was forked from create-t3-turbo To find out more, you can check the boilerplate documentation

๐Ÿฆ‘ Linting

Make sure you install the recommended extensions in the solution, particularly es-lint.

Linting is run on each build and can fail builds.

To get a full list of linting errors run:

turbo lint

Some of these may be able to be auto-fixed with:

turbo lint:fix

And the version that the CI runs:

SKIP_ENV_VALIDATION=true NODE_ENV=production  turbo build

For the rest, you will need to open the associated file and fix the errors yourself. Limit ts-ignore for extreme cases.

As a best practice, run turbo lint before starting a feature and after finishing a feature and fix any errors before sending a PR.

๐Ÿ› ๏ธ Contribute and help

  • Devs: CONTRIBUTING.md
  • Star the Project!
  • Join the Discord!
  • If you are not technical, you can still help improving documentation or add examples or share your user-stories with our community; any help or contribution is welcome!

Contributors

๐Ÿ“š Helpful Docs

๐Ÿค— Special Thanks

  • Maintainers and Contributors of LangChain.js
  • Maintainers and Contributors of AutoGPT, AgentGPT, SuperAGI, gpt-researcher, lemon-agent
  • E2B
  • Agent Protocol from AI Engineer Foundation
  • big-AGI
  • more...

๐ŸŒบ Open Core

The applications, packages, libraries, and the entire monorepo are freely available under the MIT license. The development process is open, and everyone is welcome to join. In the future, we may choose to develop extensions that are licensed for commercial use.

waggle-dance's People

Contributors

dependabot[bot] avatar jondwillis avatar ruheni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

waggle-dance's Issues

Convert Jon's notes to GH issues

Second chain-of-thought loop

after the DAG from plan->review completes, we have a list of tasks, as well as a review. we must start executing these tasks.

  • Consider changing the output of /plan API to a dependency graph.
  • Also, possibly every agent's output.
  • Concurrently, review of the plan must happen.
  • Stub out means for invalidating data and the progress from chains that fail review

docker

Currently docker support is a lie. Implement a repeatable docker build.

Persisted goal history / navigation

Currently, with the new persisted goal, it is easy to lose place in the app.

  • add a goal (or waggle? what's the right name for this?) history
  • add some UI affordance (like browser tabs) that hints at multiple goals being a thing.
  • show the goal title/summary in the tab or whatever UI (add a Title summary prompt like ChatGPT does for convos)

Goal enrichment/flow at startup.

Go through a few iterations that help make sure the goal is clear and the system is set up for success. This should happen before or around the same time as uploading documents.

BUG: overload error shown as success

Try another model?

client: success state,

message: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID ba26ecc19b891d51c802fd1bf379d34a in your message.) type: server_error param: null code: null

...server

@acme/nextjs:dev: handleChainError {
@acme/nextjs:dev: type: 'handleChainError',
@acme/nextjs:dev: err: 'message: That model is currently overloaded with other requests. You can retry\n' +
@acme/nextjs:dev: ' your request, or contact us through our help center at help.openai.com if the\n' +
@acme/nextjs:dev: ' error persists. (Please include the request ID\n' +
@acme/nextjs:dev: ' ba26ecc19b891d51c802fd1bf379d34a in your message.)\n' +
@acme/nextjs:dev: 'type: server_error\n' +
@acme/nextjs:dev: 'param: null\n' +
@acme/nextjs:dev: 'code: null\n'
@acme/nextjs:dev: }
@acme/nextjs:dev: createModel: gpt-3.5-turbo-16k

tool proxy: http proxy / client-side tools / wrapped tools

Cloud infrastructure is often blocked from web scraping/using a headless browser.

Implementation ideas:

  • We could introduce a new AgentPacket or Tool, requestClientExecution
  • alternatively, maybe we could make a WebSocket or WebRTC connection to the client to reduce latency or "punch a hole" through to their network to use as a http proxy

Memory

Current contenders:

  • upstash redis (vercel KV store)
  • vector

Visualizations

  • react-force-graph seems to be adequate for visualizing the DAG.
  • Consider making the visualization the primary feedback.
  • Add some kind of node-visualization when tapping/clicking. show state of that node chain I guess?
  • Tabs may not be the right interface for debugging/results/visualizing.
  • Optional: https://github.com/openai/shap-e come up with 3d visualizations for each task
  • Optional: Summary (memory.context) in GUI

OpenAI rate limits

Rate limits

OpenAI enforces rate limits on the requests you can make to the API. These are applied over requests-per-minute, tokens-per-minute, or in the case of image models, images-per-minute.

Learn more in the rate limits documentation, or reference the default rate limits for our models. Your organization's rate limits are listed below.

Better plan format

  • 1:
    • id: 0
      name: ๐Ÿ“š Research successful digital marketing startups
      act: Research
      context: ...
      successors: [1, c]
    • id: 1
      name: ๐Ÿ“š Study target audience and market trends
      act: Study
      context: ...
      successors: [c]
    • id: c
      name: ๐Ÿ” Review the research findings
      act: Review
      context: ...
  • 2:
    • id: 0
      name: ๐Ÿ“ Create business plan
      act: Create
      context: ...
      successors: [1, c]
    • id: 1
      name: ๐Ÿ“ Set up legal and financial structure
      act: Set up
      context: ...
      successors: [c]
    • id: c
      name: ๐Ÿ” Review the business plan and strategies
      act: Review
      context: ...

is less tokens and also shows relationships sooner than current format

Provisional Results

On /waggle-dance page:

The reason this is an x-large ticket, is because it requires potentially generating or interacting with a TON of possible outputs.

What is worth reporting? This is context-dependent, I think.
Should we focus on a few narrower use cases (like generating text files, committing to .git repositories?)

  • Add a UI for downloading or otherwise receiving the results, as the chains report in. Output will likely come from a central planning agent, or from significant sub-tasks.
  • Attach significant results to the waggle dance object in the model layer

Finish NextAuth

Previously, I was trying middleware, but buried in the docs is the fact that it doesn't work for database adapters (e.g. Prisma.)

use jwt or manually guard api and frontend without middleware

In the documents branch, I needed a user id for the upload buckets, so I figured out and started fixing this.

  • implement custom signin page
  • guard api and page routes as needed
  • offline-first/anon users/more graceful transition

Make min and max for env.mjs secrets realistic

some env vars are of known length.
we can catch a whole class of bugs with guarding for proper lengths.

placeholder/search for this:

    // Add `.min(1) on ID and SECRET if you want to make sure they're not empty
    DISCORD_ID: z.string(),
    DISCORD_SECRET: z.string(),

Fix Type Errors, Improve DX/README.md for VS Code

There are many type errors throughout the app.

  • Fix them lol. only in extreme cases disable rules.
  • Make sure ALL of the current and future contributors know how to auto-fix. I'm talking about me, Jon. I still don't get it lol. Write some docs!!!
  • Strongly encouraged: Add requirement to PRs (builds currently fail, can require stricter PR requirements and Vercel requirements)

use zod for structured tools

StructuredTool abstract base class can only be used for OpenAI function calling executors. Additionally, Tool can only be used for non-structured OpenAI executors.

This can be resolved by dynamically switching between the two abstract types, based on which executor is currently being used.
It could also be resolved by making (a) better executor(s) that can all use structured tools and automatically include schema.

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.