bigRAG
API Reference

Vectors

API endpoints for direct vector operations.

For advanced use cases, you can directly manage vectors without going through the document ingestion pipeline. This is useful for custom embeddings or integrating with external embedding services.

Upsert Vectors

POST /v1/collections/{collection_name}/vectors/upsert

Insert or update vectors directly.

Request body:

{
  "vectors": [
    {
      "id": "custom_001",
      "embedding": [0.1, 0.2, 0.3],
      "text": "Custom text content",
      "metadata": { "source": "external" }
    }
  ]
}
FieldTypeRequiredDescription
vectorsarrayyesList of vector entries
vectors[].idstringyesUnique vector ID
vectors[].embeddingarray[float]yesMust match collection dimension
vectors[].textstringnoAssociated text content
vectors[].metadataobjectnoArbitrary metadata

Response 200:

{ "status": "ok", "upserted": 1 }

Errors:

  • 400 — Dimension mismatch, invalid vectors
  • 404 — Collection not found

Delete Vectors

POST /v1/collections/{collection_name}/vectors/delete

Delete vectors by their IDs.

Request body:

{ "ids": ["custom_001", "custom_002"] }

Response 200:

{ "status": "ok", "deleted": 2 }

Errors: 404 — Collection not found

Example: Custom Embeddings

# Upsert vectors with your own embeddings
curl -X POST http://localhost:6100/v1/collections/custom/vectors/upsert \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "vectors": [
      {
        "id": "vec_001",
        "embedding": [0.1, 0.2, 0.3],
        "text": "Custom content",
        "metadata": {"source": "external"}
      }
    ]
  }'

# Delete vectors
curl -X POST http://localhost:6100/v1/collections/custom/vectors/delete \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["vec_001"]}'

The embedding dimension must match the collection's configured dimension. A dimension mismatch will return a 400 error.

On this page