Can I give the LLM a reference document (a URL con...
# ask-ai
p
Can I give the LLM a reference document (a URL containing information) so it can provide information from that link?
t
Thanks for reaching out, Yassine. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
LiveKit LLMs can definitely work with reference documents or URLs to bring in helpful information, though it really depends on how they’re set up: • Textual Knowledge: You can connect external documents using a Retrieval-Augmented Generation (RAG) pipeline, like LlamaIndex, which helps pull in relevant details from your own sources. • External APIs: It’s also possible to create custom tools that fetch data from web services or databases and feed that info to the LLM. • Visual Input: For multimodal LLMs, you can even use image URLs to share visual content for analysis. If you have a particular use case or idea in mind, please feel free to share it! I’d be happy to walk you through the best approach. Sources: Knowledge Management & Documentation System | livekit/livekit_composite | D... | Docs::Agents | examples/voice_agents/llamaindex-rag/chat_engine.py | complex-agents/vision/README.md | Large language models (LLM) | LiveKit Docs
p
For example i have support page that contain all the questions and response I want to give the llm this url in production so when user ask about any questions or service it will answer based on the info from the production url , can you give me example how to use it ? I'm using python agent
t
I'd love to help you get your Python agent set up to answer questions using a production URL! One effective way is by implementing a Retrieval-Augmented Generation (RAG) system. Here’s a simple overview to guide you: 1. Scrape and Index the URL: Start by using a script to pull content from your support page and break it down into manageable pieces. Then, generate embeddings for these pieces with a model like OpenAI's text-embedding model, and save them in a vector index such as Annoy or FAISS. 2. Integrate the Index: Next, load this vector index into your agent and create a tool that can perform semantic searches, so it can find the most relevant content based on what users ask. 3. Use the Tool in the Agent: Add this tool when initializing your agent and set it up to use the retrieved content to answer questions effectively. 4. Run the Agent: Finally, test your agent locally to make sure everything works smoothly, then deploy it in production—using a Docker container or a similar setup works well. If you’d like, I’m here to walk you through any of these steps in more detail or provide a code example to get you started. Just let me know how you’d like to move forward—I’m happy to help! Sources: python-agent-example-app/README.md | External data and RAG | LiveKit Docs | delay-handling/agent.py | docs/index.yaml | LiveKit Docs