Skip to main content

Batteries-included, importable RAG core.

Project description

Raggedy

Batteries-included, importable RAG core. pip install dynamanic-raggedy, then from raggedy import ... — drop it into any Python app.

Status

Pre-release (0.1.0a0). The library ships no mock providers — every LLM and embedder is a real adapter. Tests skip cleanly when no live LLM is reachable.

Phase 1 + intake + real providers shipped: in-memory store, deterministic embedder, semantic chunker, PII redaction (10 types, ephemeral map), cost tracking with daily limits, audit-run records, intake layer (files / directories / URLs / S3 → plain text / markdown / HTML / PDF / DOCX), and LLM adapters for Anthropic, OpenAI, Ollama, and LM Studio plus a GPU-aware local embedder (sentence-transformers, CUDA → MPS → CPU autodetect).

Quick start

from raggedy import Raggedy, RaggedyConfig, Document

rag = Raggedy(RaggedyConfig(
    llm="anthropic",                  # or "openai", "ollama", "lm_studio"
    llm_model="claude-haiku-4-5-20251001",
    embedding="sentence-transformers",
    embedding_model="sentence-transformers/all-MiniLM-L6-v2",
    device="auto",                    # CUDA → MPS → CPU
    store="memory",
    namespace="kb-handbook",
))

rag.ingest_sync([
    Document(id="hb-1", text="Refunds are processed within 5 business days."),
])

result = rag.query_sync("How long do refunds take?", top_k=4)
print(result.answer)
for s in result.sources:
    print(f"[Source {s.index}] {s.document_id} score={s.score:.3f}")
print(f"cost=${result.cost_usd:.6f} run_id={result.run_id}")

.env

Raggedy() calls python-dotenv once at construction and populates os.environ (without overriding existing vars). Drop your keys in a .env file at the project root:

ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
OLLAMA_HOST=http://localhost:11434
LMSTUDIO_BASE_URL=http://localhost:1234/v1

See .env.example for the full list.

Intake

Raggedy.ingest_from(source) streams documents through extractors before indexing.

from raggedy.intake import DirectorySource, UrlSource

rag.ingest_from_sync(DirectorySource("./docs"), tags={"corpus": "handbook"})
rag.ingest_from_sync(UrlSource(["https://example.com/blog"]))

Install

The PyPI distribution name is dynamanic-raggedy (the short name raggedy is taken by an unrelated maintained project). The import path is still raggedy.

pip install dynamanic-raggedy                  # base: deterministic embedder, in-memory store, intake stdlib parsers
pip install "dynamanic-raggedy[anthropic]"     # Anthropic LLM
pip install "dynamanic-raggedy[openai]"        # OpenAI LLM + embeddings; also powers LM Studio (OpenAI-compatible)
pip install "dynamanic-raggedy[ollama]"        # no extra deps — ollama uses base httpx
pip install "dynamanic-raggedy[local]"         # sentence-transformers + torch (GPU-aware)
pip install "dynamanic-raggedy[pdf]"           # PDF extractor (pypdf)
pip install "dynamanic-raggedy[docx]"          # DOCX extractor (python-docx)
pip install "dynamanic-raggedy[s3]"            # S3 source (boto3)
pip install "dynamanic-raggedy[sqlitevec]"     # SQLite-vec store
pip install "dynamanic-raggedy[pgvector]"      # pgvector store
pip install "dynamanic-raggedy[qdrant]"        # Qdrant store
pip install "dynamanic-raggedy[chroma]"        # Chroma store
pip install "dynamanic-raggedy[weaviate]"      # Weaviate store
pip install "dynamanic-raggedy[all]"           # everything

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

dynamanic_raggedy-0.2.0a0.tar.gz (168.3 kB view details)

Uploaded Source

Built Distribution

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

dynamanic_raggedy-0.2.0a0-py3-none-any.whl (158.2 kB view details)

Uploaded Python 3

File details

Details for the file dynamanic_raggedy-0.2.0a0.tar.gz.

File metadata

  • Download URL: dynamanic_raggedy-0.2.0a0.tar.gz
  • Upload date:
  • Size: 168.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for dynamanic_raggedy-0.2.0a0.tar.gz
Algorithm Hash digest
SHA256 57e841012bc8445eff350dc53fb429e3e2855ccff497d1e26bb4eafcf8656458
MD5 6881812b2d69a2c9ed22e84353dd56b5
BLAKE2b-256 a2afc6472b18befc7dd0bdead0172d5daa4c216db14d620f59b4586780355040

See more details on using hashes here.

File details

Details for the file dynamanic_raggedy-0.2.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamanic_raggedy-0.2.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b2d1914e84e8581a37827de9c5d75c2dcf3e17f64764a2917fb2439d85091d9
MD5 13f17abf9435d51472251c0d3c2f11a7
BLAKE2b-256 7ecec7abc9cb64cdfb284e7190cb0019a50e68e5fc5d9b16590a45e2af5c8eb5

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