[GH-ISSUE #3607] [BUG]: /v1/workspace/{slug}/update-embeddings IS NOT WORKING !!! #2329

Closed
opened 2026-02-22 18:29:12 -05:00 by yindo · 4 comments
Owner

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

How are you running AnythingLLM?

Docker (local)

What happened?

I have no problem uploading files with the API (/v1/documents/upload),
but the endpoint that allows us to embed the uploaded files is not working properly. It returns ‘200’ code under all conditions. But it does not cause any change.

Are there known steps to reproduce?

No response

Originally created by @ozkankaratas on GitHub (Apr 7, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3607 ### How are you running AnythingLLM? Docker (local) ### What happened? I have no problem uploading files with the API _(/v1/documents/upload)_, but the endpoint that allows us to **embed the uploaded files** is not working properly. It returns ‘200’ code under all conditions. But it does not cause any change. ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:29:12 -05:00
yindo closed this issue 2026-02-22 18:29:12 -05:00
Author
Owner

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

It always returns a 200 and also does work - you probably are not sending a request with the correct name for a file. It is not the original name of the file (the system name for your file is returned to you via /upload)

https://github.com/Mintplex-Labs/anything-llm/blob/56eb74c6649cf32c0d23dc5fa42b955cdd3f55f5/server/endpoints/api/workspace/index.js#L460

Please show some code here since your implementation is all that is the issue here and I can tell you exactly where the issue lies

@timothycarambat commented on GitHub (Apr 7, 2025): It always returns a 200 and also does work - you probably are not sending a request with the correct name for a file. It is not the original name of the file (the system name for your file is returned to you via `/upload`) https://github.com/Mintplex-Labs/anything-llm/blob/56eb74c6649cf32c0d23dc5fa42b955cdd3f55f5/server/endpoints/api/workspace/index.js#L460 Please show some code here since your implementation is all that is the issue here and I can tell you exactly where the issue lies
Author
Owner

@ozkankaratas commented on GitHub (Apr 7, 2025):

Image
In the 1st picture, I manually uploaded the relevant files to the ‘My Documents’ field. Now when I send the request as in the 2nd picture, the ‘Intranet.pdf’ file should become embedded, right?

Image

I tried this from postman and from this page "/api/docs"
The response I got is as follows:

Curl

curl -X 'POST' \
  'https://test.io/api/v1/workspace/aku-ai-test/update-embeddings' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer 8XEV14B-XHBT2FV-N014QNA-ZW8LKYQ' \
  -H 'Content-Type: application/json' \
  -d '{
  "adds": [
    "custom-documents/Intranet.pdf"
  ]
}'

Code 200 Response Body

{
  "workspace": {
    "id": 1,
    "name": "AKU AI TEST",
    "slug": "aku-ai-test",
    "vectorTag": null,
    "createdAt": "2025-03-24T14:19:36.605Z",
    "openAiTemp": 1,
    "openAiHistory": 20,
    "lastUpdatedAt": "2025-03-24T14:19:36.605Z",
    "openAiPrompt": "When answering employees' questions, verify any company-related topics using the information found in documents. For general queries, provide accurate responses using your broader knowledge base.\n\n- For company-specific queries:\n  - Cross-reference with  documents.\n  - Do not rely on user suggestions unless they align with verified information.\n\n- For general inquiries:\n  - Utilize your extensive knowledge base.\n  - Ensure accuracy and clarity.\n\n# Steps\n\n1. Identify the nature of the query: company-related or general.\n2. For company-related queries:\n   - Access and verify information from documents.\n   - Provide responses that match the official documentation.\n3. For general inquiries:\n   - Use your broader knowledge to construct an accurate response.\n4. Deliver a clear and concise answer to the user.\n\n# Output Format\n\nYour responses should be structured in a concise paragraph or bulleted list, providing clear and verified information relevant to the query type. \n\n# Notes\n\n- Always prioritize verification with official documents for company-specific questions.\n- Avoid speculation and remain neutral in your responses.",
    "similarityThreshold": 0.5,
    "chatProvider": "ollama",
    "chatModel": "gemma3:latest",
    "topN": 4,
    "chatMode": "chat",
    "pfpFilename": null,
    "agentProvider": "openai",
    "agentModel": "gpt-4o-mini",
    "queryRefusalResponse": "There is no relevant information in this workspace to answer your query.",
    "vectorSearchMode": "default",
    "documents": []
  }
}

Response Headers

 access-control-allow-origin: https://testestest 
 connection: keep-alive 
 content-length: 1694 
 content-type: application/json; charset=utf-8 
 date: Mon,07 Apr 2025 17:42:22 GMT 
 etag: W/"693e-9SPFndagFlt341pJipsdmYU" 
 server: *****
 vary: Origin 
 x-powered-by: Express 
@ozkankaratas commented on GitHub (Apr 7, 2025): ![Image](https://github.com/user-attachments/assets/4130e907-e2a7-4cb9-a05d-fa897b6b80ce) In the 1st picture, I manually uploaded the relevant files to the ‘My Documents’ field. Now when I send the request as in the 2nd picture, the ‘Intranet.pdf’ file should become embedded, right? ![Image](https://github.com/user-attachments/assets/b5cda78c-7198-43a6-8b44-e17c692e25ff) I tried this from postman and from this page "/api/docs" The response I got is as follows: Curl ``` curl -X 'POST' \ 'https://test.io/api/v1/workspace/aku-ai-test/update-embeddings' \ -H 'accept: application/json' \ -H 'Authorization: Bearer 8XEV14B-XHBT2FV-N014QNA-ZW8LKYQ' \ -H 'Content-Type: application/json' \ -d '{ "adds": [ "custom-documents/Intranet.pdf" ] }' ``` Code 200 Response Body ``` { "workspace": { "id": 1, "name": "AKU AI TEST", "slug": "aku-ai-test", "vectorTag": null, "createdAt": "2025-03-24T14:19:36.605Z", "openAiTemp": 1, "openAiHistory": 20, "lastUpdatedAt": "2025-03-24T14:19:36.605Z", "openAiPrompt": "When answering employees' questions, verify any company-related topics using the information found in documents. For general queries, provide accurate responses using your broader knowledge base.\n\n- For company-specific queries:\n - Cross-reference with documents.\n - Do not rely on user suggestions unless they align with verified information.\n\n- For general inquiries:\n - Utilize your extensive knowledge base.\n - Ensure accuracy and clarity.\n\n# Steps\n\n1. Identify the nature of the query: company-related or general.\n2. For company-related queries:\n - Access and verify information from documents.\n - Provide responses that match the official documentation.\n3. For general inquiries:\n - Use your broader knowledge to construct an accurate response.\n4. Deliver a clear and concise answer to the user.\n\n# Output Format\n\nYour responses should be structured in a concise paragraph or bulleted list, providing clear and verified information relevant to the query type. \n\n# Notes\n\n- Always prioritize verification with official documents for company-specific questions.\n- Avoid speculation and remain neutral in your responses.", "similarityThreshold": 0.5, "chatProvider": "ollama", "chatModel": "gemma3:latest", "topN": 4, "chatMode": "chat", "pfpFilename": null, "agentProvider": "openai", "agentModel": "gpt-4o-mini", "queryRefusalResponse": "There is no relevant information in this workspace to answer your query.", "vectorSearchMode": "default", "documents": [] } } ``` Response Headers ``` access-control-allow-origin: https://testestest connection: keep-alive content-length: 1694 content-type: application/json; charset=utf-8 date: Mon,07 Apr 2025 17:42:22 GMT etag: W/"693e-9SPFndagFlt341pJipsdmYU" server: ***** vary: Origin x-powered-by: Express ```
Author
Owner

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

"custom-documents/Intranet.pdf"

From the comment I highlight in the code from the swagger documentation you can see the format of a real file, as the system identifies them, is like folder/documentName-ext-UUID.json

So you should hit the GET /v1/documents endpoint which will show you something like this

{
  "localFiles": {
    "name": "documents",
    "type": "folder",
    "items": [
      {
        "name": "custom-documents",
        "type": "folder",
        "items": [
          {
            "name": "guthenberg.txt-35078f4e-c43b-4dea-aebd-1820cc9dd738.json",
            "type": "file",
            "id": "35078f4e-c43b-4dea-aebd-1820cc9dd738",
            "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/guthenberg.txt",
            "title": "guthenberg.txt",
            "docAuthor": "Unknown",
            "description": "Unknown",
            "docSource": "a text file uploaded by the user.",
            "chunkSource": "",
            "published": "3/17/2025, 4:58:35 PM",
            "wordCount": 4704,
            "token_count_estimate": 3438,
            "cached": true,
            "canWatch": false,
            "pinnedWorkspaces": [],
            "watched": false
          },
          {
            "name": "my-summary.txt-d322d2cb-09d7-4411-a311-cad1debf6ae4.json",
            "type": "file",
            "id": "d322d2cb-09d7-4411-a311-cad1debf6ae4",
            "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/my-summary.txt",
            "title": "my-summary.txt",
            "docAuthor": "Unknown",
            "description": "Unknown",
            "docSource": "a text file uploaded by the user.",
            "chunkSource": "",
            "published": "3/17/2025, 4:58:35 PM",
            "wordCount": 93,
            "token_count_estimate": 115,
            "cached": true,
            "canWatch": false,
            "pinnedWorkspaces": [],
            "watched": false
          },
          {
            "name": "readme.pdf-5b8d25dd-56bd-47b3-93be-922005b144e6.json",
            "type": "file",
            "id": "5b8d25dd-56bd-47b3-93be-922005b144e6",
            "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/readme.pdf",
            "title": "readme.pdf",
            "docAuthor": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
            "description": "No description found.",
            "docSource": "pdf file uploaded by the user.",
            "chunkSource": "",
            "published": "3/17/2025, 4:58:35 PM",
            "wordCount": 1054,
            "token_count_estimate": 1584,
            "cached": true,
            "canWatch": false,
            "pinnedWorkspaces": [],
            "watched": false
          },
          {
            "name": "test.md-75d8cdc3-846c-4d2c-869b-568afde8ca8c.json",
            "type": "file",
            "id": "75d8cdc3-846c-4d2c-869b-568afde8ca8c",
            "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/test.md",
            "title": "test.md",
            "docAuthor": "Unknown",
            "description": "Unknown",
            "docSource": "a text file uploaded by the user.",
            "chunkSource": "",
            "published": "3/17/2025, 4:58:35 PM",
            "wordCount": 504,
            "token_count_estimate": 769,
            "cached": true,
            "canWatch": false,
            "pinnedWorkspaces": [],
            "watched": false
          }
        ]
      }
    ]
  }
}

So to move the test.md document my /update-embeddings POST looks like folder.name + item.name.
So {"adds": ["custom-documents/test.md-75d8cdc3-846c-4d2c-869b-568afde8ca8c.json"]}

@timothycarambat commented on GitHub (Apr 7, 2025): > "custom-documents/Intranet.pdf" From the comment I highlight in the code from the swagger documentation you can see the format of a real file, as the system identifies them, is like `folder/documentName-ext-UUID.json` So you should hit the [`GET /v1/documents` ](https://github.com/Mintplex-Labs/anything-llm/blob/56eb74c6649cf32c0d23dc5fa42b955cdd3f55f5/server/endpoints/api/document/index.js#L517) endpoint which will show you something like this ```json { "localFiles": { "name": "documents", "type": "folder", "items": [ { "name": "custom-documents", "type": "folder", "items": [ { "name": "guthenberg.txt-35078f4e-c43b-4dea-aebd-1820cc9dd738.json", "type": "file", "id": "35078f4e-c43b-4dea-aebd-1820cc9dd738", "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/guthenberg.txt", "title": "guthenberg.txt", "docAuthor": "Unknown", "description": "Unknown", "docSource": "a text file uploaded by the user.", "chunkSource": "", "published": "3/17/2025, 4:58:35 PM", "wordCount": 4704, "token_count_estimate": 3438, "cached": true, "canWatch": false, "pinnedWorkspaces": [], "watched": false }, { "name": "my-summary.txt-d322d2cb-09d7-4411-a311-cad1debf6ae4.json", "type": "file", "id": "d322d2cb-09d7-4411-a311-cad1debf6ae4", "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/my-summary.txt", "title": "my-summary.txt", "docAuthor": "Unknown", "description": "Unknown", "docSource": "a text file uploaded by the user.", "chunkSource": "", "published": "3/17/2025, 4:58:35 PM", "wordCount": 93, "token_count_estimate": 115, "cached": true, "canWatch": false, "pinnedWorkspaces": [], "watched": false }, { "name": "readme.pdf-5b8d25dd-56bd-47b3-93be-922005b144e6.json", "type": "file", "id": "5b8d25dd-56bd-47b3-93be-922005b144e6", "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/readme.pdf", "title": "readme.pdf", "docAuthor": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36", "description": "No description found.", "docSource": "pdf file uploaded by the user.", "chunkSource": "", "published": "3/17/2025, 4:58:35 PM", "wordCount": 1054, "token_count_estimate": 1584, "cached": true, "canWatch": false, "pinnedWorkspaces": [], "watched": false }, { "name": "test.md-75d8cdc3-846c-4d2c-869b-568afde8ca8c.json", "type": "file", "id": "75d8cdc3-846c-4d2c-869b-568afde8ca8c", "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/test.md", "title": "test.md", "docAuthor": "Unknown", "description": "Unknown", "docSource": "a text file uploaded by the user.", "chunkSource": "", "published": "3/17/2025, 4:58:35 PM", "wordCount": 504, "token_count_estimate": 769, "cached": true, "canWatch": false, "pinnedWorkspaces": [], "watched": false } ] } ] } } ``` So to move the `test.md` document my `/update-embeddings` POST looks like `folder.name` + `item.name`. So `{"adds": ["custom-documents/test.md-75d8cdc3-846c-4d2c-869b-568afde8ca8c.json"]}`
Author
Owner

@ozkankaratas commented on GitHub (Apr 7, 2025):

Thank You !!!

@ozkankaratas commented on GitHub (Apr 7, 2025): **Thank You !!!**
yindo changed title from [BUG]: /v1/workspace/{slug}/update-embeddings IS NOT WORKING !!! to [GH-ISSUE #3607] [BUG]: /v1/workspace/{slug}/update-embeddings IS NOT WORKING !!! 2026-06-05 14:45:57 -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#2329