[GH-ISSUE #3574] [BUG]: Metadata content is stored as text based when uploaded file from AnythingLLM #2305

Closed
opened 2026-02-22 18:29:05 -05:00 by yindo · 1 comment
Owner

Originally created by @johnec2 on GitHub (Apr 1, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3574

How are you running AnythingLLM?

Local development

What happened?

When a JSON file is uploaded to anythingLLM, I want to store specific fields like "category" and "role" as metadata rather than having them embedded in the text-based payload

how to format the json file data to store metadata separately so that we can easily query by category or role.

The data format we are using is as below:
{
"id": "01",
"questions": ["How to upload games?" ],
"answer": "Games can be created individually or uploaded in bulk. ...",
"metadata": {
"category": "Bulk Upload Game",
"role": ["admin"],
"module":"Game"
}
}
Can you suggest how to format the data to store metadata separately in the payload?

Are there known steps to reproduce?

No response

Originally created by @johnec2 on GitHub (Apr 1, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3574 ### How are you running AnythingLLM? Local development ### What happened? When a JSON file is uploaded to anythingLLM, I want to store specific fields like "category" and "role" as metadata rather than having them embedded in the text-based payload how to format the json file data to store metadata separately so that we can easily query by category or role. The data format we are using is as below: { "id": "01", "questions": ["How to upload games?" ], "answer": "Games can be created individually or uploaded in bulk. ...", "metadata": { "category": "Bulk Upload Game", "role": ["admin"], "module":"Game" } } Can you suggest how to format the data to store metadata separately in the payload? ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:29:05 -05:00
yindo closed this issue 2026-02-22 18:29:05 -05:00
Author
Owner

@timothycarambat commented on GitHub (Apr 1, 2025):

This is not a bug, it is intentional because when using basic RAG - or even accuracy optimized reranking - having a small amount of the metadata in the snippet improves retrival by a lot since normally this content is not included or searchable since we do not expose metadata searching since that would be very complex to surface in the UI.

If you want to change it, you can do so here:
https://github.com/Mintplex-Labs/anything-llm/blob/962c96a7b4a08b15195e27d383ed93e83809a969/server/utils/TextSplitter/index.js#L70
Just return "" here

@timothycarambat commented on GitHub (Apr 1, 2025): This is not a bug, it is intentional because when using basic RAG - or even accuracy optimized reranking - having a small amount of the metadata in the snippet improves retrival by a lot since normally this content is not included or searchable since we do not expose metadata searching since that would be very complex to surface in the UI. If you want to change it, you can do so here: https://github.com/Mintplex-Labs/anything-llm/blob/962c96a7b4a08b15195e27d383ed93e83809a969/server/utils/TextSplitter/index.js#L70 Just return "" here
yindo changed title from [BUG]: Metadata content is stored as text based when uploaded file from AnythingLLM to [GH-ISSUE #3574] [BUG]: Metadata content is stored as text based when uploaded file from AnythingLLM 2026-06-05 14:45:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2305