Skip to main content

django-ragamuffin

django-ragamuffin adds OpenAI-backed document retrieval and conversational querying to Django applications. It supports assistant-specific instructions, uploaded document collections, multimodal query context, reasoning models, and optional Mathpix PDF extraction.

Requirements

  • Python 3.11 or newer
  • Django 5.2.17 or newer, below Django 6.1
  • OpenAI Python SDK 3.6.0 or newer
  • PostgreSQL

Installation

pip install django-ragamuffin

Add grappelli before Django's admin application, then add Ragamuffin and its database router to your Django settings:

INSTALLED_APPS = [
    "grappelli",
    "django.contrib.admin",
    # The rest of the Django applications...
    "django_ragamuffin",
]

DATABASE_ROUTERS = [
    "django_ragamuffin.db_routers.RagamuffinRouter",
]

DJANGO_RAGAMUFFIN_DB = "django_ragamuffin"
OPENAI_UPLOAD_STORAGE = "/subdomain-data/query"
USE_CHATGPT = True

AI_MODEL = "gpt-6.1-sol"
AI_MODELS = {
    "staff": AI_MODEL,
    "default": AI_MODEL,
}
EFFORT = "medium"

Configure the OpenAI API key in the process environment:

export OPENAI_API_KEY="..."

The package includes its Django migrations. Apply them only through the deployment's approved database-migration procedure.

Add the application URLs:

from django.urls import include, path

urlpatterns = [
    path("grappelli/", include("grappelli.urls")),
    path("django_ragamuffin/", include("django_ragamuffin.urls")),
]

Optional Mathpix extraction

Set USE_MATHPIX=True and provide APP_ID and APP_KEY to enable Mathpix PDF conversion. Without those credentials, Mathpix integration remains disabled.

License

MIT

Metadata

Release files for django-ragamuffin 3.6.0.9

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

Source distribution (sdist)

Source distribution for django-ragamuffin 3.6.0.9
File Size Uploaded
django_ragamuffin-3.6.0.9.tar.gz 73.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-ragamuffin 3.6.0.9
File Interpreter ABI Platform
django_ragamuffin-3.6.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 162.7 kB

Release files / django_ragamuffin-3.6.0.9.tar.gz

Download URL django_ragamuffin-3.6.0.9.tar.gz
Size 73.5 kB
Tags Source
SHA-256 checksum
How to use checksums
29f9802ab5431f5428af3bde047a0124b1ef380c070cef8ba6785878a199a5ce
BLAKE2b-256 checksum
How to use checksums
b9db0466e681dde8200f8f038218df7f8fbd4bca3fb571e423647a1f689f5361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / django_ragamuffin-3.6.0.9-py3-none-any.whl

Download URL django_ragamuffin-3.6.0.9-py3-none-any.whl
Size 89.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebd8193d8b4783e7855dce70885235ae15f9bae062cd4e28951ff854bb03dbc4
BLAKE2b-256 checksum
How to use checksums
2085ae4b4e358d2388c39d846775ab7e8c2a40b2813a867b6f8164c5bf56429d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

3.6.0.9 This release

2 release files

1.74.2

2 release files

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