Skip to main content

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.
  • 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


Download files

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

Source Distribution

streamwish-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

streamwish-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file streamwish-0.1.0.tar.gz.

File metadata

  • Download URL: streamwish-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for streamwish-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b74dd11c483a494e77e5147f3ce391f3c05c60ceb5ce46d8aaf82247602bd9c4
MD5 345cace68d4db291b474f826ea65b07a
BLAKE2b-256 7b7a58c2179ec76868e1969fe09a227eb2e7fca69e2083ac5e73c29a503287c7

See more details on using hashes here.

File details

Details for the file streamwish-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: streamwish-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for streamwish-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 646d67e8b907d89883ed6219a61cfafe9dcbbc045aa03d91e8b113218117233e
MD5 3b0e26eb42ced0331baea74e689920f5
BLAKE2b-256 eae8857e1eb6e510484f68b876878c13632d82283ff3e11c8c1f96ce234db3af

See more details on using hashes here.

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