Skip to main content

Text documents (SDK)

Embeds locally with BGE and uploads to a text store (768 dimensions):
resp = edge.upload_documents([
    {"id": "doc-1", "text": "Hello world"},
])
print(resp["total"], resp["store_mode"])

Precomputed vectors (SDK)

resp = edge.upload_vectors([
    {"id": "item-1", "vector": [...], "text": "Optional label"},
])
print(resp["total"], resp["dimension"])

Low-level upload (SDK)

resp = edge.upload_items(
    [{"id": "a", "vector": [...], "text": "..."}],
    store_mode="text",
    embedding_model="BAAI/bge-base-en-v1.5",
)

HTTP client

resp = client.upload({
    "store_mode": "vector",
    "items": [
        {"id": "item-1", "vector": [...]},
    ],
})

Quota errors

When the store is full, the server returns 409. Catch MoorchehEdgeApiError:
except MoorchehEdgeApiError as exc:
    if exc.is_item_limit_exceeded:
        print(exc.body)
See API: Upload.