Configure ingestion
Ingestion configuration is optional. If omitted, Jockey uses the default extraction. Configure ingestion when you know what to extract. The platform then prioritizes that information during indexing, instead of the general-purpose default.
Choose the approach that fits your use case:
- Default (no configuration): No setup required. Use it for getting started or quick prototyping.
- Natural language description: Describe what to extract in plain language. Use it when you know the domain but not the exact fields.
- JSON Schema: Define the exact fields and types to extract. Use it when downstream code expects specific typed fields.
Natural language description
Use this approach for exploratory work when you don’t yet know the exact fields you need.
Example
The following example focuses extraction on brand mentions, product appearances, audience reactions, and visual tone. Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Python
Node.js
To configure ingestion with a natural-language description, pass an ingestion_config to the knowledge_stores.create method.
Parameters:
ingestion_config: An object that configures what the platform extracts during indexing. It contains anenrichment_configobject with the following properties:type: The enrichment type. Set to"description".description: Natural-language instructions that guide extraction. The platform converts your description into a JSON Schema. When you retrieve the knowledge store, the platform returns anenrichment_configobject with thetypefield set to thejson_schemavalue. Thejson_schemafield of that object contains the JSON Schema.
Return value: An object of type KnowledgeStore with a field named id representing the unique identifier of the newly created knowledge store.
To configure ingestion with a natural-language description, pass an ingestionConfig to the knowledgeStores.create method. You pass all parameters as properties of a single object.
Parameters:
ingestionConfig: An object that configures what the platform extracts during indexing. It contains anenrichmentConfigobject with the following properties:type: The enrichment type. Set to"description".description: Natural-language instructions that guide extraction. The platform converts your description into a JSON Schema. When you retrieve the knowledge store, the platform returns anenrichmentConfigobject with thetypefield set to thejson_schemavalue. ThejsonSchemafield of that object contains the JSON Schema.
Return value: An HttpResponsePromise that resolves to an object of type KnowledgeStore with a field named id representing the unique identifier of the newly created knowledge store.
JSON Schema
Use this approach when downstream code expects specific typed fields.
Example
The following example extracts metadata about people, locations, and activities from each video shot. Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Python
Node.js
To configure ingestion with a JSON Schema, pass an ingestion_config to the knowledge_stores.create method.
Parameters:
ingestion_config: An object that configures what the platform extracts during indexing. It contains anenrichment_configobject with the following properties:type: The enrichment type. Set to"json_schema".json_schema: A JSON Schema (draft 2020-12). The roottypekeyword must be"object". See the JSON Schema keywords section for the accepted keywords.
Return value: An object of type KnowledgeStore with a field named id representing the unique identifier of the newly created knowledge store.
To configure ingestion with a JSON Schema, pass an ingestionConfig to the knowledgeStores.create method. You pass all parameters as properties of a single object.
Parameters:
ingestionConfig: An object that configures what the platform extracts during indexing. It contains anenrichmentConfigobject with the following properties:type: The enrichment type. Set to"json_schema".jsonSchema: A JSON Schema (draft 2020-12). The roottypekeyword must be"object". See the JSON Schema keywords section for the accepted keywords.
Return value: An HttpResponsePromise that resolves to an object of type KnowledgeStore with a field named id representing the unique identifier of the newly created knowledge store.
JSON Schema keywords
The constraints in this section apply only to ingestion. The schema for the structured output feature of the Responses API supports a different set of keywords, and unsupported keywords do not return an error. They produce incomplete or malformed output.
The platform accepts the following JSON Schema keywords:
Notes:
- Include a
descriptionfield in every property. The platform uses this text to guide extraction, and omitting it returns a422error. - Set the
granularitykeyword on a top-level property to control how often the platform extracts it. The default isshot. The keyword accepts the following values:shot: One value for each shot of a video. A shot is a continuous part of a video between two scene changes.video: One value for each video.image: One value for each image.
- The platform extracts
shotandvideoproperties only from videos, andimageproperties only from images. - The platform returns
videoandimagevalues in theenriched_metadatafield of the item. - A
granularitykeyword on a nested property returns a422error. - Use the
requiredkeyword to specify which fields must appear in every result. - Set the
additionalPropertieskeyword totrueorfalseto control strict shapes. - Do not use nullable fields. To make a field optional, omit it from the
requiredarray. - Do not include unknown keywords. The platform rejects them with a
422error.
Not supported
The platform does not support the following JSON Schema keywords:
- Schema composition:
anyOf,allOf,oneOf,not - Conditional schemas:
if/then/else - Property dependencies:
dependentSchemas,dependentRequired - Object size constraints:
minProperties,maxProperties - String constraints:
pattern,minLength,maxLength - Number constraints:
exclusiveMinimum,exclusiveMaximum,multipleOf - Value constraints:
const - Null handling:
nullable,typearrays (e.g.,["string", "null"]) - Annotative keywords:
default,examples,readOnly,writeOnly - References and reuse:
$ref,$defs,definitions
Common pitfalls
- Overly specific schemas can limit extraction. If the schema is too specific, Jockey may miss relevant content. Start broad, then narrow the schema as you learn what you need.
- General descriptions can lead to broad extraction. If the description is too general, Jockey may return results that are broader than you need. Name the fields, entities, or patterns you want Jockey to emphasize.
- Programmatically generated schemas may include unsupported keywords. If you use tools like
pydantic.model_json_schema(), the output may contain annotative keywords such asdefault,examples, andreadOnly. Strip these before submitting. The platform rejects unknown keywords with a422error.