Skip to main content

django-admin-agent

CI PyPI Python versions Django versions Docs Coverage Ruff License

An always-present chat-agent sidebar embedded in the Django admin. The agent reads your data through typed, server-side tools and drives the admin UI — filling forms, applying filters, navigating between pages — with visible animations and a confirmation modal on anything destructive.

It builds on django-ag-ui (the Django ↔ Pydantic-AI ↔ AG-UI bridge) and ships the @artooi/ag-ui-web-component <ag-ui-chat> element vendored as a static bundle — there's no separate npm install. Works with the vanilla Django admin and with Django Unfold.

  • Server-side admin tools — a default registry of read-only shell.* (query / count / fetch instances) and introspect.* (model schema, admin registration) tools, derived from your installed models. Every call is typed and audited through django-ag-ui's AuditLogger.
  • Frontend tool handlers — nav.* and DOM-driving tools (fill a field, click, apply a changelist filter) execute in the browser against the live admin page, with animations so the user sees what the agent is doing.
  • Destructive-action gating — tools flagged x-destructive in their JSON Schema are intercepted by a confirmation modal before they run.
  • Drop-in sidebar — a {% django_admin_agent_sidebar %} template tag (no admin-site swap) or a SidebarAdminSite for those who prefer to subclass.
  • Themeable, with skills — the panel takes the admin's own accent and font; configure the theme (Quiet / Soft / Ledger / Classic; light / dark / auto), density, placement, text animation, and tool-call display mode from DJANGO_ADMIN_AGENT, and surface a catalog of one-click skills as composer chips and a /-command palette. Built on django-ag-ui>=0.74.0 and the matching @artooi/ag-ui-web-component.
  • Voice & model thoughts — set DJANGO_AG_UI["TRANSCRIPTION_BACKEND"] to add a mic to the composer (server-side transcription), and a reasoning model's streamed chain-of-thought renders in a collapsible "thoughts" region. Both ride on the re-vendored web component; voice is off until a backend is configured.
  • Unfold-aware — a runtime JS shim adapts the sidebar to Unfold's chrome; any Python Unfold introspection is lazy and guarded, so Unfold stays optional.
  • 100% test coverage, type-checked, Python 3.11–3.14, Django 4.2–6.1.

Full documentation: https://artui.github.io/django-admin-agent/

pip install django-admin-agent
# offer the agent a django-spec-mcp server's tools, AdminAgentServer(mcp_server=...):
pip install "django-admin-agent[mcp]"

ASGI required. The agent endpoint streams Server-Sent Events, which the sync WSGI worker can't serve — deploy the admin under Daphne / Uvicorn.


Quick start

# settings.py
INSTALLED_APPS = [
    # ...
    "django.contrib.admin",
    "django_admin_agent",
]
# urls.py
from django.contrib import admin
from django.urls import path

from django_admin_agent import AdminAgentServer

urlpatterns = [
    path("admin/", admin.site.urls),
    # Mounts the agent server over the default shell.* + introspect.* registry.
    path("admin-agent/", AdminAgentServer(model="anthropic:claude-sonnet-4.6").urls),
]
{# templates/admin/base_site.html — override so it wins over the admin app's copy #}
{% extends "admin/base.html" %}
{% load django_admin_agent %}

{% block branding %}
  <h1 id="site-name"><a href="{% url 'admin:index' %}">My admin</a></h1>
  {% django_admin_agent_sidebar %}
{% endblock %}

That's the whole wiring: the template tag computes its own context (endpoint URL, title, auto-confirm flag, bootstrap module, route map), so the admin site doesn't need swapping. Serve it over ASGI:

uvicorn myproject.asgi:application

The model can be set per-mount (AdminAgentServer(model=...)) or globally via DJANGO_AG_UI["MODEL"]. See the docs for the full tool surface, configuration reference, the SidebarAdminSite path, Unfold support, and an MCP server's tools through the [mcp] extra.

License

MIT — see LICENSE.

Metadata

Release files for django-admin-agent 0.61.0

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-admin-agent 0.61.0
File Size Uploaded Provenance Actions
django_admin_agent-0.61.0.tar.gz 519.0 kB With provenance Details for django_admin_agent-0.61.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-agent 0.61.0
File Interpreter ABI Platform Actions
django_admin_agent-0.61.0-py3-none-any.whl Python 3 none any Details for django_admin_agent-0.61.0-py3-none-any.whl

Total release size: 778.7 kB

Release files / django_admin_agent-0.61.0.tar.gz

Download URL django_admin_agent-0.61.0.tar.gz
Size 519.0 kB
Tags Source
SHA-256 checksum
How to use checksums
476588cdeed2e5e21493eb8fd4986c2bc1b6cc25deeb61aa20f87e66346c01e8
BLAKE2b-256 checksum
How to use checksums
000fe48c4e7a77db1b7672b8e7bb06b74348868306a9fc42379ca94284f428d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 9, 2026.

Transparency log

Release files / django_admin_agent-0.61.0-py3-none-any.whl

Download URL django_admin_agent-0.61.0-py3-none-any.whl
Size 259.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ae645ab36038c6818a1f0063147bd24ff79b259d32b483436888160c39a3fee
BLAKE2b-256 checksum
How to use checksums
496e619de1b894e1d34323136728f52dffada383e2349cbfff5142b9d99ac127
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 9, 2026.

Transparency log

Security for django-admin-agent 0.61.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_admin_agent-0.61.0.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 Nov 9, 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.

Release history Release notifications | RSS feed

This release

0.61.0 This release

2 release files Full 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