mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-07-22 04:15:24 -04:00
[DOCS]: Add an External Knowledge API #272
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bfechoz-ade on GitHub (Nov 24, 2025).
Type of Documentation Change
Error/Typo fix
Documentation Page URL or Path
https://white-rabbit.ai.ad-education.com/datasets
Current Content
Add an External Knowledge API
I am adding my external LlamaCloud base to the plugin page with the api key and an api name who give me the endpoint that I am trying to add in the page for adding external knowledge base.
and then I found the error msg : "failed to connect to the endpoint: http://localhost/e/kbum3nr..pfiah25/retrieval"
WHEREAS I still have a functionnal endpoint working with my previous Llamacloud account with a US location but I had to change for a european one and now the linking is not working
Suggested Changes
don't know
Reason for Change
No response
Code of Conduct
@dosubot[bot] commented on GitHub (Nov 24, 2025):
Hi @bfechoz-ade! I'm Dosu and I’m helping the dify-docs team.
The error happens because using
localhostas the endpoint means Dify (especially if running in Docker or on another server) can't reach your external knowledge API—localhostrefers to the container or server itself, not your host machine or the actual service you want to connect to. To fix this, set the endpoint to something accessible from Dify's environment, likehost.docker.internal(if your service runs on your host machine), the actual LAN IP, or the Docker network hostname if it's another container. Make sure the endpoint starts withhttp://orhttps://and is reachable from inside the Dify container. You can test this by runningcurl <endpoint>/retrievalinside the Dify container.For documentation, it would help to add a warning about not using
localhostfor endpoints and provide a checklist: use a reachable network address, verify the port, and ensure the API responds with the required schema (a JSON object with arecordsarray containingcontent,score,title, and optionalmetadata). If your external service doesn't require an API key but Dify enforces one, you can use a simple proxy to strip the Authorization header before forwarding requests to your service.References:
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
@bfechoz-ade commented on GitHub (Nov 25, 2025):
Do you have a simple solution ?
@dosubot[bot] commented on GitHub (Nov 25, 2025):
Yes, here's the simplest fix: change your endpoint from
localhostto something Dify can actually reach. If your LlamaCloud service runs on your host machine and Dify is in Docker, usehost.docker.internal(e.g.http://host.docker.internal/e/kbum3nr..pfiah25/retrieval). If it's on another machine or in the cloud, use its LAN IP or public DNS name. Make sure the endpoint starts withhttp://orhttps://and the port is correct.After updating the endpoint, test it by running:
If you get a response, you're good to go. If not, check your Docker network, firewall, and port settings. For more details, see this guide: Why localhost fails and how to fix it and step-by-step instructions.
If your external service doesn't need an API key but Dify requires one, you can use a simple proxy to strip the Authorization header before forwarding requests. Let me know if you need help with that!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other