Skip to main content
POST
/
v1
/
namespace
TypeScript
import { Agentset } from "agentset";

const agentset = new Agentset({ apiKey: 'agentset_xxx' });

const namespace = await agentset.namespaces.create({
  name: "My Knowledge Base",
  slug: "my-knowledge-base",
  // embeddingConfig: {...},
  // vectorStoreConfig: {...},
});
console.log(namespace);
{
  "success": true,
  "data": {
    "id": "<string>",
    "name": "<string>",
    "slug": "<string>",
    "organizationId": "<string>",
    "createdAt": "<string>",
    "embeddingConfig": {
      "provider": "<string>",
      "model": "text-embedding-3-small",
      "apiKey": "<string>"
    },
    "vectorStoreConfig": {
      "provider": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
name
string
required
Required string length: 1 - 64
slug
string
required
Required string length: 2 - 48
embeddingConfig
object

The embedding model config. If not provided, our managed embedding model will be used. Note: You can't change the embedding model config after the namespace is created.

  • OpenAI Embedding Config
  • Azure Embedding Config
  • Voyage Embedding Config
  • Google Embedding Config
  • Option 5
vectorStoreConfig
object

The vector store config. If not provided, our MANAGED_PINECONE vector store will be used. Note: You can't change the vector store config after the namespace is created.

  • Option 1
  • Option 2
  • Pinecone Config
  • Turbopuffer Config

Response

The created namespace

success
boolean
required
data
object
required
I