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/agents-web-components
<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 — 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 ondjango-ag-ui>=0.85.0and the matching@artooi/agents-web-components. - 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.
# 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:applicationThe 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.
MIT — see LICENSE.