https://www.deeplearning.ai/short-courses/building-agentic-rag-with-llamaindex/
> 主要就是教 Function Calling + RAG tools,也就是 [[Data Agents]]
## Router Query Engine
![[Pasted image 20240513202450.png]]
* 安裝 nest_asyncio 是為了與 notebook 相容支援非同步
* 在 [[Multi-Vector Retriever]] 內有介紹 Summary Index
* 兩個工具的描述是
* "Useful for summarization questions related to MetaGPT"
* "Useful for retrieving specific context from the MetaGPT paper."
## Tool Calling
改用 function calling 做
![[Pasted image 20240513222713.png]]
![[Pasted image 20240513224200.png]]
## Building an Agent Reasoning Loop
![[Pasted image 20240513234831.png]]
> demo 似乎讓 function calling 就是 single function call 了,而不是 parallel function calling
> 查了 allow_parallel_tool_calls 參數,預設是 False,哎
![[Pasted image 20240513235237.png]]
在教 llamaindex low-level agent API 了
## Build a Multi-Document Agent
![[Pasted image 20240514000230.png]]
假設定三份文件: 把每個文件變成一個 2 個 tools,三份文件共 6 個 tools
![[Pasted image 20240514000826.png]]
![[Pasted image 20240514001929.png]]
### 來做 11篇的情境,這時 tools 太多了....
解法: 針對 tools 選擇做 RAG: 根據問題,找出最相似的三個工具
![[Pasted image 20240514002135.png]]
* 範例問題: 有摘要、也有比較
* "Tell me about the evaluation dataset used in MetaGPT and compare it against SWE-Bench"
* "Compare and contrast the LoRA papers (LongLoRA, LoftQ). Analyze the approach in each paper first. "
## Conclusion
![[Pasted image 20240514002834.png]]