Metadata-Version: 2.4
Name: djgent
Version: 0.4.0
Summary: Django AI Agent Framework - Build AI agents with LangChain integration in Django
Project-URL: Homepage, https://github.com/borhanst/djgent
Project-URL: Documentation, https://github.com/borhanst/djgent#readme
Project-URL: Repository, https://github.com/borhanst/djgent.git
Project-URL: Issues, https://github.com/borhanst/djgent/issues
Project-URL: Changelog, https://github.com/borhanst/djgent/blob/main/CHANGELOG.md
Author-email: Borhan <mdborhan.st@gmail.com>
Maintainer-email: Borhan <mdborhan.st@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai,anthropic,chatbot,django,gemini,google,groq,langchain,langgraph,llm,machine-learning,ollama,openai
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Requires-Dist: django<6.1,>=5.2
Requires-Dist: djangorestframework>=3.17.1
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langchain-openai>=1.1.10
Requires-Dist: langchain>=0.3.0
Requires-Dist: langgraph>=1.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: all
Requires-Dist: djangorestframework>=3.15; extra == 'all'
Requires-Dist: duckduckgo-search>=8.0.0; extra == 'all'
Requires-Dist: httpx>=0.28.0; extra == 'all'
Requires-Dist: langchain-anthropic>=0.3.0; extra == 'all'
Requires-Dist: langchain-community>=0.3.0; extra == 'all'
Requires-Dist: langchain-google-genai>=0.3.0; extra == 'all'
Requires-Dist: langchain-groq>=0.3.0; extra == 'all'
Requires-Dist: langchain-mcp-adapters>=0.1.0; extra == 'all'
Requires-Dist: langchain-ollama>=0.3.0; extra == 'all'
Requires-Dist: langchain-openai>=0.3.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: langchain-anthropic>=0.3.0; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: black>=24.0.0; extra == 'dev'
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: pytest-django>=4.8.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.5.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Provides-Extra: drf
Requires-Dist: djangorestframework>=3.15; extra == 'drf'
Provides-Extra: google
Requires-Dist: langchain-google-genai>=0.3.0; extra == 'google'
Provides-Extra: groq
Requires-Dist: langchain-groq>=0.3.0; extra == 'groq'
Provides-Extra: http
Requires-Dist: httpx>=0.28.0; extra == 'http'
Provides-Extra: mcp
Requires-Dist: langchain-mcp-adapters>=0.1.0; extra == 'mcp'
Provides-Extra: ollama
Requires-Dist: langchain-ollama>=0.3.0; extra == 'ollama'
Provides-Extra: openai
Requires-Dist: langchain-openai>=0.3.0; extra == 'openai'
Provides-Extra: search
Requires-Dist: duckduckgo-search>=8.0.0; extra == 'search'
Requires-Dist: langchain-community>=0.3.0; extra == 'search'
Description-Content-Type: text/markdown

# Djgent

Django AI Agent Framework for building AI agents with LangChain integration in
Django applications.

## Installation

```bash
pip install djgent
```

Or install with `uv`:

```bash
uv add djgent
```

## Basic Setup

Add `djgent` to your Django project:

```python
INSTALLED_APPS = [
    # ...
    "djgent",
]
```

Configure your LLM provider:

```python
DJGENT = {
    "DEFAULT_LLM": "openai:gpt-4o-mini",
    "API_KEYS": {
        "OPENAI": "your-openai-api-key",
    },
}
```

Run migrations when using database-backed memory or the built-in chat UI:

```bash
python manage.py migrate
```

## Default Chat View

Djgent includes a default chat UI you can mount in your project.

Add the chat app:

```python
INSTALLED_APPS = [
    # ...
    "djgent",
    "djgent.chat",
]
```

Configure the chat:

```python
DJGENT = {
    "DEFAULT_LLM": "openai:gpt-4o-mini",
    "API_KEYS": {
        "OPENAI": "your-openai-api-key",
    },
    "CHAT_UI": {
        "TITLE": "AI Assistant",
        "TOOLS": ["calculator", "datetime"],
        "AUTO_LOAD_TOOLS": True,
        "SYSTEM_PROMPT": "You are a helpful assistant.",
    },
}
```

Mount the default chat URLs:

```python
from django.urls import include, path

urlpatterns = [
    path("chat/", include("djgent.chat.urls")),
]
```

Then open `/chat/` in your browser.

To add the optional site-wide chat bubble, enable it in settings:

```python
DJGENT = {
    # ...
    "CHAT_UI": {
        "BUBBLE_ENABLED": True,
        "BUBBLE_TITLE": "Ask AI",
    },
}
```

And render it in your base template:

```django
{% load djgent_chat %}
{% djgent_chat_bubble %}
```

Create and run an agent:

```python
from djgent import Agent

agent = Agent.create(name="assistant")
response = agent.run("What is Djgent?")
print(response)
```

## Full Documentation

See the [full Djgent documentation on GitHub](https://github.com/borhanst/djgent#readme).
