Metadata-Version: 2.4
Name: demystify-rag
Version: 0.3.0
Summary: Client SDK for dmstfy-rag: grounded RAG queries with citations, groundedness, abstention and SSE streaming
Project-URL: Homepage, https://github.com/demystify-systems/ai-services-tools/tree/main/modules/dmstfy-rag/packages/rag-py
Project-URL: Repository, https://github.com/demystify-systems/ai-services-tools
Author: Demystify Systems
License: MIT
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2
Provides-Extra: dev
Requires-Dist: mypy<2,>=1.13; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest<9,>=8; extra == 'dev'
Requires-Dist: ruff<0.9,>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# demystify-rag

Python client for the dmstfy-rag API — grounded RAG queries with citations, groundedness
scores, honest abstention and SSE streaming. Mirrors `@demystify/rag` (npm).

```python
from demystify_rag import AsyncRagClient

async with AsyncRagClient(base_url, key=key, product="jarvis") as rag:
    await rag.ingest("kb", doc_key="refund-policy", content=markdown)
    r = await rag.query("kb", "What's the refund window for annual plans?")
    if r.abstained:
        show_gap(r.clarifying_question)
    async for event in rag.query_stream("kb", "..."):
        if event["type"] == "delta":
            print(event["content"], end="")
```

A synchronous `RagClient` with the same surface is included. Errors raise `RagApiError`
with `.status`, `.code` (branch on this), `.type`, `.request_id`.
