# Agentset

> Open-source platform to build, evaluate and ship RAG apps

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/agentset-ai/agentset
- Website: https://agentset.ai
- Canonical page: https://ai-tldr.dev/tools/agentset/

## In short

Agentset is an open-source platform for building, evaluating and shipping production RAG and agentic applications. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in TypeScript and licensed MIT. To get started: clone the repo and configure the environment.

## Overview

Agentset is an open-source platform for building, evaluating and shipping production RAG and agentic applications. Instead of wiring a parser, a chunker, an embedding model, a vector store and a reranker together yourself, you upload documents into a namespace and query it through one API. The repository bundles the whole product — ingestion, vector indexing, evaluation benchmarks, a chat playground, hosting and a developer API — and is written in TypeScript on Next.js, the AI SDK, Prisma, Supabase and Trigger.dev.

The project runs as Agentset Cloud, a hosted service with a free tier, and as the MIT-licensed code in the repo for self-hosting. The docs describe three deployment options: fully hosted, bring-your-own-cloud (your object storage, vector database, LLM and reranker, with Agentset doing the processing) and on-premise for air-gapped or strict-compliance environments. Self-hosting relies on external services — Upstash, Trigger.dev, Supabase, Vercel and Cloudflare or AWS storage — and the docs list a fully offline version as a roadmap item.

The pipeline has three parts. Ingestion parses files (Marker by default, covering 22+ formats, with OCR for scanned pages) and chunks them along sentence and paragraph boundaries, with dedicated chunkers for tables, images and code. Storage keeps the original file and extracted text in object storage and the embeddings in a vector database, so both semantic and lexical search are possible. For question answering, retrieval is agentic: a model searches the namespace in a tool-calling loop, running semantic or keyword searches and expanding to neighbouring chunks when an answer is cut across chunk boundaries, then answers with inline citations.

## What it does

- Turnkey RAG pipeline: ingestion, chunking, embeddings and retrieval behind one API
- Model agnostic: bring your own choice of LLM, embedding model and vector database
- Agentic search that loops over semantic, keyword and expand steps, with inline citation pills in answers
- Chat and search playgrounds, a chunk viewer and built-in retrieval benchmarks
- Hosted chat page per namespace with custom domains and email or domain allowlists
- TypeScript and Python SDKs, an OpenAPI spec, an MCP server and built-in multi-tenancy

## Getting started

You can use Agentset Cloud through the SDK, or run the open-source app yourself. Self-hosting needs accounts with GitHub, Upstash, Trigger.dev, Supabase, Vercel and Cloudflare or AWS; the docs walk through each service step by step.

1. Clone the repo and configure the environment

   Copy `.env.example` to `.env` and fill in the required values: default vector database, reranker and model keys, plus the Trigger.dev secret, as described in the self-hosting guide.

```bash
git clone https://github.com/agentset-ai/agentset.git
cd agentset
cp .env.example .env
```

2. Install, migrate and run locally

   Run the migrations from the repo root, then start the web app. `bun db:studio` opens Prisma Studio if you want to inspect the database.

```bash
bun install
bun db:deploy
bun dev:web
```

3. Install the SDK

   To work against Agentset Cloud instead, sign up, create a namespace and generate a key under Settings → API Keys. The SDK ships for both TypeScript and Python.

```bash
npm install agentset
# or
pip install agentset
```

4. Upload a document

   Ingestion is asynchronous; the job id lets you check processing status.

```typescript
import { Agentset } from "agentset";

const agentset = new Agentset({
  apiKey: process.env.AGENTSET_API_KEY,
});

const ns = agentset.namespace("YOUR_NAMESPACE_ID");

const job = await ns.ingestion.create({
  name: "Attention Is All You Need",
  payload: {
    type: "FILE",
    fileUrl: "https://arxiv.org/pdf/1706.03762.pdf",
  },
});
```

5. Search the namespace

   Pass the returned chunks to any LLM as context, or connect an MCP client with `npx @agentset/mcp --ns <namespace-id>` and an `AGENTSET_API_KEY`.

```typescript
const results = await ns.search("What is multi-head attention?");

for (const result of results) {
  console.log(result.text);
}
```

## When to use it

- Add document Q&A with source citations to an app without building the parsing, chunking and reranking stack yourself
- Share a knowledge base with users as a hosted chat page on your own domain, restricted by email or domain
- Serve many customers from one deployment, keeping each tenant's documents separate
- Keep documents on your own storage and vector database while Agentset runs the processing, or self-host the whole thing
