Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pretty_name: "Python Standard Library Docs — rlat knowledge model"
|
| 6 |
+
tags:
|
| 7 |
+
- retrieval
|
| 8 |
+
- knowledge-model
|
| 9 |
+
- resonance-lattice
|
| 10 |
+
- rlat
|
| 11 |
+
- embeddings
|
| 12 |
+
- python
|
| 13 |
+
- standard-library
|
| 14 |
+
- cpython
|
| 15 |
+
- programming
|
| 16 |
+
size_categories:
|
| 17 |
+
- 1M<n<10M
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Python Standard Library Docs — rlat knowledge model
|
| 21 |
+
|
| 22 |
+
Prebuilt [Resonance Lattice](https://github.com/tenfingerseddy/resonance-lattice-cli)
|
| 23 |
+
knowledge model over **[python/cpython](https://github.com/python/cpython)** (scoped to `Doc/`), built for
|
| 24 |
+
retrieval-augmented coding assistants and LLM context injection.
|
| 25 |
+
|
| 26 |
+
**Audience:** Python developers working with the standard library — dataclasses, typing, asyncio, pathlib, and more.
|
| 27 |
+
|
| 28 |
+
## Two variants — which do you want?
|
| 29 |
+
|
| 30 |
+
| File | Size | When to pick |
|
| 31 |
+
|------|------|------|
|
| 32 |
+
| [`python-stdlib.rlat`](./python-stdlib.rlat) | 215 MB | **Remote** — knowledge model pins to a GitHub commit SHA. Source text is fetched from `https://github.com/python/cpython` on first query and cached locally. Freshest; smaller download. Needs network on first query. |
|
| 33 |
+
| [`python-stdlib-bundled.rlat`](./python-stdlib-bundled.rlat) | 409 MB | **Bundled** — fully self-contained. Source text is packed inside the `.rlat` as zstd frames. Works offline forever. Larger download; no drift tracking. |
|
| 34 |
+
|
| 35 |
+
**Pick bundled** if you care about reliability, offline use, or air-gapped environments.
|
| 36 |
+
**Pick remote** if you want automatic freshness via `rlat freshness` / `rlat sync`, or if you plan to query from CI where cold-cache fetches are fine.
|
| 37 |
+
|
| 38 |
+
Both variants serve **identical retrieval quality** — same field, same registry, same encoder (BGE-large-en-v1.5 with random projection heads, 5 bands × 2048 dim, 8-bit quantized registry, zstd compressed).
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
# Install the CLI (one-time)
|
| 44 |
+
pip install resonance-lattice
|
| 45 |
+
|
| 46 |
+
# Download one of the variants (pick bundled for zero-network queries):
|
| 47 |
+
huggingface-cli download tenfingers/python-stdlib-rlat python-stdlib-bundled.rlat --local-dir .
|
| 48 |
+
|
| 49 |
+
# Query:
|
| 50 |
+
rlat search python-stdlib-bundled.rlat "how do I use dataclasses with default factory"
|
| 51 |
+
rlat ask python-stdlib-bundled.rlat "how do I use dataclasses with default factory"
|
| 52 |
+
|
| 53 |
+
# Use as Claude / Cursor / ChatGPT context:
|
| 54 |
+
rlat resonate python-stdlib-bundled.rlat "how do I use dataclasses with default factory" --format context | pbcopy
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Sample queries
|
| 58 |
+
|
| 59 |
+
- `how do I use dataclasses with default factory`
|
| 60 |
+
- `difference between asyncio tasks and coroutines`
|
| 61 |
+
- `best way to read a large file line by line`
|
| 62 |
+
- `pathlib vs os.path for file operations`
|
| 63 |
+
|
| 64 |
+
## Corpus provenance
|
| 65 |
+
|
| 66 |
+
- **Upstream repo:** https://github.com/python/cpython
|
| 67 |
+
- **Scope:** `Doc/` subdirectory only
|
| 68 |
+
- **Pinned commit SHA:** `76b3923d688c0efc580658476c5f525ec8735104`
|
| 69 |
+
- **Files indexed:** 619
|
| 70 |
+
- **Chunks (semantic passages):** 12,737
|
| 71 |
+
- **Encoder:** `BAAI/bge-large-en-v1.5` with 5 random projection heads (2048 dim × 5 bands)
|
| 72 |
+
- **Registry compression:** 8-bit quantized (≈75% size reduction, ≥0.99 per-band cosine similarity vs fp32)
|
| 73 |
+
- **Build flags:** `--quantize-registry 8 --compression zstd --path Doc`
|
| 74 |
+
- **Build date:** 2026-04-22
|
| 75 |
+
|
| 76 |
+
## Licensing
|
| 77 |
+
|
| 78 |
+
- **Source content:** Python Software Foundation License — all retrieved passages retain upstream licensing. Attribution to the upstream repo is required for redistribution.
|
| 79 |
+
- **Knowledge model artifact** (field + registry + metadata): [Business Source License 1.1](https://mariadb.com/bsl11/) — same license as the [Resonance Lattice project](https://github.com/tenfingerseddy/resonance-lattice-cli).
|
| 80 |
+
|
| 81 |
+
## Keeping it fresh (remote variant only)
|
| 82 |
+
|
| 83 |
+
```bash
|
| 84 |
+
# Read-only drift check — one GitHub API call
|
| 85 |
+
rlat freshness python-stdlib.rlat
|
| 86 |
+
|
| 87 |
+
# Pull upstream diff into the local knowledge model
|
| 88 |
+
rlat sync python-stdlib.rlat
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
`rlat sync` fetches only the files that changed between the pinned SHA and upstream HEAD, rechunks them, and reconciles against the existing registry. Cost is proportional to the diff, not the full corpus.
|
| 92 |
+
|
| 93 |
+
## Citation
|
| 94 |
+
|
| 95 |
+
If you use this rlat in research, please cite:
|
| 96 |
+
|
| 97 |
+
```
|
| 98 |
+
@misc{resonance-lattice-rlats-2026,
|
| 99 |
+
title = {Resonance Lattice launch rlats},
|
| 100 |
+
author = {Snyder, Kane},
|
| 101 |
+
year = {2026},
|
| 102 |
+
howpublished = {HuggingFace Hub, \url{https://huggingface.co/datasets/tenfingers/python-stdlib-rlat}}
|
| 103 |
+
}
|
| 104 |
+
```
|