Skip to content

About

My side-project about searching Python documentation (and maybe some PyPI libraries)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Python docs RAG

A side-project focused on searching Python documentation (and maybe PyPI libraries in the future) using retrieval-augmented generation.

TODO

Install and setup

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.

Prepare dataset in plain text files

Download Python documentation

curl -SO https://docs.python.org/3/archives/python-3.14-docs-text.zip

Unpack zip archive contents to rag-docs/.

Create vector store

Set EMBED_MODEL_KWARGS = {"device": "cuda"} in the file to speed up the embedding process.

python example_rag.py embed

Ask questions

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.

Examples

  • 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

About

My side-project about searching Python documentation (and maybe some PyPI libraries)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages