A Django extension for scaffolding and managing AI agents in Django projects
Project description
django-agentkore
A Django extension for scaffolding and managing LLM-based agents in your Django projects.
Features
- Django management command for agent scaffolding (
startagent) - Base agent classes and utilities
- Agent auto-discovery in Django projects
- Easily integrate AI agents into your Django applications
Installation
pip install agentkore
Using uv
You can also install using uv, a fast Python package installer and resolver:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and activate a virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install agentkore
uv pip install agentkore
Setting up in your Django project
- Add
agentkoreto yourINSTALLED_APPSin your Django settings:
INSTALLED_APPS = [
# ... other apps
'agentkore',
]
- Run the
startagentcommand to create a new agent:
python manage.py startagent myagent
This will create the following structure:
agents/
myagent/
__init__.py
agent.py
prompt_templates/
base.txt
tests/
__init__.py
test_myagent.py
Using your agent
from agents.myagent import MyagentAgent
# Create an instance of your agent
agent = MyagentAgent()
# Process a user prompt
response = agent.run("What's the weather like today?")
Auto-discovering agents
The AgentRegistry class can automatically discover all agents in your project:
from agentkore.kore import discover_agents
# Discover all agents in the 'agents' directory
agents = discover_agents()
# Get a list of all available agent names
agent_names = list(agents.keys())
Creating Custom Agents
Extend the BaseAgent class to implement your own AI agents:
from agentkore.kore import BaseAgent
import openai
class WeatherAgent(BaseAgent):
def run(self, prompt, context=None):
# Use OpenAI to process weather queries
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a weather assistant."},
{"role": "user", "content": prompt}
]
)
return response.choices[0].message.content
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_agentkore-0.1.0.tar.gz.
File metadata
- Download URL: django_agentkore-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d44a9597520c4bc04e68f5c193e1a363eef4444303764dc1afb867e923bfadd
|
|
| MD5 |
0da401fe26f65d3424a32cbee7bb0237
|
|
| BLAKE2b-256 |
7203e297bd956c87901caa8be5fa26b46ff68dd4c07f5219c021c5ff7c98cfbf
|
File details
Details for the file django_agentkore-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_agentkore-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd1d09cc56209c5434a3806388fe1ed7af0879c138e7f6d3ed94504b46f3da82
|
|
| MD5 |
3cde058d56fd03f3d1977afafe542a0f
|
|
| BLAKE2b-256 |
a5a33a34249d5ac7b5762c6267ff6b8c17306b2e2de33d23b116c173521f548b
|