polite-oil-10264
10/28/2025, 1:36 PMtall-airline-16756
10/28/2025, 1:37 PMtall-airline-16756
10/28/2025, 1:37 PMfrom llama_index.core import SimpleDirectoryReader, VectorStoreIndex
# Load documents
documents = SimpleDirectoryReader(YOUR_DATA_DIR).load_data()
index = VectorStoreIndex.from_documents(documents)
@llm.function_tool
async def query_info(query: str) -> str:
"""Get more information about a specific topic"""
query_engine = index.as_query_engine(use_async=True)
res = await query_engine.aquery(query)
return str(res)
Next, you'll want to add the query_info tool to your agent configuration like this:
agent = Agent(
instructions="Your instructions here",
tools=[query_info],
llm=groq.LLM()
)
Just remember to replace YOUR_DATA_DIR with the path to the directory where your FAQ documents are stored. This setup will enable your agent to effectively query your documents and provide relevant information. If you have any questions or need further assistance, feel free to ask—I'm here to help!
Sources: livekit-agents/README.md | README.md