Skip to main content

A sophisticated AI agent toolkit supporting multiple AI providers with tool calling capabilities.

Project description

Local Agent Toolkit

Python 3.8+ License: MIT

A generic, multipurpose Local Agent Toolkit in Python. This framework is completely agnostic to specific use cases and architectures, serving as a robust foundation for building autonomous, collaborative AI agents that can manage their own context, interface with each other, and securely use external tools.

๐Ÿš€ Quick Start

Installation

pip install -r requirements.txt

Command Line Usage

First, set up your environment configuration by copying .env.example to .env and adding your API keys.

# Ask a question directly
python app.py "What files are in the current directory?"

# Interactive mode
python app.py

# With custom settings
python app.py "Analyze the code structure" --no-save

Python Library Usage

from local_agent_toolkit import Agent

# Initialize the core agent
agent = Agent(
    name="MainAgent",
    system_prompt="You are a highly capable AI assistant that uses available tools to accomplish goals."
)

result = agent.run(user_prompt="List all Python files in the project")
print(result)

โœจ Features

  • ๐ŸŒ Standardized API Interface: Uses pure requests following the OpenAI native JSON structure. Compatible with OpenAI, Vertex, Local LLMs (via Ollama/vLLM), Groq, and more.
  • ๐Ÿค– Autonomous Agents: Agents maintain independent conversation histories and automatically delegate sub-tasks when needed.
  • ๐Ÿ”Œ Model Context Protocol (MCP): Dynamic tool extension via MCP Servers via .mcp.json.
  • ๐Ÿ› ๏ธ Rich Built-In Tools: Deep system-level tools covering regex-based file searching, exact content mapping, disk manipulation, and secure subprocess execution.
  • ๐Ÿ—ฃ๏ธ Inter-Agent Collaboration: Support for multiple sub-agents operating concurrently under the same framework via .register_collaborator(agent).

๐Ÿ“ฆ Project Structure

framework/
โ”œโ”€โ”€ app.py                # Main CLI application
โ”œโ”€โ”€ local_agent_toolkit/  # Core Framework Mechanics
โ”‚   โ”œโ”€โ”€ __init__.py       # Library exports
โ”‚   โ”œโ”€โ”€ agent.py          # Core contextual autonomous Agent
โ”‚   โ”œโ”€โ”€ llm.py            # Central HTTP-based LLM orchestration
โ”‚   โ”œโ”€โ”€ mcp.py            # Model Context Protocol definition and bindings
โ”‚   โ””โ”€โ”€ tools/            # Default Native Tools
โ”‚       โ”œโ”€โ”€ __init__.py   # Tool bindings & descriptions
โ”‚       โ”œโ”€โ”€ cmd.py        # Subprocess shell extensions
โ”‚       โ””โ”€โ”€ fs.py         # File system native operations
โ”œโ”€โ”€ mcp.json              # Model Context Protocol Server mapping
โ”œโ”€โ”€ docs/                 # Additional Documentation
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”œโ”€โ”€ .env                  # Operational mapping variables
โ””โ”€โ”€ README.md             # This file

โš™๏ธ Configuration

Create a .env file in your project root:

# Core API Key for the provider (OpenAI, Gemini, Vertex, Groq, etc)
API_KEY=your_api_key_here

# Base URL for the OpenAI compatible endpoint
API_BASE_URL=https://api.openai.com/v1

# The model name to use for generating text
MODEL=gpt-4o

# Tool and Processing Configuration
MAX_ITERATIONS=25

# Logging Configuration
LOG_LEVEL=INFO

๐Ÿ”Œ Using MCP Servers

Add server definitions to your mcp.json file in the root directory:

{
  "mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "./database.db"],
      "active": true
    }
  }
}

The framework's MCPManager automatically bootstraps all active MCP servers, parses their schemas, and loads their tools natively alongside standard tools upon Agent initialization.

๐Ÿค Collaborative Agents

Agents can securely establish communication networks.

from local_agent_toolkit import Agent

research_agent = Agent("Researcher", "You perform file system research.")
writer_agent = Agent("Writer", "You answer questions accurately.")

writer_agent.register_collaborator(research_agent)

writer_agent.run("Ask the Researcher to find all text files and read them to me.")

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

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

nixagent-1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nixagent-1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file nixagent-1.0.tar.gz.

File metadata

  • Download URL: nixagent-1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for nixagent-1.0.tar.gz
Algorithm Hash digest
SHA256 43114994049ed03f4b59fa199b6102a9ad35450e6b468240ea18e419a48a1970
MD5 308549b7e0df78f5cbd355ca70e5316a
BLAKE2b-256 591f4299742f2f212e8e37c38b5e4b17cc70de9a12504c1240832e7e053e6a8b

See more details on using hashes here.

File details

Details for the file nixagent-1.0-py3-none-any.whl.

File metadata

  • Download URL: nixagent-1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for nixagent-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e48c6f3fb4b014e59eadb0babce3760840b6a96dc331f4d971f9ad06a813a3f
MD5 1f90694d3f5fde94eaceddc57b774454
BLAKE2b-256 3ba7e217e46b7fe1a5b30bef39b5bbd348215acba792d1025a570f5b931bdbea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page