成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

kotaemon核心GraphRAG、Agent、多模態代碼解讀!

發布于 2024-9-6 15:19
瀏覽
0收藏

要說最近RAG方面火熱的項目當屬kotaemon,短時間暴漲8k star

??一個開源、清晰、強大且可定制的RAG UI??

kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

kotaemon的亮點是可定制化RAG UI,核心技術點是混合索引(Vector、Keyword、GraphRAG)、復雜推理Agent(ReAct、ReWOO、MemoryGIST 和 GraphReader)、多模態。


混合索引(GraphRAG)

混合索引主要是指:全文和矢量融合,這里還有一個選型就是集成了RAG的新范式:GraphRAG

kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

看代碼直接用的微軟GraphRAG

kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

檢索后重排采用LLMReranker

RERANK_PROMPT_TEMPLATE = """Given the following question and context,
return YES if the context is relevant to the question and NO if it isn't.


> Question: {question}
> Context:
>>>
{context}
>>>
> Relevant (YES / NO):"""

復雜推理Agent

推理目前主要實現了reactrewoo,tools包括google搜索工具、llm工具、wikipedia工具,可以自定義擴展。

kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

react還是經典的Thought、Action、Action Input、Observation模式

zero_shot_react_prompt = PromptTemplate(
    template="""Answer the following questions as best you can. Give answer in {lang}. You have access to the following tools:
{tool_description}
Use the following format:


Question: the input question you must answer
Thought: you should always think about what to do


Action: the action to take, should be one of [{tool_names}]


Action Input: the input to the action, should be different from the action input of the same action in previous steps.


Observation: the result of the action


... (this Thought/Action/Action Input/Observation can repeat N times)
#Thought: I now know the final answer
Final Answer: the final answer to the original input question


Begin! After each Action Input.


Question: {instruction}
Thought:{agent_scratchpad}
    """
)

rewoo(Reasoning WithOut Observation),該范式將推理過程與外部觀察分離

kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

planner的prompt模版

from kotaemon.llms import PromptTemplate


zero_shot_planner_prompt = PromptTemplate(
    template="""You are an AI agent who makes step-by-step plans to solve a problem under the help of external tools.
For each step, make one plan followed by one tool-call, which will be executed later to retrieve evidence for that step.
You should store each evidence into a distinct variable #E1, #E2, #E3 ... that can be referred to in later tool-call inputs.


##Available Tools##
{tool_description}


##Output Format (Replace '<...>')##
#Plan1: <describe your plan here>
#E1: <toolname>[<input here>] (eg. Search[What is Python])
#Plan2: <describe next plan>
#E2: <toolname>[<input here, you can use #E1 to represent its expected output>]
And so on...


##Your Task##
{task}


##Now Begin##
"""
)

solver的prompt模版

zero_shot_solver_prompt = PromptTemplate(
    template="""You are an AI agent who solves a problem with my assistance. I will provide step-by-step plans(#Plan) and evidences(#E) that could be helpful.
Your task is to briefly summarize each step, then make a short final conclusion for your task. Give answer in {lang}.


##My Plans and Evidences##
{plan_evidence}


##Example Output##
First, I <did something> , and I think <...>; Second, I <...>, and I think <...>; ....
So, <your conclusion>.


##Your Task##
{task}


##Now Begin##
"""
)

多模態

多模態體現在豐富的loader上面,多達十幾種比如:html_loader.py、excel_loader.py、unstructured_loader.py等,可以借鑒用于其它場景哦


kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

多模態測試,AdobeReader

kotaemon核心GraphRAG、Agent、多模態代碼解讀!-AI.x社區

https://github.com/Cinnamon/kotaemon

本文轉載自?? PaperAgent??,作者: PaperAgent

已于2024-9-6 17:11:13修改
收藏
回復
舉報
回復
相關推薦
主站蜘蛛池模板: 欧美精品久久久 | 黄色一级视频 | 在线观看精品视频网站 | 日韩高清一区 | 久久精品一级 | 日韩一区二区三区av | 国产在线播放av | 日日操夜夜干 | 日韩精品在线观看视频 | 中文字幕 国产 | 国产剧情一区 | 久久在线免费 | 粉嫩av久久一区二区三区 | 精品国产乱码久久久久久牛牛 | 毛片免费观看 | 99re视频在线观看 | 久久久久久久国产 | 毛片久久久 | 日韩高清中文字幕 | 久久久精品影院 | 国产精品久久久久久久久久久久 | 男女羞羞视频在线观看 | 亚洲精品18| 国产一区二区在线免费观看 | 国产精品日产欧美久久久久 | 日本一级淫片免费啪啪3 | 在线成人免费视频 | 99久久精品国产一区二区三区 | 国产视频一区在线观看 | 99视频免费看 | 91爱爱·com | 午夜在线视频一区二区三区 | 黑人久久久 | 成年视频在线观看福利资源 | 国产高清美女一级a毛片久久w | 97免费视频在线观看 | 日本电影韩国电影免费观看 | 国产一二三区免费视频 | av免费网站在线观看 | 免费国产精品久久久久久 | 亚洲一区二区三区视频 |