Skip to main content

rag-plug

Python client for the RAGPlug backend API. It supports adding documents to memory, semantic search, schema retrieval, and deleting items by ID (sync and async).

Features

  • RagPlug client with typed response models.
  • API key authentication through X-API-Key.
  • Operations scoped to a target memory (memory_name).
  • Ready-to-run Python examples in examples/.
  • CLI helper scripts for quick add/search flows.

Requirements

  • Python 3.10+
  • Poetry (recommended)

Installation

poetry install

For local editable install with pip:

pip install -e .

Configuration

Create a .env file in the project root:

API_KEY=your_api_key
MEMORY_NAME=your_memory_name

.env is already listed in .gitignore and should not be committed.

Python Usage

from ragplug import RagPlug

client = RagPlug(api_key="YOUR_API_KEY", default_memory_name="main")

item = client.add(
    {
        "text": "Paris is the capital of France",
        "source": "docs",
    }
)

response = client.search("capital of France", field_name="text", top_k=3)
schema = client.schema()
client.delete(item.id)

Async usage:

import asyncio
from ragplug import RagPlug


async def main() -> None:
    client = RagPlug(api_key="YOUR_API_KEY", default_memory_name="main")
    item = await client.aadd({"text": "Async memory text"})
    response = await client.asearch("Async memory", field_name="text", top_k=3)
    await client.adelete(item.id)
    print(response.results)


asyncio.run(main())

Examples

The repository includes runnable examples:

  • examples/sync_usage.py
  • examples/async_usage.py

Run them with:

set -a; source .env; set +a

poetry run python examples/sync_usage.py
poetry run python examples/async_usage.py

CLI Scripts

  • scripts/add_memory.py
  • scripts/search.py

Example:

set -a; source .env; set +a

poetry run python scripts/add_memory.py \
  --api-key "$API_KEY" \
  --memory-name "$MEMORY_NAME" \
  --document '{"text":"Smoke test memory","source":"scripts"}'

poetry run python scripts/search.py \
  --api-key "$API_KEY" \
  --memory-name "$MEMORY_NAME" \
  --query "Smoke test" \
  --field-name "text" \
  --mode "naive" \
  --top-k 5

Development Commands

poetry check
poetry build
poetry run python -m compileall ragplug scripts examples

If you use Taskfile:

task all

Release

CI publishes to PyPI for tags matching v*. The tag must match the package version in pyproject.toml.

Example:

poetry version patch
git tag v$(poetry version -s)
git push origin --tags

Project Structure

  • ragplug/client.py: public RagPlug facade.
  • ragplug/types.py: response models and RagPlugError.
  • ragplug/_api.py, _transport.py, _error_handler.py, _validation.py, _response_parser.py: internal client layers.
  • examples/: sync/async usage examples.
  • scripts/: CLI utilities.

Metadata

Release files for rag-plug 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rag-plug 0.2.1
File Size Uploaded Provenance Actions
rag_plug-0.2.1.tar.gz 4.8 kB With provenance Details for rag_plug-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rag-plug 0.2.1
File Interpreter ABI Platform Actions
rag_plug-0.2.1-py3-none-any.whl Python 3 none any Details for rag_plug-0.2.1-py3-none-any.whl

Total release size: 12.3 kB

Release files / rag_plug-0.2.1.tar.gz

Download URL rag_plug-0.2.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0ac0fa56e9f0dbd77019cff06c508e43051d33224cbbeb6c51bcd3ac3dabcc90
BLAKE2b-256 checksum
How to use checksums
24c1f1caf762cc55bae1cf3ebe95593511370fc0eb1dae9aef79f25d5742e43c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 15, 2026.

Transparency log

Release files / rag_plug-0.2.1-py3-none-any.whl

Download URL rag_plug-0.2.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
076b388dbed466a95d513cc93999f600d67a2ddd483013961b44e63377d76786
BLAKE2b-256 checksum
How to use checksums
3c5ae66e69b202520c00ea93685001442cc4d3c9a213e97730afddf92bd3d955
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 15, 2026.

Transparency log

Security for rag-plug 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rag_plug-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page