A side-project focused on searching Python documentation (and maybe PyPI libraries in the future) using retrieval-augmented generation.
- show precise URLs like https://docs.python.org/3/library/pathlib.html#accessing-individual-parts
- html2text (pypi) can convert HTML to plain text usage
- support for libraries:
- pandas zip https://pandas.pydata.org/docs/
uv venv .venv
uv sync --compile-bytecode --no-install-package torch
uv pip install --torch-backend=cpu torch sentence-transformers
If using CUDA set torch backend in uv pip install command
or UV_TORCH_BACKEND env variable.
curl -SO https://docs.python.org/3/archives/python-3.14-docs-text.zip
Unpack zip archive contents to rag-docs/.
Set EMBED_MODEL_KWARGS = {"device": "cuda"} in the file to speed up the embedding process.
python example_rag.py embed
Set API keys in .env file and change llm = get_llm_* line in the script.
python example_rag.py chat --verbose
Markdown outputs are rendered using rich library.
- compress bytes using zstandard
- How to turn off global interpreter lock?
- What's new in Python 3.14?
- interesting to observe what chunks are retrieved, e.g.
whatsnew/2.3
- interesting to observe what chunks are retrieved, e.g.