Metadata-Version: 2.4
Name: django-agentkore
Version: 0.1.0
Summary: A Django extension for scaffolding and managing AI agents in Django projects
Author-email: David Lapsley <davidlapsleyio@gmail.com>
License: MIT License
        
        Copyright (c) 2025 David Lapsley
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/davidlapsleyio/django-agentkore
Project-URL: Repository, https://github.com/davidlapsleyio/django-agentkore.git
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django>=3.2
Requires-Dist: openai>=0.27.0
Dynamic: license-file

# 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

```bash
pip install agentkore
```

### Using uv

You can also install using [uv](https://github.com/astral-sh/uv), a fast Python package installer and resolver:

```bash
# 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

1. Add `agentkore` to your `INSTALLED_APPS` in your Django settings:

```python
INSTALLED_APPS = [
    # ... other apps
    'agentkore',
]
```

2. Run the `startagent` command to create a new agent:

```bash
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

```python
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:

```python
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:

```python
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
```
