Skip to content

Knowledge operators

Public

The Knowledge family contains 4 operators. Vector-backed semantic search over per-document collections.

Removes chunks from a knowledge namespace, optionally scoped to a single doc_key.

Version 1.0.0 · Semantics side_effect · Idempotent · Visibility advanced

FieldTypeRequiredDefaultDescription
doc_keystringnoDoc identifier to delete. Omit to delete the entire namespace.
namespacestringyesKnowledge base name.
PortTypeRequiredDescription
inputanynoInput
PortTypeRequiredDescription
outputobjectnoOutput

Paginates chunk metadata for a knowledge namespace.

Version 1.0.0 · Semantics passthrough · Idempotent · Visibility advanced

FieldTypeRequiredDefaultDescription
limitintegerno50
namespacestringyesKnowledge base name.
offsetintegerno0
PortTypeRequiredDescription
inputanynoInput
PortTypeRequiredDescription
outputobjectnoOutput

Semantic search over a pgvector knowledge namespace via cosine similarity.

Version 1.0.0 · Semantics passthrough · Idempotent · Secrets OPENROUTER_API_KEY

FieldTypeRequiredDefaultDescription
embedding_modelstringno"openai/text-embedding-3-small"OpenRouter-routed embedding model. Must match the upsert model.
filterobjectnoJSON-containment filter applied to chunk metadata.
namespacestringyesKnowledge base to search.
querystringnoQuery text. Falls back to the input port string if omitted.
top_kintegerno5
PortTypeRequiredDescription
querystringnoQuery
PortTypeRequiredDescription
outputobjectnoOutput
resultsarraynoResults
scoresarraynoScores

Chunks, embeds, and persists text into a pgvector-backed knowledge base.

Version 1.0.0 · Semantics side_effect · Idempotent · Secrets OPENROUTER_API_KEY

FieldTypeRequiredDefaultDescription
chunk_sizeintegerno1500Maximum characters per chunk.
contentstringnoText to chunk and embed. Falls back to the input port string if omitted.
doc_keystringyesStable identifier for the source document; re-upserts replace existing chunks.
embedding_modelstringno"openai/text-embedding-3-small"OpenRouter-routed embedding model. Must produce 1536-dim vectors.
metadataobjectno{}Free-form JSON metadata attached to every chunk for later filtering.
namespacestringyesLogical knowledge base name (e.g. ‘product-docs’).
PortTypeRequiredDescription
contentstringnoContent
PortTypeRequiredDescription
outputobjectnoOutput

Every operator above is rendered from its JSON schema in /opt/glyph/schemas/operators/:

  • schemas/operators/knowledge.delete.json
  • schemas/operators/knowledge.list.json
  • schemas/operators/knowledge.search.json
  • schemas/operators/knowledge.upsert.json