A modern, extensible indus-agents for building autonomous agents with LLMs
Project description
indus-agents
A modern, extensible indus-agents for building autonomous agents with Large Language Models (LLMs). Built with Python, featuring a clean architecture, type safety, and async-first design.
Features
- Clean Architecture: Modular design with clear separation of concerns
- Type Safe: Built with Pydantic models for robust data validation
- Async First: Native async/await support for high-performance applications
- Tool System: Extensible tool interface for agent capabilities
- Multiple LLM Support: Works with OpenAI, Anthropic, and other providers
- Beautiful CLI: Rich terminal interface with intuitive commands
- Comprehensive Testing: Full test coverage with pytest
- Developer Friendly: Easy to extend, customize, and integrate
Quick Start
Installation
Using uv (Recommended)
# Install uv if you haven't already
pip install uv
# Create a virtual environment and install
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install indusagi
Using pip
# Create a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install the package
pip install indusagi
Development Installation
# Clone the repository
git clone https://github.com/varunisrani/indus-agents.git
cd indus-agents
# Install with development dependencies
uv pip install -e ".[dev]"
Usage
Basic Example
import asyncio
from indusagi import Agent, AgentConfig
async def main():
# Create an agent with configuration
config = AgentConfig(
name="MyAssistant",
model="gpt-4",
temperature=0.7
)
agent = Agent(config=config)
# Run the agent
response = await agent.run("What is the capital of France?")
print(response)
if __name__ == "__main__":
asyncio.run(main())
Using Tools
from indusagi import Agent, AgentConfig, BaseTool, ToolConfig, ToolResult
class CalculatorTool(BaseTool):
def __init__(self):
config = ToolConfig(
name="calculator",
description="Performs basic arithmetic operations",
parameters={
"operation": {"type": "string", "enum": ["add", "subtract", "multiply", "divide"]},
"a": {"type": "number"},
"b": {"type": "number"}
}
)
super().__init__(config)
async def execute(self, operation: str, a: float, b: float) -> ToolResult:
operations = {
"add": a + b,
"subtract": a - b,
"multiply": a * b,
"divide": a / b if b != 0 else None
}
result = operations.get(operation)
if result is None:
return ToolResult(success=False, result=None, error="Invalid operation or division by zero")
return ToolResult(success=True, result=result)
# Create agent with tool
agent = Agent(config=AgentConfig(name="Calculator Agent"))
agent.add_tool(CalculatorTool())
Configuration
Create a .env file in your project root:
# OpenAI Configuration
OPENAI_API_KEY=your_api_key_here
OPENAI_ORG_ID=your_org_id_here
# Agent Configuration
DEFAULT_MODEL=gpt-4
DEFAULT_TEMPERATURE=0.7
MAX_TOKENS=2000
# Application Configuration
LOG_LEVEL=INFO
LOG_FILE=agent.log
# Framework Configuration
ENABLE_HISTORY=true
MAX_HISTORY_LENGTH=100
CLI Commands
The framework includes a powerful CLI for managing agents:
# Show version
indusagi version
# Run an agent with a prompt
indusagi run "Tell me a joke"
# Run with verbose output
indusagi run "Explain quantum computing" --verbose
# Show configuration
indusagi config --show
Project Structure
indusagi/
├── src/
│ └── indusagi/
│ ├── __init__.py # Package exports
│ ├── cli.py # Command-line interface
│ ├── agent/ # Agent implementations
│ │ ├── __init__.py
│ │ └── base.py # Base agent class
│ ├── core/ # Core functionality
│ │ ├── __init__.py
│ │ ├── agent.py # Main agent
│ │ └── config.py # Configuration
│ ├── tools/ # Tool system
│ │ ├── __init__.py
│ │ └── base.py # Base tool class
│ └── utils/ # Utilities
│ ├── __init__.py
│ └── logger.py # Logging utilities
├── tests/ # Test suite
├── examples/ # Example scripts
├── docs/ # Documentation
├── pyproject.toml # Project configuration
├── README.md # This file
├── CHANGELOG.md # Version history
├── CONTRIBUTING.md # Contribution guidelines
└── LICENSE # MIT License
Development
Setup Development Environment
# Install development dependencies
uv pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=indusagi --cov-report=html
# Run specific test file
pytest tests/test_agent/test_base.py
# Run with verbose output
pytest -v
Code Quality
# Format code with Black
black src tests
# Lint with Ruff
ruff check src tests
# Fix linting issues automatically
ruff check --fix src tests
# Type checking with mypy
mypy src
Building the Package
# Build distribution packages
python -m build
# This creates:
# - dist/indusagi-0.1.0-py3-none-any.whl
# - dist/indusagi-0.1.0.tar.gz
Architecture
Core Components
- Agent: Main agent implementation with tool support and conversation history
- BaseAgent: Abstract base class for creating custom agents
- AgentConfig: Configuration model for agent behavior
- BaseTool: Abstract base class for creating tools
- ToolConfig: Configuration model for tools
- ToolResult: Standardized result format from tool execution
Design Principles
- Modularity: Each component has a single, well-defined responsibility
- Extensibility: Easy to add new agents, tools, and capabilities
- Type Safety: Pydantic models ensure data validation and IDE support
- Async First: All I/O operations are async for better performance
- Testability: Dependency injection and clear interfaces for easy testing
Examples
Check the examples/ directory for more usage examples:
basic_agent.py- Simple agent usagetool_usage.py- Agent with custom toolsasync_patterns.py- Advanced async patternsmulti_agent.py- Multiple agents working together
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Quick Start for Contributors
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure tests pass:
pytest - Format code:
black src tests - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Roadmap
- Core agent implementation
- Tool system foundation
- CLI interface
- Comprehensive testing
- OpenAI function calling integration
- Anthropic Claude integration
- Memory management system
- Multi-agent coordination
- Plugin system
- Web interface
- Documentation site
- Advanced tool library
- Streaming responses
- Token usage tracking
- Agent templates
Documentation
- Quick Reference - Fast lookup for common tasks
- Deployment Guide - Publishing and deployment
- API Documentation - Full API reference
- Examples - Code examples and tutorials
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: your.email@example.com
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with Typer for the CLI
- Styled with Rich for beautiful terminal output
- Validated with Pydantic for data models
- Powered by OpenAI and other LLM providers
Citation
If you use this framework in your research, please cite:
@software{indusagi,
title = {indus-agents: A Modern indus-agents},
author = {Your Name},
year = {2025},
url = {https://github.com/varunisrani/indus-agents}
}
Made with care by the indus-agents team.
Project details
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 indusagi-0.2.0.tar.gz.
File metadata
- Download URL: indusagi-0.2.0.tar.gz
- Upload date:
- Size: 698.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
577c241df86c036c5615b60e08468b6cdc5c77dc4c4af89d70738d57262dd867
|
|
| MD5 |
1b88361da7635f635b8b6f8c1d6bffcd
|
|
| BLAKE2b-256 |
83c7e8105de15e7cdfb71215e79b478477388424f3a2590ad0c3d0b8cbb4f0ff
|
File details
Details for the file indusagi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: indusagi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 83.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d332afabe2c7bcc547bcbd3a9ff31cd55b067657b81b981e9dfd0e7c3c83219
|
|
| MD5 |
3bcfae8464d692f919ca1cf7b98fdfe1
|
|
| BLAKE2b-256 |
ea192a5ed89e4f22cbfddc0055ccc5eccb444dbd0e2fee31df199acd1332970a
|