Skip to main content

File-based RAG: Database-free vector storage for Retrieval-Augmented Generation. Store embeddings in .is files, no vector DB needed. Simple, portable, git-friendly.

Project description

ContextTape ๐Ÿ“ผ

PyPI version Python 3.9+ License: MIT Downloads

File-Based RAG Made Simple: Zero-infrastructure vector storage for Retrieval-Augmented Generation (RAG)

Build RAG systems without Pinecone, Weaviate, ChromaDB, or any vector database. Just files.

ContextTape stores text + embeddings in tiny .is segment files with 32-byte headers. Copy them anywhere, version in git, ship on USB drives. Works with OpenAI, LangChain, LlamaIndex, or any LLM.

pip install contexttape

โšก 60 Second Start

# Install
pip install contexttape
export OPENAI_API_KEY="sk-..."

# Create topics.txt
echo "Python_(programming_language)
Machine_learning
Artificial_intelligence" > topics.txt

# Build knowledge base (creates data/wiki/)
ct build-wiki --topics-file topics.txt --limit 3 --verbose

# Search it!
ct search "What is machine learning?"

That's it! Data is in data/wiki/segment_*.is. Copy it anywhere.

๐Ÿ‘‰ Full Quick Start Guide โ†’


๏ฟฝ Where Does Your Data Go?

Important: When you install via pip, the package code goes in site-packages/contexttape/. Your data gets created wherever you specify:

store = ISStore("my_store")        # Creates: ./my_store/ in current directory
store = ISStore("data/knowledge")  # Creates: ./data/knowledge/

๐Ÿ‘‰ Read WHERE_DATA_GOES.md for complete details


๏ฟฝ๐Ÿš€ Quick Start

Read this first: WHAT_YOU_GET.md โ€” Understand what actually gets created
Test it now: ./run_test.sh โ€” See the system in action
Simple guide: SIMPLE_GUIDE.md โ€” Common patterns and usage


๐Ÿš€ Why ContextTape?

Feature Traditional Vector DBs ContextTape
Infrastructure Server, Docker, cloud service Just files
Portability Database dumps, migrations cp -r / rsync
Memory footprint GB-scale indexes ~150MB for 500K tokens
Dependencies Heavy (Faiss, PGVector, etc.) Pure Python + NumPy
Transparency Opaque binary indexes Human-inspectable segments
Cold start Index loading time Instant (mmap)

Benchmarks

On a 50-document corpus (487K tokens):

  • Latency: 48ms median, 98ms p95
  • Throughput: 18.66 QPS
  • Memory: <154MB peak RSS
  • Storage: 4ร— smaller with int8 quantization

๐Ÿ“ฆ Installation

# Basic install
pip install contexttape

# With PDF support
pip install contexttape[pdf]

# With energy monitoring (Intel)
pip install contexttape[energy]

# Everything
pip install contexttape[all]

โšก Quick Start

Python API (3 lines to RAG)

from contexttape import ISStore, get_client, embed_text_1536

# Create a store and embed some docs
store = ISStore("my_knowledge")
client = get_client()  # requires OPENAI_API_KEY

docs = ["Neural networks are universal function approximators.",
        "Fire behavior depends on fuel, weather, and terrain.",
        "Quantum computing uses superposition and entanglement."]

for doc in docs:
    vec = embed_text_1536(client, doc)
    store.append_text_with_embedding(doc, vec)

# Search
query_vec = embed_text_1536(client, "how does quantum computing work?")
for score, text_id, vec_id in store.search_by_vector(query_vec, top_k=3):
    print(f"{score:.3f}: {store.read_text(text_id)[:80]}...")

CLI

# Set your API key
export OPENAI_API_KEY="sk-..."

# Ingest documents
ct ingest-path ./docs --out-dir my_store --exts md txt pdf

# Search
ct search "machine learning optimization" --topk 5

# Chat with retrieval
ct chat --topk 5 --verbose

๐Ÿงฑ The .is Segment Format

Each item is a single file:

[ 32-byte header ][ payload bytes ]

Header (little-endian):
โ”œโ”€ int32  next_id      # Link to paired segment
โ”œโ”€ int32  prev_id      # Back-link
โ”œโ”€ int32  data_len     # Payload size
โ”œโ”€ int32  data_type    # 0=text, 1=vec_f32, 2=vec_i8
โ”œโ”€ int32  dim          # Vector dimension (0 for text)
โ”œโ”€ float32 scale       # Quantization scale
โ””โ”€ 8 bytes reserved    # Timestamp

Text segment (data_type=0): UTF-8 payload, next_id โ†’ its vector
Vector segment (data_type=1|2): float32/int8 array, prev_id โ†’ its text


๐Ÿ”ฅ Key Features

  • ๐Ÿ—ƒ๏ธ No Vector DB โ€” Storage uses ordinary files, not Faiss/Milvus/PGVector
  • ๐Ÿ“ 32-byte Headers โ€” Minimal metadata linking text โ†” vectors
  • โšก Int8 Quantization โ€” 4ร— smaller with --quantize flag
  • ๐Ÿ”„ Late Dereference โ€” Read text only for top-k hits
  • ๐ŸŒ Multi-Store Fusion โ€” Merge results from multiple directories
  • ๐Ÿ“Š Hybrid Reranking โ€” Vector similarity + lexical overlap
  • ๐Ÿ”’ Append-Only โ€” Crash-safe, easy snapshotting
  • ๐Ÿชซ Energy-Aware Mode โ€” Reduce compute under power limits

๐Ÿ“– Documentation

Core Documentation

Examples & Tutorials

API Documentation

๐Ÿงน Cleaning Up

When you run examples, they create temporary directories (*_store/, *_ts/). These are user data, not source code:

bash cleanup_stores.sh  # Remove all temporary stores

See ORGANIZATION.md for details.


๐Ÿ—‚๏ธ Table of contents


Why ContextTape

  • Bring-your-own-files. Point it at any folder. Ingest text-like files out of the box; PDFs optionally via pypdf.
  • No vector DB required. Pairs of text and embeddings are stored as tiny .ts files on disk with minimal headers.
  • Deterministic, transparent storage. Every item is visible and inspectable as a file.
  • Composable. Works as a CLI and as a Python library; plug it into your own agents and services.
  • Lightweight retrieval. Cosine similarity for candidates, lexical overlap re-rank, and simple diversity heuristics.

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        CLI (ct)                          โ”‚
โ”‚  build-wiki | ingest-path | search | chat | stat    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚                          โ”‚
               โ–ผ                          โ–ผ
        Ingestion pipelines             Query layer
    (wiki, folder walker)        (embeddings + search + rerank)
               โ”‚                          โ”‚
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ–ผ
                       Storage subsystem
                    (ISStore: .is segment files)

Each .is file:
[ 32 bytes header ][ payload ]
- Text segment: UTF-8 text payload
- Vector segment: float32 embedding payload
- Headers link text <-> vector (next/prev IDs)

Quick start

# 1) Create and activate a virtual environment (optional but recommended)
python3 -m venv .venv
source .venv/bin/activate

# 2) Install
pip install contexttape
# or with PDF extraction
pip install contexttape[pdf]

# 3) Set your OpenAI API key (required for embeddings/chat)
export OPENAI_API_KEY="sk-..."

# 4) Build the small wiki showcase (50 topics)
ct build-wiki --topics-file scripts/topics.example.txt --out-dir wiki_store --limit 50 --verbose

# 5) Search the store
ct search "quantum computing applications" --topk 5

# 6) Chat with retrieval
ct chat --topk 5 --verbose

To ingest your own files:

# Ingest everything under ./docs (text-like files + PDFs if pypdf installed)
ct ingest-path ./docs --out-dir my_store --exts md txt pdf --max-pdf-pages 15 --verbose

Installation

Requirements:

  • Python 3.9+
  • openai (for embeddings/chat)
  • requests, beautifulsoup4 (for the wiki showcase only)
  • Optional: pypdf for PDF extraction

Install:

pip install contexttape
# or with optional dependencies
pip install contexttape[pdf]

Console entry point is ct.


CLI usage

Run ct --help for a full list of commands.

Build from wiki topics (showcase)

Takes titles from a text file (one title per line), fetches the pages, strips markup, embeds text (text-embedding-3-small), and writes text + embedding pairs into .ts files.

ct build-wiki \
  --topics-file scripts/topics.example.txt \
  --out-dir wiki_store \
  --limit 50 \
  --verbose
  • Output: wiki_store/segment_*.is
  • Each title yields two segments: one text .is, one vector .is linked via header IDs.

Ingest any path (generic)

Walks a folder or single file and ingests supported types. Best-effort decoding for text-like files; optional PDF support.

ct ingest-path ./my_docs \
  --out-dir my_store \
  --exts md txt pdf \
  --max-bytes 1048576 \
  --max-pdf-pages 20 \
  --verbose

Notes:

  • If --exts is omitted, a default set of text/code/log extensions plus .pdf is used.
  • PDFs are read only when pypdf is installed; otherwise PDFs are skipped.
  • Use --max-bytes to cap the size per text file, and --max-pdf-pages to cap PDF pages.

Search

Searches across the default stores (wiki_store via WIKI_IS_DIR, and chat_ts via CHAT_IS_DIR) with embedding similarity, re-ranks using lexical overlap, and prints top results with file paths.

ct search "fire propagation modeling" --topk 5

Youโ€™ll see something like:

[TOP 1] src=wiki score=0.4321 text_seg=12 emb_seg=13
  text_path=wiki_store/segment_12.is
  vec_path= wiki_store/segment_13.is
  preview: Fire propagation is influenced by fuel, weather, and topography ...

Chat

Retrieval-augmented chat that uses the selected context blocks (from wiki + chat stores) to form a prompt and calls a chat model.

ct chat --topk 5 --verbose

Special questions:

  • โ€œwhat was my first questionโ€ returns the earliest stored user message from the chat store (chat_ts), purely from .ts history.

Stats and maintenance

# Show counts, first headers, next_id, etc.
ct stat

# Reset chat store only (does not touch wiki or custom stores)
ct reset-chat

Programmatic API

Minimal example for building a store and searching.

from contexttape.storage import ISStore
from contexttape.embed import get_client, embed_text_1536
from contexttape.search import combined_search

# Build a store from in-memory strings
store = ISStore("example_store")
client = get_client()

docs = [
    "Neural networks are function approximators composed of layers.",
    "Fire behavior depends on fuel, weather, and terrain.",
    "Quantum computing leverages superposition and entanglement.",
]
for d in docs:
    vec = embed_text_1536(client, d)
    store.append_text_with_embedding(d, vec)

# Search the same store (as both wiki and chat, for simplicity)
q = "how does quantum entanglement help computation"
qvec = embed_text_1536(client, q)
hits = combined_search(q, qvec, wiki_store=store, chat_store=store, top_k=3)

for src, score, tid, eid in hits:
    text = store.read_text(tid)
    print(src, score, tid, eid, text[:120])

Storage format

Each item is a single .ts file:

[ 32-byte header ][ payload bytes ]

Header layout (little-endian, 32 bytes total):

int32 next_id
int32 prev_id
int32 data_len
int32 data_type   # 0 = text, 1 = vector_f32
int32 dim         # vector dimension, 0 for text
float32 scale     # reserved
8 bytes reserved
  • Text segment: data_type=0, payload = UTF-8 bytes. next_id points to its vector segment.
  • Vector segment: data_type=1, payload = float32[dim] in row-major order. prev_id points back to its text segment.

By convention, ISStore.append_text_with_embedding writes a text segment, then a vector segment, and links them in headers.


Configuration

Environment variables:

  • OPENAI_API_KEY โ€“ required for embeddings and chat.
  • WIKI_IS_DIR โ€“ default wiki store directory (default: wiki_real_ts or your chosen path).
  • CHAT_IS_DIR โ€“ default chat store directory (default: chat_ts).
  • TOP_K โ€“ default top-k in CLI search/chat (default: 5).
  • DEBUG_DIR โ€“ where verbose prompt/context logs are written when --verbose is used (default: debug).

You can also override store paths at runtime in the CLI with --out-dir for ingestion commands.


Performance notes

  • Chunking: The generic ingester reads whole files up to --max-bytes. For very large files, consider pre-chunking by paragraphs or sections before ingestion (roadmap includes first-class chunkers).
  • Embeddings: text-embedding-3-small is used by default (1536-d). Swap to a different model in embed.py if needed.
  • Re-ranking: After cosine candidate generation, lexical overlap on normalized tokens boosts topical precision. Adjust weights in search.py if you need a different balance.
  • Parallel ingestion: Current reference CLI is single-process by default for simplicity. You can parallelize ingestion in your own wrapper or extend the CLI.
  • Disk: .ts files are extremely small for short texts. Large corpora will produce many files; on Linux/macOS this is generally fine, but you can shard into subfolders if you prefer (roadmap).

Troubleshooting

  • ImportError: cannot import name 'iter_files': Ensure src/contexttape/ingest_generic.py exists and you reinstalled the package with pip install -e ..
  • ct: command not found: Verify the venv is active and pip install -e . succeeded. Reopen your shell or re-activate the venv.
  • PDF text extraction is empty: Install optional extra pip install -e .[pdf] and try again. Some PDFs have no extractable text; OCR is out of scope for the reference implementation.
  • OpenAI errors: Ensure OPENAI_API_KEY is set and the model names used in embed.py and cli.py exist for your account.

Security and privacy

  • ContextTape writes your source texts to disk as UTF-8 text segments alongside their embeddings. Treat the store directory as sensitive if your sources are not public.
  • The default reference implementation sends content to OpenAI for embeddings and chat. If you require air-gapped or self-hosted embeddings, you can swap out embed.py to call your own embedding model and keep the rest of the system unchanged.

Commands overview

  1. ct build-wiki

Fetches wiki pages by title and ingests as text+vector pairs.

Usage

ct build-wiki
--topics-file scripts/topics.example.txt
--out-dir wiki_store
--limit 50
--min-chars 800
--verbose

Flags

--topics-file (required): Text file with one title per line.

--out-dir: Target store for the pages (default $WIKI_IS_DIR).

--limit: Max number of titles to ingest.

--min-chars: Skip very short pages.

