https://learn.deeplearning.ai/courses/building-ai-applications-with-haystack

git https://github.com/MSzgy/Building-AI-Applications-With-Haystack

Introduction

在计算机编程发展过程中,使用框架来简化操作是通用的做法,而如今在LLM,各种框架也层出不穷,其中Haystack就是其中的一种。

HayStack允许使用内置的组件或者自定义的组件来实现一个RAG流操作,通过不同组件的组合使用,可以极简化的构建自己的RAG流,与Dify对比,HayStack中全是通过代码来构建,而Dify则是通过图形化(无代码)方式来构建。

HayStack building blocks

There are many components & pipelines that you can use. 在这节,举了一个简答的例子,将文本通过Haystack读入到内存中,然后通过简单的提问去获取与提问相关的top k个答案。

Lesson_1.ipynb

Build Customized RAG

Embedding Retrieval

Keyword Retrieval

Retrieval + Reranking

Retrieval from a different API

Lesson_2.ipynb

Custom Components--News Summarizer

举了两个例子,第一个例子是生成了一个打招呼的Component, 会根据输入的name, 输出Hello, ${name}

Lesson_3.ipynb

Fallbacks with Branching Pipelines

利用HayStack做路由选择,如果RAG中得不到答案,就转为web search

Lesson_4.ipynb

Self-Reflecting Agents with Loops

采用自反馈的方式不断提高输出内容的质量。

在本节课中,举了一个最简单的例子,提取不规则文本的内容转为structured的输出。

Lesson_5.ipynb

Chat Agent with Function Calling

Lesson_6.ipynb