Query memory and return formatted context for LLM prompt injection

post/api/v1/{context_id}/context

Path parameters

context_idstring required

Spectron context id

Request body

kinteger

Max hits to return (default 10, max 50).

labelsstring[]

Label filter (design §4): key=value strings the result rows must all carry; applied after the scope predicate (never widening).

querystring required
scopeViewstring nullable

Scope read breadth: strict (default) | merged | crossTeam (§7.1).

Response

contextstring required
queryMsinteger required
tier'direct' | 'cache' | 'hybrid' | 'escalated' required

Which tier resolved the query. Exposed on the response for the CLI's --tier flag (Phase 8) and so callers can tell when their query went all the way to tier 4.

Changes

Changed in 4 of the 5 revisions of this API.256

  • 9f159871306712See the full diff
    • added the new escalated enum value to the tier response property for the response status 200

      response-property-enum-value-added

    • added the non-success response with the status 503

      response-non-success-status-added

    • removed the full_context enum value from the tier response property for the response status 200

      response-property-enum-value-removed

    • added the new cache enum value to the tier response property for the response status 200

      response-property-enum-value-added

    • added the new direct enum value to the tier response property for the response status 200

      response-property-enum-value-added

    • added the new full_context enum value to the tier response property for the response status 200

      response-property-enum-value-added

    • added the new hybrid enum value to the tier response property for the response status 200

      response-property-enum-value-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the lens/items/ request property type/format changed from string/ to array/

      request-property-type-changed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the lens/items/ request property type/format changed from array/ to string/

      request-property-type-changed

    • removed the cache enum value from the tier response property for the response status 200

      response-property-enum-value-removed

    • removed the direct enum value from the tier response property for the response status 200

      response-property-enum-value-removed

    • removed the full_context enum value from the tier response property for the response status 200

      response-property-enum-value-removed

    • removed the hybrid enum value from the tier response property for the response status 200

      response-property-enum-value-removed

    This revision also has 15 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog