Elizon Docs
Features & SpecsPortable definitions

Knowledge Bases

The portable definition of a Knowledge Base: settings, never documents.

A Package carries how a Knowledge Base indexes and searches, and never the documents. The author's files are theirs, and the installer brings their own.

knowledge/product-docs.yaml
name: Product Docs
embedding:
  slot: embedding
  modelPreference: text-embedding-3-small
searchMode: hybrid
hybridAlpha: 0.6
indexConfig:
  metadata:
    use_builtin: true
    fields:
      - name: product
        type: text
        required: true
        description: The product the document is about.
dataMode: schema-only

Run npx @elizon/cli@<cliVersion> example knowledge-base for a complete project with a file like this one. validate and build both check the file against the rules on this page.

FieldMeaning
nameDisplay name, 1–100 characters, unique in the project it installs into.
embedding.slotThe llm Slot whose model builds and searches the index.
embedding.modelPreferenceThe embedding model you would choose, or null. Used when the installer's LLM Configuration offers it; otherwise that Configuration's first embedding model is used.
searchModeHow queries are matched: vector, keyword or hybrid. See Search modes.
hybridAlphaA number from 0 to 1: the balance between keyword and vector matching. Read only in hybrid mode.
indexConfigIndex settings in their stored shape, or null for the defaults. See Index settings.
dataModeAlways schema-only: the Knowledge Base is created empty and filled by the installer. Any other value is refused.

Search modes

searchMode takes exactly one of three values. Any other value, including a different capitalisation, is refused by validate and build with PORTABLE_DEFINITION_INVALID, and the message lists the three. The platform refuses the same values when a Knowledge Base is created, edited or imported. A value stored before this check existed was normalised to hybrid, which is how it was already searched.

ValueWhat a query doeshybridAlpha
vectorEmbeds the query and returns the chunks nearest in meaning. Finds paraphrases; can miss exact part numbers and codes.Ignored.
keywordBM25 keyword ranking only; the query is never embedded. Finds exact words, codes and names; misses paraphrases.Ignored.
hybridRuns both and blends the scores. The default in Studio, and the right choice for most documentation.0 is all keyword, 1 is all vector.

Index settings

indexConfig is the Knowledge Base's knowledge_base_config, in the shape Studio stores and exports: { hnsw, bm25, metadata: { use_builtin, fields } }. null, an empty object, or any section or key left out means the default below. The settings are fixed when the index is created; the installer can change them later in Studio, which re-indexes.

Only the keys below are honoured. A key not listed here, at any level, is accepted and carried but ignored, and validate and build warn KB_INDEX_CONFIG_KEY_IGNORED naming it (for example indexConfig.hnsw.efConstruction), so check the spelling. The warning does not fail the command. A listed key with a value of the wrong type, or an enum value not listed, is refused with PORTABLE_DEFINITION_INVALID.

knowledge/product-docs.yaml
name: Product Docs
embedding:
  slot: embedding
  modelPreference: null
searchMode: vector
hybridAlpha: 0.5
indexConfig:
  hnsw:
    distance_metric: cosine
    ef_construction: 128
    max_connections: 16
    ef: 64
  bm25:
    bm25_k1: 1.2
    bm25_b: 0.75
  metadata:
    use_builtin: false
    fields:
      - name: product
        type: text
        required: true
        description: The product the document is about.
      - name: released
        type: date
        required: false
        description: null
dataMode: schema-only

hnsw: the vector index

KeyTypeDefaultMeaning
distance_metricstringcosineHow vector distance is measured: cosine, dot, l2-squared, hamming or manhattan.
ef_constructioninteger128Build-time search width. Higher builds a better index, more slowly.
max_connectionsinteger16Links per node in the graph. Higher is more accurate and uses more memory.
efinteger64Query-time search width. Higher is more accurate and slower. -1 turns on dynamic ef (the three rows below).
dynamic_ef_factorinteger8Only when ef is -1: ef becomes the result limit times this.
dynamic_ef_mininteger100Only when ef is -1: the lower bound for that ef.
dynamic_ef_maxinteger500Only when ef is -1: the upper bound for that ef.
vector_cache_max_objectsinteger1000000000000How many vectors the index keeps in memory.

