[GH-ISSUE #688] [API]: Support raw text + metadata uploads #394

Closed
opened 2026-02-22 18:19:17 -05:00 by yindo · 3 comments
Owner

Originally created by @timothycarambat on GitHub (Feb 7, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/688

What would you like to see?

Currently, we support the uploading of documents and links via the collector endpoints in the API. There is a use case though for an API user to directly send raw text and preferred metadata directly to the collector for it to then format and save.

note the metadata cannot allow arbitrary key values or else database schemas for many vector dbs will prevent the upsert as sometimes the metadata is spread into columns and the columns must be homogenous across that collection.

Originally created by @timothycarambat on GitHub (Feb 7, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/688 ### What would you like to see? Currently, we support the uploading of documents and links via the collector endpoints in the API. There is a use case though for an API user to directly send raw text and preferred metadata directly to the collector for it to then format and save. *note* the metadata cannot allow arbitrary key values or else database schemas for many vector dbs will prevent the upsert as sometimes the metadata is spread into columns and the columns must be homogenous across that collection.
yindo added the enhancementfeature request labels 2026-02-22 18:19:17 -05:00
yindo closed this issue 2026-02-22 18:19:18 -05:00
Author
Owner

@timothycarambat commented on GitHub (Feb 7, 2024):

@icsy7867 - merged

@timothycarambat commented on GitHub (Feb 7, 2024): @icsy7867 - merged
Author
Owner

@icsy7867 commented on GitHub (Feb 7, 2024):

This looks great! Looking at th swagger right now:

{
  "textContent": "This is the raw text that will be saved as a document in AnythingLLM.",
  "metadata": {
    "keyOne": "valueOne",
    "keyTwo": "valueTwo",
    "etc": "etc"
  }
}

For the metadata bits - Can I set any field from the return response? I.E url, docAuthor, title, published etc...?

{
  "success": true,
  "error": null,
  "documents": [
    {
      "id": "c530dbe6-bff1-4b9e-b87f-710d539d20bc",
      "url": "file://my-document.txt",
      "title": "hello-world.txt",
      "docAuthor": "no author found",
      "description": "No description found.",
      "docSource": "My custom description set during upload",
      "chunkSource": "no chunk source specified",
      "published": "1/16/2024, 3:46:33 PM",
      "wordCount": 252,
      "pageContent": "AnythingLLM is the best....",
      "token_count_estimate": 447,
      "location": "custom-documents/raw-my-doc-text-c530dbe6-bff1-4b9e-b87f-710d539d20bc.json"
    }
  ]
}

For my specific use case - I want to specify a URL that will possibly show up here once this is implemented!
https://github.com/Mintplex-Labs/anything-llm/issues/689

Super excited about this!

@icsy7867 commented on GitHub (Feb 7, 2024): This looks great! Looking at th swagger right now: ``` { "textContent": "This is the raw text that will be saved as a document in AnythingLLM.", "metadata": { "keyOne": "valueOne", "keyTwo": "valueTwo", "etc": "etc" } } ``` For the metadata bits - Can I set any field from the return response? I.E url, docAuthor, title, published etc...? ``` { "success": true, "error": null, "documents": [ { "id": "c530dbe6-bff1-4b9e-b87f-710d539d20bc", "url": "file://my-document.txt", "title": "hello-world.txt", "docAuthor": "no author found", "description": "No description found.", "docSource": "My custom description set during upload", "chunkSource": "no chunk source specified", "published": "1/16/2024, 3:46:33 PM", "wordCount": 252, "pageContent": "AnythingLLM is the best....", "token_count_estimate": 447, "location": "custom-documents/raw-my-doc-text-c530dbe6-bff1-4b9e-b87f-710d539d20bc.json" } ] } ``` For my specific use case - I want to specify a URL that will possibly show up here once this is implemented! https://github.com/Mintplex-Labs/anything-llm/issues/689 Super excited about this!
Author
Owner

@timothycarambat commented on GitHub (Feb 8, 2024):

@icsy7867 In that case, you can specify any of the fields from the /api/v1/document/metadata-schema endpoint. You can override the url metadata and the link will be present, but that won't appear in the UI until #689 is merged - so id wait for that first!

@timothycarambat commented on GitHub (Feb 8, 2024): @icsy7867 In that case, you can specify any of the fields from the `/api/v1/document/metadata-schema` endpoint. You can override the `url` metadata and the link will be present, but that won't appear in the UI until #689 is merged - so id wait for that first!
yindo changed title from [API]: Support raw text + metadata uploads to [GH-ISSUE #688] [API]: Support raw text + metadata uploads 2026-06-05 14:35:05 -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#394