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.3.0a0.tar.gz (231.5 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.3.0a0-py3-none-any.whl (200.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynamanic_raggedy-0.3.0a0.tar.gz
  • Upload date:
  • Size: 231.5 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.3.0a0.tar.gz
Algorithm Hash digest
SHA256 3721a129a347442d9f494b5d73862ad882aba759a4a694509653ee651377e666
MD5 4c8b512b300a65afeffbb0634f3365f9
BLAKE2b-256 eaa2e0375ba3cbd76f49f9d58a70854bb22a271c8cf1f471b863eda7901d9209

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dynamanic_raggedy-0.3.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 742fa4a15bb42386942d465cb13302927b16c20a1e8a61cab466fae84c197b70
MD5 393f8bf4562a0792c96bb70e99a20eba
BLAKE2b-256 ba527921d85324ef12658fc7b8dd187dfdfa951ced8fc9b366d70e2342d575a1

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