Skip to main content

ragmir

Agentic RAG on your infrastructure, with exact citations, for Python agents and RAG apps.

Ragmir indexes a project's code, PDFs, Office files, scans, mail, and design files on your machine, and returns passages cited to lines, pages, slides, cells, or objects. A question the documents cannot answer returns nothing, so your application can say so instead of guessing.

  • Any model: the index does not depend on the LLM that writes the answer, so you can switch between Claude, GPT, Gemini, Mistral, or a local model without re-indexing.
  • No GPU, no vector database: the default retrieval runs offline on the CPU, and the index is an embedded store in the project's git-ignored .ragmir/ folder.
  • Your data stays where you run it: no account, telemetry, or hosted store.
  • Measured: rgr evaluate scores retrieval on your own questions and fails CI when it regresses.
pip install ragmir

Requires Python 3.11 or later. Ragmir itself runs through Node.js 22.12 or later, or Docker, on macOS, Windows, or Linux; the default retrieval needs no model, and the system requirements list what semantic models and OCR add. The client uses the project's own npm install of @jcode.labs/ragmir when there is one, else a global rgr, else the matching npm release through npx, else the ghcr.io/jcode-works/ragmir image. Set RAGMIR_COMMAND to choose another command.

Index a project and search it

from ragmir import Ragmir, add_sources, init_project

init_project("my-project")
add_sources("my-project", ["docs/**/*.md", "contracts/**/*.pdf"])

with Ragmir("my-project") as rag:
    rag.ingest()  # incremental: only new and changed files are read again
    for passage in rag.search("termination notice period", top_k=3):
        print(passage.citation, passage.weak_evidence)
        print(passage.text)

Ragmir keeps one MCP server running for the project and reuses it for every call. It works from any thread, a notebook, or a web framework, and each method has an async twin (asearch, aexpand, asources, aknowledge_audit, aingest, and so on). Asyncio services can use AsyncRagmir directly.

  • search(query, top_k=, include_paths=, exclude_paths=, scope=, searches=) returns Passage objects with citation, path, text, line or page ranges, weak_evidence, and source_status. Path filters take folders, files, or globs such as "**/*.pdf". searches adds up to five of your own formulations, fused into one ranking: lex keywords ("phrase" required, -word excluded), a vec paraphrase, or a hyde likely answer.
  • search_many(queries) answers up to five related questions in one call.
  • expand(citation, context_radius=1) returns the passage with its neighbours; expand next_citation to read a long document through. A citation the index no longer holds comes back with suggested_citation or similar_paths, and a Markdown page with its links.
  • sources(paths=["contracts/**"]) lists the indexed documents with their front matter titles; changed_since= adds the files changed since a time, and outline=True one document's sections.
  • status() and audit() report readiness and coverage; knowledge_audit() checks Markdown pages as a knowledge base: broken links, missing pages, changed citations, and stale sources.
  • run_cli(project, "doctor") runs any rgr command, for example an ingest with local OCR, which Ragmir leaves to an explicit operator command.

LangChain and LlamaIndex

Read the Python guide and ragmir.com. Ragmir is open source under AGPL-3.0-only, with a commercial license available from JCode Works.

Metadata

Release files for ragmir 6.17.2

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

Source distribution (sdist)

Source distribution for ragmir 6.17.2
File Size Uploaded Provenance Actions
ragmir-6.17.2.tar.gz 30.2 kB Without provenance Details for ragmir-6.17.2.tar.gz

Built distribution (wheel)

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

Total release size: 60.5 kB

Release files / ragmir-6.17.2.tar.gz

Download URL ragmir-6.17.2.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6808d7af8edeb0b65be9ddd88303581750be5fdf381bf6035e80bfd4b25dcb5c
BLAKE2b-256 checksum
How to use checksums
1613586969eb59db730fa7ab9831a3e6ce71c9aebe23c2830b3f56abfed95c54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ragmir-6.17.2-py3-none-any.whl

Download URL ragmir-6.17.2-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24ba27354de16151f25aa562b0a78f6f2d595dad045035c817972558b67c1772
BLAKE2b-256 checksum
How to use checksums
a951b8b22e36fd924ca4a0ecf9afbc7d75eb83214e620733102246ff0f4ef879
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for ragmir 6.17.2

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.

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