[GH-ISSUE #18283] feat: Add hash field to FileMetadataResponse model #18551

Closed
opened 2026-04-20 00:46:28 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @Stoyan-Zlatev on GitHub (Oct 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18283

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Request to Extend /api/v1/knowledge/{id} Response to Include File Hashes

Hi Team,

I’d like to request an enhancement to the /api/v1/knowledge/{id} endpoint. Currently, when retrieving knowledge records, the endpoint returns file metadata without the hash value, whereas the /api/v1/files/{id} endpoint includes the file hash.

Background

I am developing custom logic for file synchronization. Rather than deleting and reuploading files, my approach involves comparing hash values to efficiently sync files and directories. This method is significantly faster and more efficient.

Proposed Change

  • Current Behavior:

    • /api/v1/knowledge/{id} returns a list of files without the associated hash value.
    • /api/v1/files/{id} returns the hash value for the file.
  • Requested Update:

    1. Extend the response of /api/v1/knowledge/{id} by including the hash value for each file listed.
    2. Update the FileMetadataResponse model so that when the /api/v1/knowledge/{id} endpoint is used, the returned file metadata includes the hash.

Benefits

  • Efficiency:
    By comparing file hashes, we can synchronize changes without re-uploading entire files, saving time and bandwidth.

  • Consistency:
    Aligns the /api/v1/knowledge/{id} and /api/v1/files/{id} endpoints, ensuring a uniform data structure for file metadata.

  • Enhanced Functionality:
    Enables more robust file synchronization logic across our system.


I believe this adjustment will greatly improve our file syncing mechanism and overall API efficiency. Please let me know if you need additional details or have any questions regarding this proposal.
Knowledge endpoint

Desired Solution you'd like

Add new field hash to FileMetadataResponse model and the relevant methods

Alternatives Considered

No response

Additional Context

No response

Originally created by @Stoyan-Zlatev on GitHub (Oct 13, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/18283 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description # Request to Extend `/api/v1/knowledge/{id}` Response to Include File Hashes Hi Team, I’d like to request an enhancement to the `/api/v1/knowledge/{id}` endpoint. Currently, when retrieving knowledge records, the endpoint returns file metadata without the hash value, whereas the `/api/v1/files/{id}` endpoint includes the file hash. ## Background I am developing custom logic for file synchronization. Rather than deleting and reuploading files, my approach involves comparing hash values to efficiently sync files and directories. This method is significantly faster and more efficient. ## Proposed Change - **Current Behavior:** - `/api/v1/knowledge/{id}` returns a list of files _without_ the associated hash value. - `/api/v1/files/{id}` returns the hash value for the file. - **Requested Update:** 1. Extend the response of `/api/v1/knowledge/{id}` by including the hash value for each file listed. 2. Update the `FileMetadataResponse` model so that when the `/api/v1/knowledge/{id}` endpoint is used, the returned file metadata includes the hash. ## Benefits - **Efficiency:** By comparing file hashes, we can synchronize changes without re-uploading entire files, saving time and bandwidth. - **Consistency:** Aligns the `/api/v1/knowledge/{id}` and `/api/v1/files/{id}` endpoints, ensuring a uniform data structure for file metadata. - **Enhanced Functionality:** Enables more robust file synchronization logic across our system. --- I believe this adjustment will greatly improve our file syncing mechanism and overall API efficiency. Please let me know if you need additional details or have any questions regarding this proposal. <img width="1709" height="840" alt="Knowledge endpoint" src="https://github.com/user-attachments/assets/0c2f7f0e-393a-41cf-aea2-60c3006032c7" /> ### Desired Solution you'd like Add new field `hash` to FileMetadataResponse model and the relevant methods ### Alternatives Considered _No response_ ### Additional Context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#18551