Skip to main content

ReAG SDK - Reasoning Augmented Generation framework for Python

Project description

🎓 ReAG Python SDK

Installation

  1. Ensure Python 3.9+ is installed.
  2. Install using pip or poetry:
    pip install reag
    # or
    poetry add reag
    

Quick Start

from reag.client import ReagClient, Document


 async with ReagClient() as client:
        docs = [
            Document(
                name="Superagent",
                content="Superagent is a workspace for AI-agents that learn, perform work, and collaborate.",
                metadata={
                    "url": "https://superagent.sh",
                    "source": "web",
                },
            ),
        ]
        response = await client.query("What is Superagent?", documents=docs)

API Reference

Initialization

Initialize the client by providing required configuration options:

client = new ReagClient(
  model: "o3-mini", // LiteLLM model name
  system: Optional[str] // Optional system prompt
  batchSize: Optional[Number] // Optional batch size
  schema: Optional[BaseModel] // Optional Pydantic schema
);

Document Structure

Documents should follow this structure:

document = Document(
    name="Superagent",
    content="Superagent is a workspace for AI-agents that learn, perform work, and collaborate.",
    metadata={
        "url": "https://superagent.sh",
        "source": "web",
    },
)

Querying

Query documents with optional filters:

docs = [
    Document(
        name="Superagent",
        content="Superagent is a workspace for AI-agents that learn, perform work, and collaborate.",
        metadata={
            "url": "https://superagent.sh",
            "source": "web",
            "id": "sa-1",
        },
    ),
    Document(
        name="Superagent",
        content="Superagent is a workspace for AI-agents that learn, perform work, and collaborate.",
        metadata={
            "url": "https://superagent.sh",
            "source": "web",
            "id": "sa-2",
        },
    ),
]
options = {"filter": [{"key": "id", "value": "sa-1", "operator": "equals"}]}
response = await client.query(
    "What is Superagent?", documents=docs, options=options
)

Response structure:

content: str
reasoning: str
is_irrelevant: bool
document: Document

Example filters:

  • Filter by metadata field:
    options = {"filter": [{"key": "id", "value": "sa-1", "operator": "equals"}]}
    
  • Filter by numeric values:
    options = {
      "filter": [{"key": "version", "value": 2, "operator": "greaterThanOrEqual"}]
    }
    

Contributing

We welcome contributions from the community. Please refer to the CONTRIBUTING.md file for guidelines on reporting issues, suggesting improvements, and submitting pull requests.

License

This project is licensed under the MIT License.

Additional Resources

Contact

For support or inquiries, please contact:

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

reag-0.0.4.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

reag-0.0.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file reag-0.0.4.tar.gz.

File metadata

  • Download URL: reag-0.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for reag-0.0.4.tar.gz
Algorithm Hash digest
SHA256 af0d5c2531dd68e9c2da528bed70c15d6cc3326b7aff7cdfce39e62410a60762
MD5 c88b3df82b26616a6bad25839c28d57c
BLAKE2b-256 e43cf073b4b62ead2e128b89c3a42ad29f48c17da4f665d762a3b0b178ec6b8e

See more details on using hashes here.

File details

Details for the file reag-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: reag-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for reag-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e39011082dcae80ef3bafd43488a3c468c35beaa0c98df4149e55e0481cf7b8d
MD5 4fbd56f9355d7bfb17dfacdaa6365867
BLAKE2b-256 e2a9172ee7c95ba14c1790c3b7912d5b5a802d422a579b9af73d62df9759d1ac

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