Arango logo

AutoGraph Embed Field in Collection

Add embeddings to documents in any ArangoDB collection

Embed field in collection

POST https://<EXTERNAL_ENDPOINT>:8529/autograph/v1/embed-field-in-collection

Add embeddings to documents in any ArangoDB collection you already have. This path is independent of import, corpus build, clustering, and the {project}_CorpusGraph named graph.

Recommended path: This endpoint works independently; no import or corpus build required. Call once per (collection, field) pair. Every call recomputes the candidates from the live data, so rows that were inserted after a previous successful run are embedded on the next call.

Request

{
  "collection": "products",
  "field": "description"
}

Parameters

ParameterTypeRequiredDescriptionRecommended value
collectionstringYesFully qualified logical name of an existing collection in the service database.Your business collection name (e.g. products, articles). Must match ArangoDB naming rules.
fieldstringYesDocument attribute to embed. The service appends _embedding automatically (e.g. description → description_embedding).A text-heavy attribute (description, body, content). Pass the source field name, not the embedding field.

Behavior

The service rescans the collection on every call and sorts the documents into three groups:

  • Candidates have a non-null source field and a missing or null <field>_embedding. An explicit null counts as not yet embedded. These are the documents that get embedded.
  • Skipped documents already have a non-null <field>_embedding and are left untouched.
  • Ineligible documents have no source value and no embedding. They are neither embedded nor counted as failed.

Source values may be string or numeric (coerced to text). Truncation follows the same rough character budget as corpus build. After a successful run, the service ensures a vector index on the embedding field and an ArangoSearch view on the source field when applicable.

Response

{
  "status": "completed",
  "message": "Embeddings generated for documents missing description_embedding.",
  "collection": "products",
  "field": "description",
  "embedding_field": "description_embedding",
  "documents_updated": 150,
  "documents_skipped": 20,
  "documents_examined": 175,
  "documents_failed": 2,
  "documents_ineligible": 3
}
FieldTypeDescription
statusstring"completed"
messagestringSummary; may mention documents that could not be embedded
collectionstringCollection name
fieldstringSource field
embedding_fieldstringName of the embedding attribute
documents_updatedintegerDocuments that received embeddings in this run
documents_skippedintegerDocuments that already had a non-null <field>_embedding (unchanged by this call)
documents_examinedintegerThe size of the collection. Reconcile it against your own store.
documents_failedintegerCandidates that could not be embedded, because of an empty value or an error
documents_ineligibleintegerDocuments with no source value and no embedding

The counts are expected to add up:

documents_examined == documents_updated + documents_skipped
                      + documents_failed + documents_ineligible

A gap is logged server-side at error level. The response still returns the counts, because the call does not abort mid-write only for a counter mismatch.

Status CodeMeaning
200Success
400Invalid collection or field
401Authentication failed
404Collection does not exist
500Server error

HTTP Example

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"collection": "products", "field": "description"}' \
  https://<EXTERNAL_ENDPOINT>:8529/autograph/v1/embed-field-in-collection

Next Steps

  • Corpus Build: Learn about automatic embedding generation during builds