RAG layer for pydantic-ai agents. Part of pydantic-ai-toolkits.
Project description
pydantic-ai-rag
This project is included in pydantic-ai-toolbox.
Install
pip install "pydantic-ai-toolbox[rag]"
Usage
from pydantic_ai import Agent
from pydantic_ai_toolbox import RAGToolset
rag = RAGToolset(
embedder=my_embedder,
chunk_size=1000,
chunk_overlap=100,
storage_path="./index",
distance="cosine",
max_results=20,
namespace="default",
)
rag.add_text("The sky is green.", doc_id="d-sky")
agent = Agent("openai:gpt-4o", toolsets=[rag])
agent.run_sync("What color is the sky?")
embedder is any callable mapping list[str] -> list[list[float]] (OpenAI, a local model, or a stub for tests).
Full reference and a runnable example: RAG.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_ai_rag-0.0.0.tar.gz.
File metadata
- Download URL: pydantic_ai_rag-0.0.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6321f22dc8e57b806a1da6f244fd085aabbef2d95e23ce0521a17910136bc510
|
|
| MD5 |
9534e94f4d6623c46de78cec3df821e2
|
|
| BLAKE2b-256 |
c23b97dd980830b862732eb215c80c5385f624105201d182d06e7f9ee20d98bc
|
Provenance
The following attestation bundles were made for pydantic_ai_rag-0.0.0.tar.gz:
Publisher:
publish.yml on wachawo/pydantic-ai-rag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_ai_rag-0.0.0.tar.gz -
Subject digest:
6321f22dc8e57b806a1da6f244fd085aabbef2d95e23ce0521a17910136bc510 - Sigstore transparency entry: 1573880626
- Sigstore integration time:
-
Permalink:
wachawo/pydantic-ai-rag@c7eb0258816fe04e2b057ec2e94cddb467f616e6 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/wachawo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7eb0258816fe04e2b057ec2e94cddb467f616e6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pydantic_ai_rag-0.0.0-py3-none-any.whl.
File metadata
- Download URL: pydantic_ai_rag-0.0.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89eec645988326d4044cd8e8e38e07031100edb07ea8096bb4849e37193f656c
|
|
| MD5 |
55f3ba55538127f86d97180ccd077197
|
|
| BLAKE2b-256 |
e3b5fcd013cba8e4e69a23feb1de0fd36ad78f7f4c32e6799db790665914edd0
|
Provenance
The following attestation bundles were made for pydantic_ai_rag-0.0.0-py3-none-any.whl:
Publisher:
publish.yml on wachawo/pydantic-ai-rag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_ai_rag-0.0.0-py3-none-any.whl -
Subject digest:
89eec645988326d4044cd8e8e38e07031100edb07ea8096bb4849e37193f656c - Sigstore transparency entry: 1573880631
- Sigstore integration time:
-
Permalink:
wachawo/pydantic-ai-rag@c7eb0258816fe04e2b057ec2e94cddb467f616e6 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/wachawo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7eb0258816fe04e2b057ec2e94cddb467f616e6 -
Trigger Event:
push
-
Statement type: