Skip to content

solr_activate_and_reindex --rag-enable silently reindexes without RAG when LLM credentials are missing #111

Description

@reekitconcept

Problem

Running scripts/solr_activate_and_reindex.py --rag-enable with the KITCONCEPT_SOLR_LLM_* environment variables unset (or incomplete — the URL is the required one) completes a full reindex without producing any RAG chunks or embeddings, and says nothing about it. The run looks successful; you only discover the missing chunks when RAG queries come back empty.

This bit us during a debugging session: full reindex, env file not sourced, no warning — the classic index was rebuilt, the RAG side silently skipped.

Why it happens

get_rag_config() returns None when the endpoint URL env var is missing, and the indexing path treats that as "feature off" (graceful degradation). That design is right at request time — a site without credentials should degrade to classic search without hard errors — but wrong for an explicit --rag-enable run: the operator has just asked for RAG, so a missing configuration is an error in the invocation, not a feature toggle.

Expected behavior

When --rag-enable is passed and the registry toggle ends up on but get_rag_config() returns None:

  • print a prominent warning at the start of the run (before the long reindex), naming the missing variable(s), e.g.
    WARNING: --rag-enable requested but KITCONCEPT_SOLR_LLM_URL is not set — reindexing WITHOUT chunks/embeddings
  • preferably: refuse to run unless a --force / --without-rag flag acknowledges the degraded mode.

The same check applies to the --clear variant (where the silent outcome is worst: existing chunks are wiped and not rebuilt).

Request-time behavior stays unchanged — this is only about the explicit reindex script.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions