Metadata-Version: 2.4
Name: dynamanic-raggedy
Version: 0.2.0a0
Summary: Batteries-included, importable RAG core.
Project-URL: Homepage, https://github.com/Dynamanic/raggedy
Project-URL: Repository, https://github.com/Dynamanic/raggedy
Author-email: Mike Jackson <dynamanicllc@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: embeddings,llm,rag,retrieval,vector-search
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: asgiref>=3.8
Requires-Dist: httpx>=0.27
Requires-Dist: numpy>=1.26
Requires-Dist: pydantic-settings>=2.3
Requires-Dist: pydantic>=2.7
Requires-Dist: python-dotenv>=1.0
Requires-Dist: python-ulid>=2.7
Requires-Dist: pyyaml>=6.0
Provides-Extra: all
Requires-Dist: aiokafka>=0.11; extra == 'all'
Requires-Dist: aiosqlite>=0.20; extra == 'all'
Requires-Dist: anthropic>=0.34; extra == 'all'
Requires-Dist: asyncpg>=0.29; extra == 'all'
Requires-Dist: azure-storage-blob>=12.20; extra == 'all'
Requires-Dist: boto3>=1.34; extra == 'all'
Requires-Dist: chromadb>=0.5; extra == 'all'
Requires-Dist: faster-whisper>=1.0; extra == 'all'
Requires-Dist: google-api-python-client>=2.130; extra == 'all'
Requires-Dist: google-auth>=2.30; extra == 'all'
Requires-Dist: google-cloud-storage>=2.16; extra == 'all'
Requires-Dist: langdetect>=1.0.9; extra == 'all'
Requires-Dist: notion-client>=2.2; extra == 'all'
Requires-Dist: openai>=1.40; extra == 'all'
Requires-Dist: openpyxl>=3.1; extra == 'all'
Requires-Dist: pdf2image>=1.17; extra == 'all'
Requires-Dist: pgvector>=0.3; extra == 'all'
Requires-Dist: pillow>=10.0; extra == 'all'
Requires-Dist: pypdf>=4.0; extra == 'all'
Requires-Dist: pytesseract>=0.3.10; extra == 'all'
Requires-Dist: python-docx>=1.1; extra == 'all'
Requires-Dist: python-pptx>=0.6.23; extra == 'all'
Requires-Dist: qdrant-client>=1.10; extra == 'all'
Requires-Dist: sentence-transformers>=3.0; extra == 'all'
Requires-Dist: slack-sdk>=3.27; extra == 'all'
Requires-Dist: sqlite-vec>=0.1.3; extra == 'all'
Requires-Dist: striprtf>=0.0.26; extra == 'all'
Requires-Dist: torch>=2.2; extra == 'all'
Requires-Dist: weaviate-client>=4.6; extra == 'all'
Requires-Dist: youtube-transcript-api>=1.0; extra == 'all'
Requires-Dist: yt-dlp>=2024.10; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.34; extra == 'anthropic'
Provides-Extra: azure
Requires-Dist: azure-storage-blob>=12.20; extra == 'azure'
Provides-Extra: chroma
Requires-Dist: chromadb>=0.5; extra == 'chroma'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Requires-Dist: pymdown-extensions>=10; extra == 'docs'
Provides-Extra: docx
Requires-Dist: python-docx>=1.1; extra == 'docx'
Provides-Extra: gcs
Requires-Dist: google-cloud-storage>=2.16; extra == 'gcs'
Provides-Extra: github
Provides-Extra: gmail
Requires-Dist: google-api-python-client>=2.130; extra == 'gmail'
Requires-Dist: google-auth>=2.30; extra == 'gmail'
Provides-Extra: kafka
Requires-Dist: aiokafka>=0.11; extra == 'kafka'
Provides-Extra: langdetect
Requires-Dist: langdetect>=1.0.9; extra == 'langdetect'
Provides-Extra: local
Requires-Dist: sentence-transformers>=3.0; extra == 'local'
Requires-Dist: torch>=2.2; extra == 'local'
Provides-Extra: notion
Requires-Dist: notion-client>=2.2; extra == 'notion'
Provides-Extra: ocr
Requires-Dist: pdf2image>=1.17; extra == 'ocr'
Requires-Dist: pillow>=10.0; extra == 'ocr'
Requires-Dist: pypdf>=4.0; extra == 'ocr'
Requires-Dist: pytesseract>=0.3.10; extra == 'ocr'
Provides-Extra: ollama
Provides-Extra: openai
Requires-Dist: openai>=1.40; extra == 'openai'
Provides-Extra: pdf
Requires-Dist: pypdf>=4.0; extra == 'pdf'
Provides-Extra: pgvector
Requires-Dist: asyncpg>=0.29; extra == 'pgvector'
Requires-Dist: pgvector>=0.3; extra == 'pgvector'
Provides-Extra: pptx
Requires-Dist: python-pptx>=0.6.23; extra == 'pptx'
Provides-Extra: qdrant
Requires-Dist: qdrant-client>=1.10; extra == 'qdrant'
Provides-Extra: s3
Requires-Dist: boto3>=1.34; extra == 's3'
Provides-Extra: slack
Requires-Dist: slack-sdk>=3.27; extra == 'slack'
Provides-Extra: sqlitevec
Requires-Dist: aiosqlite>=0.20; extra == 'sqlitevec'
Requires-Dist: sqlite-vec>=0.1.3; extra == 'sqlitevec'
Provides-Extra: striprtf
Requires-Dist: striprtf>=0.0.26; extra == 'striprtf'
Provides-Extra: tavily
Provides-Extra: weaviate
Requires-Dist: weaviate-client>=4.6; extra == 'weaviate'
Provides-Extra: whisper
Requires-Dist: faster-whisper>=1.0; extra == 'whisper'
Provides-Extra: xlsx
Requires-Dist: openpyxl>=3.1; extra == 'xlsx'
Provides-Extra: youtube
Requires-Dist: google-api-python-client>=2.130; extra == 'youtube'
Requires-Dist: youtube-transcript-api>=1.0; extra == 'youtube'
Provides-Extra: ytdlp
Requires-Dist: yt-dlp>=2024.10; extra == 'ytdlp'
Description-Content-Type: text/markdown

# 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

```python
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.

```python
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`.

```sh
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
