A Python SDK for building AI agents with minimal code using Hawkins ecosystem with HawkinDB memory
Project description
Hawkins Agent Framework
A Python SDK for building AI agents with minimal code using the Hawkins ecosystem. This framework integrates key tools and services for building functional AI agents.
Features
- Seamless LLM Integration: Built-in support for LiteLLM, enabling easy integration with various language models
- Web Search Capabilities: Integrated Tavily search functionality for real-time information retrieval
- Memory Management: HawkinDB integration for efficient agent memory storage and retrieval
- Multi-Agent Orchestration: Advanced flow control system for coordinating multiple agents
- Tool Integration: Extensible tool system with pre-built tools for common tasks
- Email Functionality: Built-in email capabilities for agent communication
- Asynchronous Design: Built with modern async/await patterns for optimal performance
Installation
pip install hawkins-agent
Requires Python 3.11 or higher.
Quick Start
Here's a simple example to get you started:
from hawkins_agent import AgentBuilder
from hawkins_agent.tools import WebSearchTool
from hawkins_agent.mock import KnowledgeBase
async def main():
# Create a knowledge base
kb = KnowledgeBase()
# Create agent with web search capabilities
agent = (AgentBuilder("researcher")
.with_model("gpt-4o")
.with_knowledge_base(kb)
.with_tool(WebSearchTool())
.build())
# Process a query
response = await agent.process("What are the latest developments in AI?")
print(response.message)
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Advanced Usage
Multi-Agent Workflow
Create complex workflows with multiple specialized agents:
from hawkins_agent import AgentBuilder, FlowManager, FlowStep
from hawkins_agent.tools import WebSearchTool, WeatherTool
# Create specialized agents
research_agent = (AgentBuilder("researcher")
.with_model("gpt-4o")
.with_tool(WebSearchTool())
.build())
writer_agent = (AgentBuilder("writer")
.with_model("gpt-4o")
.build())
# Create flow manager
flow = FlowManager()
# Define workflow steps
async def research_step(input_data, context):
query = input_data.get("topic")
result = await research_agent.process(f"Research this topic: {query}")
return {"research": result.message}
async def writing_step(input_data, context):
research = context.get("research", {}).get("research")
result = await writer_agent.process(f"Write an article based on: {research}")
return {"article": result.message}
# Add steps to flow
flow.add_step(FlowStep(
name="research",
agent=research_agent,
process=research_step
))
flow.add_step(FlowStep(
name="writing",
agent=writer_agent,
process=writing_step,
requires=["research"]
))
# Execute flow
results = await flow.execute({"topic": "AI trends in 2024"})
Using Custom Tools
Create your own tools by extending the BaseTool class:
from hawkins_agent.tools.base import BaseTool
from hawkins_agent.types import ToolResponse
class CustomTool(BaseTool):
name = "custom_tool"
description = "A custom tool for specific tasks"
async def execute(self, query: str) -> ToolResponse:
try:
# Tool implementation here
result = await self._process(query)
return ToolResponse(success=True, result=result)
except Exception as e:
return ToolResponse(success=False, error=str(e))
Documentation
For more detailed documentation, see:
Examples
The examples/ directory contains several example implementations:
simple_agent.py: Basic agent usagemulti_agent_flow.py: Complex multi-agent workflowtool_test.py: Tool integration examplesblog_writer_flow.py: Content generation workflowmaldives_trip_planner.py: Travel planning agent system
Development
To contribute to the project:
- Clone the repository
- Install development dependencies:
pip install -e .[dev]
- Run tests:
pytest
License
MIT License - see the LICENSE file for details.
Credits
Built with ❤️ by the Hawkins AI team.
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 hawkins_agent-0.1.5.tar.gz.
File metadata
- Download URL: hawkins_agent-0.1.5.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
972fcba77dd9a91ca666c96c18d26be960e5ea416277ff4d68a61bb26328aaf1
|
|
| MD5 |
e290a6fc4ca8583707902cb6515f488d
|
|
| BLAKE2b-256 |
ec8038cc0e77996943cc9f18ec14c99630d21aee1a2089722ea903506b1fe76e
|
File details
Details for the file hawkins_agent-0.1.5-py3-none-any.whl.
File metadata
- Download URL: hawkins_agent-0.1.5-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfabf6eec8d2d5482e0d941f5a4d39b2a6c24de24a98d8ac29b6af064df31aa1
|
|
| MD5 |
291233c6f0303ba9197989e9982a9ff2
|
|
| BLAKE2b-256 |
1df528f00c5e05f55566246440c85b8460d7422f9dbbb5ec977c38412d403b07
|