Demo • Use cases • Features • Docs • Discord • Tutorials • SDKs • Contributions
Superagent allows any developer to add powerful AI assistants to their applications. These assistants use large language models (LLM), retrieval augmented generation (RAG), and generative AI to help users.
Fully open-source. Backed by Y Combinator. Part of YC W24.
sdxl-4k.mp4
Superagent lets you build any AI application/microservice you want, including:
- Question/Answering over Documents (LLM Finetunes/Vectorstores).
- Chatbots.
- Co-pilots & AI assistants.
- Content generation.
- Data aggregation.
- Workflow automation agent.
- Memory
- Streaming
- Python and Typescript SDKs
- REST API
- API connectivity
- Vectorization
- Support for third-party vector stores (e.g Weaviate, Pinecone)
- Support for proprietary and open-source LLMs
- API concurrency support
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 setting this up on Supabase.
Setting up Supabase
Create a Supabase account and project.
We have separated the UI and API into two separate Supabase projects, which is recommended since the app runs on prisma
.
Supabase setup for Superagent UI project:
-
Run the migrations (checkout Superagent UI section for this)
supabase migration up (locally) supabase db push (cloud)
-
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();
-
Create a Supabase storage
-
Set storage permissions: Set the following policy for
storage.objects
Setting up Github OAuth in UI
-
Create a new Github OAuth app in your Github account
-
Copy the
CLIENT_ID
andCLIENT_SECRET
and paste them into the.env
variables in the Superagent UI project. -
Set the following callback URL
<YOUR_SUPABASE_URL>/auth/v1/callback
-
Navigate to your Supabase project you have created for Superagent UI and paste the
CLIENT_ID
andCLIENT_SECRET
NOTE: You can enable any provider using the steps above.
Superagent API
-
Navigate to
/libs/superagent
-
Rename the
env.example
to.env
and make sure you have all mandatory values set -
Create a virtual environment
virtualenv venv source venv/bin/activate
-
Install dependencies
poetry install
-
Run database migrations
poetry run prisma migrate dev
-
Start the server
uvicorn app.main:app --reload
Superagent UI
-
Navigate to
/libs/ui
-
Rename the
env.example
to.env
and make sure you have all mandatory values set -
Install the dependencies:
npm install
-
Run migrations:
supabase migrate up (local) supabase db push (cloud)
-
Run the development server
npm run dev
For full documentation, examples and setup guidelines, visit docs.superagent.sh
If you are planning to integrate Superagent into your stack, you can use one of the following SDKs:
- Python
- Typescript/Javascript
- Swift (Community)
Superagent is an open-source project, and contributions are welcome. If you want 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.
To see how to contribute, visit Contribution guidelines
To help with contributions, you can search, navigate, and understand Superagent's source code using Onboard AI's free tool LearnThisRepo. learnthisrepo.com/superagent