Document Collections

Document collections help you organize your data for efficient storage, retrieval, and semantic search.

Collection Overview

Collections in VectorForgeAI act as containers for your documents and their embeddings. Each collection can represent a dataset, knowledge base, or any logical grouping of information.

List All Collections

Retrieve all collections that belong to your account.

GET /collections

Request

cURL
curl -X GET https://api.vectorforgeai.com/v1/collections \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Team-Token: YOUR_TEAM_TOKEN"

Response

JSON
{
  "collections": [
    {
      "id": "abc123xyz456",
      "name": "Research Papers",
      "description": "Collection of AI research papers",
      "created_at": "2025-05-01T09:22:15.789Z",
      "updated_at": "2025-05-01T09:22:15.789Z",
      "chunk_overlap": 10.0
    },
    {
      "id": "def456uvw789",
      "name": "Technical Docs",
      "description": "Product technical documentation",
      "created_at": "2025-05-02T15:37:22.456Z",
      "updated_at": "2025-05-02T15:37:22.456Z",
      "chunk_overlap": 15.0
    }
  ]
}

Create a Collection

Create a new document collection to organize your data.

POST /collections

Request Parameters

Parameter Type Required Description
name string Yes Name of the collection (max 255 characters)
description string No Description of the collection (max 255 characters)
chunk_overlap number No Percentage of text overlap between chunks (0-100). Default: 17.0

Request

cURL
curl -X POST https://api.vectorforgeai.com/v1/collections \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Team-Token: YOUR_TEAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support Docs",
    "description": "Help articles for customer support",
    "chunk_overlap": 15.0
  }'

Response

JSON
{
  "collection": {
    "id": "ghi789lmn012",
    "name": "Customer Support Docs",
    "description": "Help articles for customer support",
    "created_at": "2025-05-10T08:15:30.123Z",
    "updated_at": "2025-05-10T08:15:30.123Z",
    "chunk_overlap": 15.0
  }
}

Delete a Collection

Permanently delete a collection and all its associated documents and embeddings.

DELETE /collections/{collection_id}

Path Parameters

Parameter Type Description
collection_id string ID of the collection to delete

⚠️ Warning

Deleting a collection permanently removes all its documents and vector embeddings. This action cannot be undone.

Request

cURL
curl -X DELETE https://api.vectorforgeai.com/v1/collections/ghi789lmn012 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Team-Token: YOUR_TEAM_TOKEN"

Response

JSON
{
  "message": "Collection deleted successfully."
}

💡 Optimizing Chunk Overlap

The chunk_overlap parameter determines how much text will overlap between chunks when a document is processed. Higher values (15-20%) can preserve more context but use more storage, while lower values save space but may lose contextual connections. For most use cases, 10-15% overlap is a good balance.

Working with Collections

Once you've created a collection, you can:

  • Add documents to the collection
  • Perform semantic searches across documents
  • Use the collection in LLM completions for knowledge-grounded responses

Next Steps

Now that you've created a collection, learn how to add documents to it:

Need Help?

If you're having trouble with collections or have questions, we're here to help!