bm25: the keyword index

KeyTypeDefaultMeaning
bm25_k1number1.2Term-frequency saturation. Higher lets repeated words count for more.
bm25_bnumber0.75Length normalisation, 0 to 1. Higher penalises long chunks more.
cleanup_interval_secondsinteger300How often the keyword index is cleaned up.
index_timestampsbooleanfalseIndex creation and update times, so they can be filtered on.
index_null_statebooleanfalseIndex whether a property is empty, so emptiness can be filtered on.
index_property_lengthbooleanfalseIndex property lengths, so length can be filtered on.

bm25 is read in keyword and hybrid mode, hnsw in vector and hybrid mode; both indexes are always built.

metadata: fields per document

KeyTypeDefaultMeaning
use_builtinbooleanfalseAdds uploader, upload_date, last_update_date and source to every chunk.
fieldslist[]Fields the installer fills per document at upload. Agents and the Knowledge Search node can filter on them.

Each entry of fields:

KeyTypeDefaultMeaning
namestring—Required. A letter, then letters, digits and underscores; at most 230 characters. See below.
typestring—Required. One of text, text[], int, int[], bool, number, number[], date, phone.
requiredbooleanfalseStudio will not upload a document without a value for it. The API does not check it.
descriptionstring or nullnullShown to the person uploading.

A field name is refused with PORTABLE_DEFINITION_INVALID by validate and build, naming the field (for example fields[0].name), when it:

  • breaks the rule above, such as 2nd-field or _private;
  • is one the platform writes itself: document_id, kb_id, source_id, chunk_index, document_name and text, which every chunk carries, or uploader, upload_date, last_update_date and source, which use_builtin adds (reserved even when it is off);
  • is one Weaviate keeps for itself: id, _id, _additional and vector;
  • repeats another field's name.

Names are compared ignoring case. Weaviate, which stores the index, treats two property names that differ only in case as the same property, so Text clashes with text, and region and Region are the same field. Weaviate's own names it compares exactly; refusing ID or Vector too is deliberately stricter, so that no field has a name easily confused with one of them.

The platform applies the same rule when a field is added to a Knowledge Base: on create and edit it answers 422, and on import it answers 400.

A field stored before this check existed is left as it is:

  • It stays editable. Saving the Knowledge Base's settings in Studio resends every stored field unchanged, and that save is accepted. Only a newly added field is checked, and it must not clash with any stored one.
  • A Knowledge Base that holds such a field cannot be carried in a Package. Exporting it from Studio into a Package fails with PORTABLE_DEFINITION_INVALID, naming the field.
  • A Knowledge Base export file that holds such a field cannot be imported. Remove or rename the field in the file first.

The stored shape, not the API's

indexConfig uses the stored key names use_builtin and fields[].name. The knowledge-service create API calls them use_builtin_metadata and field_name; the install renames them. Written with the API names, use_builtin_metadata is ignored and a field with field_name but no name is refused.

Chunking is not part of the definition

Chunking strategy, chunk_size and overlap are chosen per document, at upload, by whoever uploads it. A Knowledge Base has no chunking settings of its own, and because a Package carries no documents, there is nothing to put them on. See Chunking strategies in the user guide.

The Slots it needs

elizon.yaml
slots:
  - id: embedding
    type: llm
    required: true
    description: The model used to index and search your documents.
    boundTo: [knowledgeBases.product-docs]
  - id: product-documents
    type: knowledge-source
    required: true
    description: Your own product documentation.
    boundTo: [knowledgeBases.product-docs]

Choose the embedding model once

Changing a Knowledge Base's embedding model after its documents are indexed invalidates the index. Say so in the Slot's description.

At install

  • The installer chooses the embedding model, then uploads files, connects a source (for example, a web page crawled with the pages under it), or skips.
  • A skipped Knowledge Base is created empty and listed as outstanding. An empty Knowledge Base answers nothing, which looks like a broken Package, so the warning stays on the Package's page until it has content.
  • Packages with Knowledge Bases install into a project, not the Organization level.

Link it to Agents with config.knowledge.knowledge_bases: [knowledgeBases.<name>] in the Agent's definition. See Knowledge Bases for a walkthrough.