Skip to content

Configurable index name#906

Merged
lucaseduoli merged 10 commits into
langflow-ai:mainfrom
matanor:configurable_index_name
Feb 12, 2026
Merged

Configurable index name#906
lucaseduoli merged 10 commits into
langflow-ai:mainfrom
matanor:configurable_index_name

Conversation

@matanor

@matanor matanor commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

Convert INDEX_NAME to a configurable parameter

This allows benchmarking multiple setups with separated indices.
The index name can be changed via the settings endpoint.

Also added an option to change from the frontend - but can be removed if this is not something that should be exposed to the user.


Detailed changes (AI-generated):

Backend Changes:

  1. config_manager.py: Added index_name: str = "documents" field to KnowledgeConfig dataclass

  2. config/settings.py: Removed INDEX_NAME constant and added get_index_name() function to retrieve from config

  3. Updated all files using INDEX_NAME: Replaced constant with get_index_name() function call in:

    • main.py (index initialization)
    • services/search_service.py
    • services/document_service.py
    • models/processors.py
    • api/documents.py
    • api/v1/documents.py
    • utils/embedding_fields.py
  4. api/settings.py:

    • Added index_name to GET response
    • Added validation (non-empty string)
    • Added update logic with telemetry tracking
    • Integrated with Langflow to update ingest/chat flows when index name changes
  5. services/flows_service.py: Added update_flows_index_name() method to update the OpenSearch components in Langflow

  6. utils/telemetry/message_id.py: Added ORB_SETTINGS_INDEX_NAME_UPDATED telemetry event

Frontend Changes:

  1. useGetSettingsQuery.ts: Added index_name?: string to KnowledgeSettings interface
  2. useUpdateSettingsMutation.ts: Added index_name?: string to UpdateSettingsRequest interface
  3. settings/page.tsx:
    • Added state management for indexName
    • Added handleIndexNameChange() handler with debounced updates
    • Added UI input field in the Knowledge section (between embedding model and chunk size fields)

Summary:

The index name can now be:

  • Configured in config.yaml under knowledge.index_name
  • Retrieved via GET /api/settings
  • Updated via POST /api/settings with automatic Langflow flow synchronization
  • Edited through the Settings page UI with auto-save functionality

@aimurphy

aimurphy commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

Would this be set on the Settings page or the TUI?

If they can set it in the .env, could you please add it to .env.example?

@lucaseduoli

Copy link
Copy Markdown
Collaborator

Will be closed by #914 . Could you please check if that PR has all you need?
We figured it wouldn't need a UI change, since it's an advanced option and something related to the deployment, not the runtime execution, so it shouldn't be seen by the end user. Let me know what you think.

@matanor

matanor commented Feb 8, 2026

Copy link
Copy Markdown
Collaborator Author

Will be closed by #914 . Could you please check if that PR has all you need? We figured it wouldn't need a UI change, since it's an advanced option and something related to the deployment, not the runtime execution, so it shouldn't be seen by the end user. Let me know what you think.

I see, sounds good. The changes to the settings page are not mandatory, can be removed.

The main thing needed for easy benchmarking of the system is the option to change the index name "on-the-fly" while the system runs, programmatically via the backend API. This is what i tried to do here .. Let me know if that makes sense ..

…e_index_name

add a load of the env variable OPENSEARCH_INDEX_NAME into the config index_name
@matanor matanor marked this pull request as ready for review February 11, 2026 08:25

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lucaseduoli

Copy link
Copy Markdown
Collaborator

Merging forcefully since integration tests are failing because OpenAI keys are not present in external repos.

@lucaseduoli lucaseduoli merged commit 648f11b into langflow-ai:main Feb 12, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants