StreamWish: A Retrieval-Augmented Generation (RAG) library optimized for small context windows using graph traversal.
Project description
StreamWish 🌠
StreamWish is a "Streaming Graph RAG" library designed for Small Language Models (SLMs) and high-velocity data streams. It solves the "Small Context Window" problem using a Conveyor-Belt Graph and a Token Auctioneer.
Features
- Conveyor-Belt Graph: Manages a sliding window of knowledge nodes.
Stream: [Chunk 1] -> [Chunk 2] -> [Chunk 3]
|
Graph: (Node A) --[rel]--> (Node B)
|
Auctioneer: [ Slot 1: Query ]
[ Slot 2: Node A ] <-- Highest Bidder
[ Slot 3: Path X ]
- Token Auctioneer: Smartly allocates limited context slots to the most valuable information (Query, Summary, Neighborhood, Path).
- Context Distillation: Automatically shrinks incoming data chunks using LLM summarization.
- Pluggable Backends: Works with OpenAI, Gemini, or local models via
LLMBackend. - Generic Ingestion: Supports
.txt,.pdf,.xlsx, and Google Drive/GCP.
Why StreamWish? (VS The Big Players)
1. The "10-Slot" Philosophy Most RAG libraries (LangChain, LlamaIndex, Graphiti) optimize for finding the right answer assuming you have a 128k+ context window to fit it all in. StreamWish is built for the Edge / SLM era. It assumes you can only "see" 10 items at a time. It uses a Token Auctioneer to ruthlessly prioritize what gets into that tiny window.
2. Streaming vs. Batch "Graph RAG" (like Microsoft's implementation) usually requires processing all your documents at once to build community clusters. This is slow and expensive. StreamWish is stateful and streaming. It builds the graph node-by-node as data flows in (like a conveyor belt), making it perfect for real-time feeds, chat logs, or live sensor data.
Installation
pip install streamwish
Quick Start
from streamwish.manager import SlotManager
from streamwish.llm_interface import OpenAIAdapter
# 1. Initialize
llm = OpenAIAdapter(api_key="your-key")
manager = SlotManager(llm_client=llm)
# 2. Ingest Data
manager.ingest_stream([
"StreamWish optimizes context for small models.",
"It uses a graph traversal algorithm."
])
# 3. Query
response = manager.process_query("How does StreamWish handle small context?")
print(response)
License
MIT
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 streamwish-0.1.2.tar.gz.
File metadata
- Download URL: streamwish-0.1.2.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ab9c096199af05f0688f97bcadf354c982c313373d309222bc66f603b2ab7b2
|
|
| MD5 |
708dc1e9bd3a8449ac7bff1a00a57270
|
|
| BLAKE2b-256 |
767a004ec1d236cff61c1dce630b852f94428d83d21f105c3269bf27fb8564a2
|
File details
Details for the file streamwish-0.1.2-py3-none-any.whl.
File metadata
- Download URL: streamwish-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f07e1ddcc7e2f3a737b6e8f695832b5e9c9f72e7b8b3ee5838ef64f94efd59
|
|
| MD5 |
f53c7d237f1256d60ab5f764b135293e
|
|
| BLAKE2b-256 |
4973a14464af87572e6b0e39d9f011255e7a93e4d596c71f07b71ab02c2c3076
|