--skip-fences: Skip lines starting with ``` during topic loading (defaults to on).

--verbose: Print progress.

  1. ct ingest-path

Generic folder/file ingester for text-like files (+ optional PDFs).

Usage

Ingest specific extensions

ct ingest-path ./docs
--out-dir wiki_store
--exts md txt pdf
--max-bytes 1048576
--max-pdf-pages 20
--follow-symlinks
--verbose

Flags

path (positional): File or directory.

--out-dir: Target store (default $WIKI_IS_DIR).

--exts: One or more extensions (without dots or with) to include.

--max-bytes: Per-file read cap for text files.

--max-pdf-pages: Pages to parse per PDF (requires PyMuPDF/pypdf depending on your impl).

--follow-symlinks: Traverse symlinks.

--verbose: Print progress.

Tip: If you need images/audio/video/blobs, use ingest-any (below), not ingest-path.

  1. ct ingest-any

Best-effort ingestion of mixed modalities (text, image, audio, pdf, video, other blobs).

Usage

ct ingest-any ./sample_corpus
--out-dir wiki_store
--quantize
--max-bytes 1048576
--verbose

Flags

path (positional): File or directory.

--out-dir: Target store (default $WIKI_IS_DIR).

--quantize: Store vectors as int8 (space-saving).

--max-bytes: Fallback read cap for arbitrary binary if needed.

--verbose: Print progress.

What it does

Text (.txt,.md,.json,.yaml,.csv,.tsv,.logโ€ฆ): embeds the content.

Images (.png,.jpg,...): embeds the pixels (via embed_image) and stores a JSON manifest (caption + optional blob reference).

Audio (.wav,.mp3,...): embeds the audio (via embed_audio) and stores a JSON manifest (+ optional blob).

PDF: extracts text (when supported), embeds it, stores a JSON manifest (+ optional blob).

Video (.mp4,.mov,...): default = a filename summary embedded (you can later extend to keyframes).

Other: stored as โ€œblobโ€ with filename summary embedded.

  1. ct search

Searches your stores and prints per-store results (wiki and chat) separately.

Usage

ct search "photosynthesis light reaction"
--topk 8
--wiki-dir wiki_store --chat-dir chat_ts
--verbose

Flags

query (positional): Your search text.

--topk: Candidate count per fused pass (default $TOP_K).

--wiki-topk: Override per-store top-k shown for WIKI section.

--chat-topk: Override per-store top-k shown for CHAT section.

--wiki-dir, --chat-dir: Override store locations.

--energy-aware: Auto-tune k/stride to save energy (see below).

--max-power-budget: Power cap hint for energy-aware mode (Watts).

--verbose: Also prints file paths and previews.

What youโ€™ll see

=== WIKI RESULTS === โ€ฆ top items from the wiki store only.

=== CHAT RESULTS === โ€ฆ top items from the chat store only.

  1. ct chat

Retrieval-augmented chat. It:

searches both stores,

selects relevant blocks with thresholds,

builds a prompt that includes labeled sections:

USER CHAT (recent turns),

KNOWLEDGE (retrieved context, split by WIKI vs CHAT),

WIKI (unfused top-k) and CHAT (unfused top-k) as safety nets,

calls the chat model,

appends the turn to the chat store.

Typical usage

ct chat
--wiki-dir wiki_store --chat-dir chat_ts
--topk 8
--alpha 0.55
--min-score 0.32
--min-lex 0.12
--min-hybrid 0.28
--max-context-blocks 5
--verbose

Important knobs (what they mean & how to set them)

--topk How many candidate chunks to consider from the fused search (hybrid scoring) before relevance gating.

Start: 8

Raise (12โ€“20) for broader retrieval; lower (3โ€“5) for speed.

--alpha Hybrid scoring weight between vector similarity and lexical overlap:

hybrid

๐›ผ โ‹… vector_sim โ€…โ€Š + โ€…โ€Š ( 1 โˆ’ ๐›ผ ) โ‹… lex_overlap hybrid=ฮฑโ‹…vector_sim+(1โˆ’ฮฑ)โ‹…lex_overlap

1.0 = pure vector; 0.0 = pure lexical.

Start around 0.5โ€“0.7.

More abstract/semantic queries โ†’ push up (0.65โ€“0.8).

Precise keyword queries โ†’ push down (0.3โ€“0.5).

--min-score Minimum vector similarity to keep a block during gating.

Start: 0.30โ€“0.35.

If youโ€™re missing relevant blocks, lower it slightly. If you see noise, raise it.

--min-lex Minimum lexical overlap to keep a block. Helps ensure term alignment.

Start: 0.10โ€“0.15.

Raise if you want stricter keyword alignment; lower if phrasing varies a lot.

--min-hybrid Minimum final score after hybrid mix to keep a block.

Start: 0.25โ€“0.30.

This is the final gateโ€”if relevant content isnโ€™t making it in, reduce this slightly.

--max-context-blocks Hard cap on how many retrieved blocks will be put into the prompt.

Start: 5.

If answers feel under-informed, try 6โ€“8 (watch token cost).

--energy-aware, --max-power-budget Enables an adaptive policy that lowers topk and increases stride (skips some segments) when under power pressure.

Useful on laptops/servers to save watts.

E.g. --energy-aware --max-power-budget 12.

Reading the verbose output

=== WIKI (unfused top-k) === / === CHAT (unfused top-k) === These are per-store quick scans (no fusion) shown to the model as a backstop, ensuring the assistant can โ€œseeโ€ the best pure-vector matches from each store even if the fused/gated list got too strict.

===== NO KNOWLEDGE SELECTED (or filtered) ===== Means the gates removed everything (often because the prompt was small talk like โ€œhiโ€). Lower thresholds if this happens on real questions.

Pro tips

If you reset the chat store, your first turns wonโ€™t have chat memory yet; thatโ€™s normal.

If a WIKI block appears unrelated, check thresholds; sometimes vector sim is high but lex is lowโ€”tighten --min-lex or raise --min-hybrid.

  1. ct stat

Counts segments/pairs and computes an exact token count by re-encoding stored texts.

Usage

ct stat --wiki-dir wiki_store --chat-dir chat_ts

Output

Number of text/vector segments, pairs, next_id.

Total tokens (useful to estimate embedding/storage cost).

  1. ct bench

Micro-benchmark: size, tokens, latency, QPS, memory, and energy hints.

Usage

ct bench
--wiki-dir wiki_store --chat-dir chat_ts
--queries-file /tmp/queries.txt
--max-queries 50
--repeats 5
--topk 8
--energy-aware
--max-power-budget 15
--assume-power-watts 15
--out-json bench.json
--out-csv bench.csv
--out-md bench.md
--verbose

Flags

--queries-file: Newline-separated queries (fallback to built-ins if omitted).

--max-queries: Cap how many queries to use from the file.

--repeats: Number of passes over the set (stabilizes stats).

--topk, --energy-aware, --max-power-budget: Same behavior as chat/search.

--assume-power-watts: If hardware energy meters are missing, estimate energy as Watts ร— elapsed_time.

--out-json|--out-csv|--out-md: Save a structured report(s).

Report fields (high value)

Latency (wall_ms_p50, p95, mean), qps_mean

Memory (rss_mb_max, pss_mb_max if available)

Energy backend + Joules (pkg/dram if available or assumed)

Store sizes (MB), tokens, pairs

  1. ct reset-chat

Clears the chat store directory (does not touch wiki).

Usage

ct reset-chat --chat-dir chat_ts

Tuning guide (quick recipes)

A) Exact-ish keyword Q&A over your docs

ct chat
--alpha 0.4
--min-lex 0.18
--min-hybrid 0.32
--topk 10
--max-context-blocks 6
--verbose

More weight on lexical; slightly stricter hybrid minimum.

B) Conceptual / semantic queries (looser phrasing)

ct chat
--alpha 0.7
--min-score 0.30
--min-lex 0.10
--min-hybrid 0.26
--topk 12
--max-context-blocks 6
--verbose

More vector weighting; easier lex gate so synonyms survive.

C) Battery-saver / constrained

ct chat
--topk 6
--max-context-blocks 4
--energy-aware
--max-power-budget 12
--verbose

Common pitfalls & fixes

โ€œNo knowledge selectedโ€ even for real questions

Lower --min-hybrid a bit, e.g. 0.28 โ†’ 0.24

Lower --min-lex (e.g. 0.15 โ†’ 0.10)

Raise --topk (e.g. 8 โ†’ 12)

Irrelevant wiki blocks show up

Raise --min-lex and/or --min-hybrid

Lower --alpha if your queries rely on precise keywords

Images/audio show in search but not meaningful

Thatโ€™s expected unless you add captioning/transcription. The ingest-any manifest helps, but for rich semantics, add real image captioning / ASR and embed that text too.

ct not found / stale code

Reinstall after edits: pip install -e .

Reactivate venv or open a new shell.

Custom file extension

Set CTX_SEG_EXT=.custom to write/read segment_*.custom (default: .is).

Debugging: what verbose mode writes

When you run with --verbose, we also write:

debug/hits.json โ€“ raw hits (source, score, tid, eid)

debug/context.md โ€“ the exact retrieved blocks sent to the model

debug/prompt.txt โ€“ the full prompt used

Use these to tune thresholds and verify per-store sections are included.

One last sanity check

If you want to force clear separation in outputs when testing:

ct search "kamala harris"
--wiki-dir wiki_store --chat-dir chat_ts
--topk 8 --verbose

You should see two blocks in the output:

=== WIKI RESULTS === ...only wiki... === CHAT RESULTS === ...only chat...

And in ct chat --verbose, youโ€™ll see:

=== KNOWLEDGE (retrieved context) === split into WIKI CONTEXT and CHAT MEMORY, plus

=== WIKI (unfused top-k) === and === CHAT (unfused top-k) ===.

Roadmap

  • Pluggable chunkers (headings, paragraphs, code-aware).
  • Pluggable rerankers (BM25, LLM-based, hybrid scoring).
  • Named stores: query across multiple stores with selection rules.
  • Streaming ingestion and background workers.
  • Optional sharded store layout for very large corpora.
  • Optional FAISS/HNSW index builder for faster approximate nearest neighbor search.

Contributing

  1. Fork the repository and create a branch.
  2. Use ruff or black for formatting (optional).
  3. Add tests if you alter core storage or search behavior.
  4. Open a PR and describe the change, rationale, and any compatibility notes.

License

Licensed under the MIT License. See LICENSE for details.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contexttape-0.5.0.tar.gz (343.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contexttape-0.5.0-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file contexttape-0.5.0.tar.gz.

File metadata

  • Download URL: contexttape-0.5.0.tar.gz
  • Upload date:
  • Size: 343.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for contexttape-0.5.0.tar.gz
Algorithm Hash digest
SHA256 297970e809e8bc4da171442c1d333b6cc0406462b5d102bd92c3901a1c776bb9
MD5 a687d03d180a51003b2ba5f4e495f797
BLAKE2b-256 901c84d7a4ae071b7c5ea1c1c8f807d3458f35f809ef675ce63ce902238bc41b

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexttape-0.5.0.tar.gz:

Publisher: publish-to-pypi.yml on NuTerraLabs/RAGLite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contexttape-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: contexttape-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for contexttape-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9a6672f24ea5c7809b7dcecc68f5ea40067087126551f4908d6d06c59dbc7a4
MD5 27030d600b7eda968ca9c0e90bff40a7
BLAKE2b-256 149d5afb06b1669fed65ce0c1db66443e4f04e906fabd319775c0ea16c19cca6

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexttape-0.5.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on NuTerraLabs/RAGLite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page