/superagent

🥷 Superagent - The agent framework for large language models

Primary LanguageJavaScriptMIT LicenseMIT

Superagent 🥷

The agent framework for large language models

GitHub Contributors GitHub Last Commit GitHub Issues GitHub Pull Requests Github License Discord

🧐 Superagent

Superagent is an open source agent framework that enables any developer to integrate production ready AI Agents in their applications in a matter of minutes.

🎥 Demo

demo.mp4

✨ Use cases

Superagent allows you to build any AI application/micro service you want, including:

  • Question/Answering over Documents (LLM Finetuns/Vectorstores)
  • Chatbots
  • Co-pilots & AI assistants
  • Content generation
  • Data aggregation
  • Workflow automation

👀 Features

  • Memory
  • Streaming
  • Custom finetuning 🆕
  • Python/Typescript SDKs
  • REST API
  • API connectivity
  • Vectorization
  • Support for proprietory and OSS LLMs
  • API concurrency

📋 Documentation

For full documentation, visit docs.superagent.sh

To see how to contribute, visit Contribution guidelines

🛠️ Getting started

Clone the Superagent repository into a public GitHub repository or fork it from https://github.com/homanp/superagent/fork.

If you plan to distribute the code, keep the source code public.

Both the API and UI require a database in order to work. We recommend settings this up on Supabase.

Setting up Supabase
  1. Create a Supabase account and project

  2. Run the following query to setup authentication:

    -- inserts a row into public.profiles
    create function public.handle_new_user()
    returns trigger
    language plpgsql
    security definer set search_path = public
    as $$
    begin
    insert into public.profiles (user_id)
    values (new.id);
    return new;
    end;
    $$;
    
    -- trigger the function every time a user is created
    create trigger on_auth_user_created
    after insert on auth.users
    for each row execute procedure public.handle_new_user();
  3. Create a Supabase storage

  4. Set storate permissions: Set the following policy for storage.objects Screenshot 2023-09-14 at 23 27 35

Superagent API
  1. Navigate to /libs/superagent

  2. Rename the env.example to .env and make sure you have all mandatory values set

  3. Create a virtual environment

    virtualenv venv
    source venv/bin/activate
  4. Install dependencies

    poetry install
  5. Run database migrations

    poetry run prisma migrate dev
  6. Start the server

    uvicorn app.main:app --reload
Superagent UI
  1. Navigate to /libs/ui

  2. Rename the env.example to .env and make sure you have all mandatory values set

  3. Install the dependencies:

    npm install
  4. Run migrations:

    supabase migrate up (local)
    supabase db push (cloud)
  5. Run the development server

    npm run dev
    
Superagent legacy

Please refer to the README in /libs/legacy for further instructions.

🫶 Contributions

Superagent is an open-source project, and contributions are welcome. If you would like to contribute, you can create new features, fix bugs, or improve the infrastructure. Please refer to the CONTRIBUTING.md file in the repository for more information on how to contribute

⭐ Acknowledgements

We want to give a big shout out to following open source projects, without which Superagent wouldn't be possible.