{% extends "base.html" %} {% block title %}Knowledge & Retrieval — SimpleAudit{% endblock %} {% block content %}

Knowledge & Retrieval

Instance-wide document retrieval settings. Superusers only.

{% include "admin/_tabs.html" %} {% if settings_error %}
Knowledge and retrieval settings are unavailable: {{ settings_error }}
{% endif %}
{% csrf_token %}
Embedding

Choose the one service that converts uploaded documents into searchable vectors. These settings affect indexing and re-indexing.

Ollama connection

OpenAI-compatible connection

Azure OpenAI connection

Provider keys are write-only here. Leave a key blank to keep the existing key.

Existing knowledge indexes

Changing the embedding model does not rebuild existing vectors automatically.

{% if last_reindex %}

Last re-index: {{ last_reindex.status|title }} · {{ last_reindex.started_at|date:"Y-m-d H:i T" }} · {{ last_reindex.embedding_model|default:"default model" }} {% if last_reindex.total != None %} · {{ last_reindex.success|default:0 }}/{{ last_reindex.total }} knowledge bases{% endif %}

{% else %}

No Studio-triggered re-index has been recorded.

{% endif %}
{% if last_reindex.status == 'succeeded' and reindex_matches_current == False %}

The embedding settings changed after this re-index. Run it again to rebuild vectors with the current model.

{% endif %} {% if last_reindex.status == 'failed' and last_reindex.error %}

{{ last_reindex.error }}

{% endif %}
Retrieval

Controls how document matches are selected and assembled when an agent searches knowledge.

{% include "admin/_rag_number.html" with name="TOP_K" label="Top K (initial matches)" value=rag.TOP_K help="How many candidate chunks to retrieve before optional reranking." %} {% include "admin/_rag_number.html" with name="TOP_K_RERANKER" label="Reranker Top K" value=rag.TOP_K_RERANKER help="How many candidates are passed to the reranker." %} {% include "admin/_rag_number.html" with name="RELEVANCE_THRESHOLD" label="Minimum relevance" value=rag.RELEVANCE_THRESHOLD step="0.01" help="Discard matches below this similarity score." %} {% include "admin/_rag_number.html" with name="HYBRID_BM25_WEIGHT" label="Keyword-search weight" value=rag.HYBRID_BM25_WEIGHT step="0.01" help="How much keyword matching contributes when hybrid search is enabled." %} {% include "admin/_rag_text.html" with name="RAG_RERANKING_ENGINE" label="Reranking engine" value=rag.RAG_RERANKING_ENGINE placeholder="" help="The service used to reorder the initial matches." %} {% include "admin/_rag_text.html" with name="RAG_RERANKING_MODEL" label="Reranking model" value=rag.RAG_RERANKING_MODEL placeholder="" help="The model used to score and reorder matches." %}
{% include "admin/_rag_checkbox.html" with name="RAG_FULL_CONTEXT" label="Full context mode" checked=rag.RAG_FULL_CONTEXT help="Include all selected matching text instead of trimming to a compact context." %} {% include "admin/_rag_checkbox.html" with name="BYPASS_EMBEDDING_AND_RETRIEVAL" label="Bypass document search" checked=rag.BYPASS_EMBEDDING_AND_RETRIEVAL help="Disable retrieval and answer without searching knowledge." %} {% include "admin/_rag_checkbox.html" with name="ENABLE_RAG_HYBRID_SEARCH" label="Hybrid semantic + keyword search" checked=rag.ENABLE_RAG_HYBRID_SEARCH help="Combine vector similarity with BM25 keyword matching." %} {% include "admin/_rag_checkbox.html" with name="ENABLE_RAG_HYBRID_SEARCH_ENRICHED_TEXTS" label="Enrich keyword-search text" checked=rag.ENABLE_RAG_HYBRID_SEARCH_ENRICHED_TEXTS help="Use enriched document text when calculating keyword matches." %}
Chunking and files
{% include "admin/_rag_text.html" with name="TEXT_SPLITTER" label="Text splitter" value=rag.TEXT_SPLITTER placeholder="character, token" %} {% include "admin/_rag_text.html" with name="RAG_TOKENIZER_MODEL" label="Tokenizer model" value=rag.RAG_TOKENIZER_MODEL placeholder="Optional" %} {% include "admin/_rag_number.html" with name="CHUNK_SIZE" label="Chunk size" value=rag.CHUNK_SIZE %} {% include "admin/_rag_number.html" with name="CHUNK_OVERLAP" label="Chunk overlap" value=rag.CHUNK_OVERLAP %} {% include "admin/_rag_number.html" with name="CHUNK_MIN_SIZE_TARGET" label="Minimum chunk size" value=rag.CHUNK_MIN_SIZE_TARGET %} {% include "admin/_rag_text.html" with name="CONTENT_EXTRACTION_ENGINE" label="Content extraction engine" value=rag.CONTENT_EXTRACTION_ENGINE placeholder="Default" %} {% include "admin/_rag_text.html" with name="PDF_LOADER_MODE" label="PDF loader mode" value=rag.PDF_LOADER_MODE placeholder="page" %} {% include "admin/_rag_text.html" with name="FILE_MAX_SIZE" label="Maximum file size" value=rag.FILE_MAX_SIZE placeholder="" %} {% include "admin/_rag_text.html" with name="FILE_MAX_COUNT" label="Maximum file count" value=rag.FILE_MAX_COUNT placeholder="" %}
{% include "admin/_rag_checkbox.html" with name="ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER" label="Markdown header splitting" checked=rag.ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER %} {% include "admin/_rag_checkbox.html" with name="PDF_EXTRACT_IMAGES" label="Extract images from PDFs" checked=rag.PDF_EXTRACT_IMAGES %}
Changing the embedding model requires re-indexing existing knowledge bases.
{% endblock %}