Consider giving this repo a ✨! Thanks!!!
You need to have the following tools installed:
# To setup uv
uv sync
Note: You can use any OpenAI compatible backend or simply use OpenAI itself.
- Feel free to use any OpenAI compatible API.
- Make sure you have Ollama installed.
- Make sure you have pulled a model. I recommend Qwen 2.5 32B.
- Use this guide to setup inferix to host a OpenAI compatible API capable of function calling.
- Checkout the example dotenv file at
.env.example
. - Create a new
.env
using the example one as a template. - Replace the variables as necessary.
We've got a few scripts in this project:
uv run src/00_humble_call.py
- Runs the ingestion script to create the embeddings and full text search index.uv run src/01-basic-rag.py
- Demonstrates a basic RAG workflow.uv run src/02a-rag-as-tool.py
- Demonstrates how you can agents can perform RAG by means of a tool call.uv run src/02b-rag-as-system-prompt.py
- Demonstrates how you can use Pydantic AI's system prompt hook to perform RAG.uv run src/02c-rag-combined.py
- Demonstrates how you can combine the two approaches to perform RAG.uv run src/03-agentic-rag.py
- Demonstrates how you can use Pydantic AI's agentic workflow to perform RAG.