Skip to main content

Smart RAG

A knowledge source any agent can use. Search returns evidence (snippets, stable ids, citations); the agent, or a person at the search box, writes the answer.

Status: skeleton (0.0.1). The query-plane Web API is complete as a contract and runs on an in-memory demo engine. The real index (PostgreSQL + pgvector + PGroonga, embeddings from OumiGo's /v1/embeddings), ingestion and the admin CLI are still to come.

Run

uv venv --python 3.12 && uv pip install -e '.[dev]'
.venv/bin/smartrag serve --demo --no-auth          # http://127.0.0.1:8710/docs
curl -s 'http://127.0.0.1:8710/v1/search?q=有給休暇の繰り越し' | python3 -m json.tool
.venv/bin/pytest

--no-auth is refused unless the server binds a loopback address. Otherwise clients send Authorization: Bearer <key>, checked against the hashed key file SMARTRAG_API_KEYS_FILE:

[{"key_id": "ui-search", "sha256": "<sha256 of the key>", "role": "reader", "delegate": true}]

Web API (query plane)

Method & path Purpose
GET /v1/sources What is indexed, filterable fields, freshness (no URIs, no credentials)
POST /v1/search Natural-language search: snippets, ids, citations; filters, cursors, facets
GET /v1/search?q= The same for the search box: one result per document, bookmarkable
GET /v1/chunks/{chunk_id} Read with scope=chunk|neighbors|section|document, paged by max_chars
GET /v1/documents/{doc_id} Metadata and outline; text in pages with include=text
POST /v1/feedback click / relevant / irrelevant for a query_id
GET /healthz, /readyz, /version Ops (no auth)
  • Errors always look like {"error": {"code", "message", "details"}}.
  • A chunk from an older document version returns 410 chunk_superseded, with the current version.
  • X-SmartRAG-On-Behalf-Of: <user> names the end user (keys with delegate only).

Admin operations (sources, sync, jobs, index, query logs, API keys, eval) are not part of the Web API by design: they run through the smartrag CLI on the operator host, and the query server holds no source credentials.

Layout

src/smartrag/
  models.py        request/response schemas (the contract)
  errors.py        errors with stable codes
  paging.py        opaque cursors bound to their request
  engine/          RetrievalEngine protocol; in-memory engine + demo corpus
  api/             FastAPI app: query routes, ops routes, auth, error shape
  cli/             `smartrag serve` (admin commands to come)

Metadata

Release files for smartrag 0.0.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 smartrag 0.0.1
File Size Uploaded Provenance Actions
smartrag-0.0.1.tar.gz 22.2 kB Without provenance Details for smartrag-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smartrag 0.0.1
File Interpreter ABI Platform Actions
smartrag-0.0.1-py3-none-any.whl Python 3 none any Details for smartrag-0.0.1-py3-none-any.whl

Total release size: 47.7 kB

Release files / smartrag-0.0.1.tar.gz

Download URL smartrag-0.0.1.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf9d6c14952c6b322dd64edf955f8c918689f54afa10c97f4c3207483eddca1c
BLAKE2b-256 checksum
How to use checksums
a259875282bbcc28b5fc020e40588c68d110c8d6abedd9a28c5af315ad5873f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / smartrag-0.0.1-py3-none-any.whl

Download URL smartrag-0.0.1-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9ec3459aac4cdb0f15d3c0bc356d54471fe4c3f3c7daa32d382c6d531e60230
BLAKE2b-256 checksum
How to use checksums
35f8a3d2f6ce5adac809d943bc7da3c9e40320e05a1fed78191a215f7f268b99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for smartrag 0.0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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