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.1.0a0.tar.gz (78.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.1.0a0-py3-none-any.whl (81.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynamanic_raggedy-0.1.0a0.tar.gz
  • Upload date:
  • Size: 78.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.1.0a0.tar.gz
Algorithm Hash digest
SHA256 5f7233c89b652a89b088fff5cc3d05107665db9f105dfde5ea84532263ca0749
MD5 7612160bec595c8678129e5da38c9410
BLAKE2b-256 dbc8ce0b7d4a37425db4f84c274ea7070d17a558e70c60300e6455cb05683c40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dynamanic_raggedy-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a1a1dce3d668aad3773726fa4643f7bb243e17de7d0904627b29f42fa09acca
MD5 e89530c4340ce4092c20f11c76682d4b
BLAKE2b-256 697e4d8eb4f3aa4c6e0acffc3929da6a66614361e194845f709cf11b6f541fe0

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