|
|
hai 1 ano | |
|---|---|---|
| file_loader | hai 1 ano | |
| .gitignore | hai 1 ano | |
| Indexing_Split.py | hai 1 ano | |
| RAG_app.py | hai 1 ano | |
| RAG_strategy.py | hai 1 ano | |
| README.md | hai 1 ano | |
| agent_workflow.png | hai 1 ano | |
| ai_agent.ipynb | hai 1 ano | |
| ai_agent.py | hai 1 ano | |
| ai_agent_llama.py | hai 1 ano | |
| conda_env.txt | hai 1 ano | |
| faiss_index.py | hai 1 ano | |
| local_llm.py | hai 1 ano | |
| pip_env.txt | hai 1 ano | |
| post_processing_sqlparse.py | hai 1 ano | |
| rewrite_question.py | hai 1 ano | |
| semantic_search.py | hai 1 ano | |
| sql_qa_test.py | hai 1 ano | |
| systex_app.py | hai 1 ano | |
| text_to_sql.py | hai 1 ano | |
| text_to_sql2.py | hai 1 ano | |
| text_to_sql_private.py | hai 1 ano |
此專案建立了 multi-agent AI chatbot,主要包含兩個 agent:一個負責處理客戶自有資料的 Text-to-SQL agent,另一個則是使用檢索增強生成(RAG)技術處理專業知識的agent。整體 multi-agent 架構是使用 langgraph 完成。
此 multi-agent 系統旨在透過判斷使用者提問而選擇使用客戶自有資料庫或外部專業知識來源,回答使用者提問。系統包含兩個主要代理:
啟動 app:
conda activate llama3
python systex_app.py
FastAPI Link: https://cmm.ai:8989/docs
共有四個 API,如下:
/agent: 完整的 multi-agent 架構,包含自有數據與知識問答,使用的 LLM 是 GPT-4o-mini/knowledge: 僅有知識問答,使用的 LLM 是 GPT-4o-mini/local_agents: 完整的 multi-agent 架構,包含自有數據與知識問答,使用的 LLM 是 local LLM,根據不同任務選擇使用不同的 local LLM/history: 所有問答紀錄(使用前三個 API 的問答紀錄)systex_app.py:API file。ai_agent.py:定義 multi-agent 架構,包括 Text-to-SQL 和 RAG agent。該架構使用 langgraph 框架建立。ai_agent_llama.py:同 ai_agent.py,改為使用 local LLMfaiss_index.py:處理 RAG 所需的 retriever 功能,用來處理文字向量資料。tex_to_sql_private.py:將自然語言轉換為 SQL query,用來處理客戶自有資料。如果 new_information 有更新可按以下步驟更新:
cd file_loader/
python new_information_loader.py
# tmux [systex] window 0 shutdown first
python systex_app.py