Command Line Interface
The SDK ships three management commands. warmup_rag pre-builds RAG pipelines so the first chat request doesn’t pay the indexing cost, reindex_memories rebuilds every memory’s index from scratch, and refresh_integrations refreshes MCP integration tool lists.
warmup_rag: Pre-warm RAG Indexes
python manage.py warmup_ragWarms up every agent that has a rag_provider configured, across all memories. Agents without a RAG provider are skipped.
Options:
| Option | Description |
|---|---|
--agent <class_name> |
Only warm up a specific agent (class name, e.g. PirateBasicAgent) |
--memory <memory_id> |
Only warm up a specific memory |
--force-rebuild |
Rebuild indexes from scratch, deleting existing ones |
Examples:
# Everything
python manage.py warmup_rag
# One agent
python manage.py warmup_rag --agent PirateBasicAgent
# One memory
python manage.py warmup_rag --memory <memory-uuid>
# Full rebuild (persistent backends like Qdrant recreate from scratch)
python manage.py warmup_rag --force-rebuildreindex_memories: Rebuild Every Index
python manage.py reindex_memories # every memory
python manage.py reindex_memories --memory <id> # one memory
python manage.py reindex_memories --agent StrohmRuntimeAgentRebuilds each memory’s index once, from scratch, after a change to how documents are indexed: chunk size or overlap, meta_fields_to_embed, the embedding models. An index belongs to a memory, not to an agent, so one agent’s RAG config builds them all (--agent, default the first agent with a RAG provider); warmup_rag --force-rebuild instead rebuilds each memory once per agent. Memories without documents are skipped; a failure is reported per memory and the command exits with an error.
When to Use It
- Before deploying a new RAG setup: so indexes are ready when traffic arrives.
- After document changes: to keep retrieval current.
- As a scheduled job: e.g. a cron entry or
django-taskstask that re-warms nightly.
You can also trigger the same work from code:
from django_ai_sdk import Agent
agent = await AgentService.get(agent_id)
await Agent.warmup(agent, memory_id=None) # build + cache
await Agent.reindex(agent, memory_id=None, force_rebuild=False)
Agent.clear_rag_cache(agent)See the RAG section of the Agents guide for the full lifecycle.