Menu

Knowledge

2 endpoints in the Mattering Agents API. Service tier only.

POST knowledge/embed/ Service tier

Embed up to 256 texts (``data.vectors``) on the configured embedding model; metered as AI credits.

URL

  • Service tierhttps://agents.mattering.io/api/internal/v1/knowledge/embed/

Body keys (JSON)

KeyRequiredDefault
dimensionsoptional or conditionalnone
modeloptional or conditionalnone
purposeoptional or conditionalnone
reference_idoptional or conditionalnone
textsoptional or conditionalnone

Keys the view reads. A key not in this list is ignored by the view. Where a key is required only for some actions (for example the action dispatch), the description above says which.

Responses

200 data and meta envelope

{
  "data": {
    "vectors": "...",
    "model": "...",
    "dimensions": "...",
    "tokens": "...",
    "tokens_estimated": true,
    "cost_cents": 0.0,
    "provider": "..."
  }
}

Field names come from the code; values are placeholders (... is a string, 0 a number, dates are ISO 8601).

Errors

StatusCode
400texts_required
400too_many_texts
400unknown_model_price
502embeddings_failed
503embeddings_unavailable

Example

curl -X POST "https://agents.mattering.io/api/internal/v1/knowledge/embed/" \
  -H "X-Internal-Secret: $MATTERING_INTERNAL_API_SECRET" \
  -H "X-Internal-Org-Id: $ORG_ID" \
  -H "X-Internal-User-Email: you@example.com" \
  -H "Content-Type: application/json" \
  -d '{
  "dimensions": "...",
  "model": "...",
  "purpose": "...",
  "reference_id": "...",
  "texts": "..."
}'

Source: MatterCore/knowledge_api.py (knowledge_api.knowledge_embed)

POST knowledge/summarize/ Service tier

A 120 to 250 word summary of a file's text (``data.summary``) from the reading worker; metered as AI credits.

URL

  • Service tierhttps://agents.mattering.io/api/internal/v1/knowledge/summarize/

Body keys (JSON)

KeyRequiredDefault
kindoptional or conditionalnone
reference_idoptional or conditionalnone
textoptional or conditionalnone
titleoptional or conditionalnone

Keys the view reads. A key not in this list is ignored by the view. Where a key is required only for some actions (for example the action dispatch), the description above says which.

Responses

200 data and meta envelope

{
  "data": {
    "summary": "...",
    "model": "...",
    "cost_cents": "...",
    "tokens_in": "...",
    "tokens_out": "..."
  }
}

Field names come from the code; values are placeholders (... is a string, 0 a number, dates are ISO 8601).

Errors

StatusCode
400text_required
503summary_unavailable

Example

curl -X POST "https://agents.mattering.io/api/internal/v1/knowledge/summarize/" \
  -H "X-Internal-Secret: $MATTERING_INTERNAL_API_SECRET" \
  -H "X-Internal-Org-Id: $ORG_ID" \
  -H "X-Internal-User-Email: you@example.com" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "...",
  "reference_id": "...",
  "text": "...",
  "title": "..."
}'

Source: MatterCore/knowledge_api.py (knowledge_api.knowledge_summarize)

All Agents resources
Start Free Explore our Products