django-admin-agent
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) andintrospect.*(model schema, admin registration) tools, derived from your installed models. Every call is typed and audited throughdjango-ag-ui'sAuditLogger. - 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-destructivein 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 aSidebarAdminSitefor those who prefer to subclass. - Themeable, with skills — configure the theme (light / dark / auto / code),
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 ondjango-ag-ui>=0.67and 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.10–3.14, Django 4.2–6.0.
Full documentation: https://artui.github.io/django-admin-agent/
pip install django-admin-agent
# expose the admin tools as an HTTP MCP server too:
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 the
[mcp] server.
License
MIT — see LICENSE.
Metadata
Release files for django-admin-agent 0.50.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_admin_agent-0.50.0.tar.gz | 450.9 kB | With provenance | Details for django_admin_agent-0.50.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_admin_agent-0.50.0-py3-none-any.whl | Python 3 | none | any | Details for django_admin_agent-0.50.0-py3-none-any.whl |
Total release size: 679.9 kB
Release files / django_admin_agent-0.50.0.tar.gz
| Download URL | django_admin_agent-0.50.0.tar.gz |
|---|---|
| Size | 450.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddaa91ac8de1eb0c584d3536aba042f89cb7fc2815985dcaec711b2e57f8398c
|
|
BLAKE2b-256 checksum How to use checksums |
5e19ade4cfdb72e756cf6a0e5109d605fc4a6c129d693ef28cc4f5c15558583d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 6, 2026.
Transparency logRelease files / django_admin_agent-0.50.0-py3-none-any.whl
| Download URL | django_admin_agent-0.50.0-py3-none-any.whl |
|---|---|
| Size | 229.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c3afc159e7b8dc068074037b76c13d8a171a1fe21ce7d368a9efe0b67c66833
|
|
BLAKE2b-256 checksum How to use checksums |
c9848c02254e235ca2923181065690fb7d9a24c278078a2b36ae8caea4e57d1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 6, 2026.
Transparency logSecurity for django-admin-agent 0.50.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for django_admin_agent-0.50.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 Oct 6, 2026.
Transparency logA 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.