apexagents
apexagents is a modular, lightweight, and production-ready Agentic AI framework inspired by minimal agent architectures. It helps developers build LLM-powered agents that can utilize tools, retain conversation memory, and cleanly integrate with external resources like MCP servers.
Features
- LLM Agnostic: Powered by
litellm, supporting 100+ LLM providers. - Tool Calling: A clean
@tooldecorator to turn any Python function into an agent capability. - Memory Management: Pluggable memory backends (In-Memory, SQLite) with intelligent summarization.
- MCP Native: First-class support for the Model Context Protocol (MCP) to connect with external tool servers.
- Asynchronous: Built with async support for modern streaming and non-blocking LLM calls.
Installation
pip install apexagents
Quickstart
import asyncio
from apexagents import Agent, tool
@tool
def calculate_sum(a: int, b: int) -> int:
"""Calculates the sum of two integers."""
return a + b
async def main():
agent = Agent(
name="MathBot",
model="gpt-4o-mini",
instructions="You are a helpful math assistant. Use tools for calculations.",
tools=[calculate_sum]
)
response = await agent.arun("Can you add 256 and 512 for me?")
print(response)
if __name__ == "__main__":
asyncio.run(main())
Core Capabilities
1. Advanced Memory Management
apexagents supports persistent memory out-of-the-box. You can use SQLiteMemory for persistence and SummarizingMemory to handle context window limits.
from apexagents.memory import SQLiteMemory, SummarizingMemory
# Persistent SQLite backend
sqlite_memory = SQLiteMemory(db_path="agent_memory.db", session_id="user_1")
# Wrap with summarization to keep context lean
memory = SummarizingMemory(
backend=sqlite_memory,
max_messages=10,
summarize_down_to=3
)
agent = Agent(..., memory=memory)
2. MCP Integration (Model Context Protocol)
Connect your agents to standard MCP servers to dynamically fetch tools.
from apexagents import Agent, MCPServerClient
async def main():
# Connect to a local MCP server
mcp_client = MCPServerClient(command="npx", args=["-y", "@modelcontextprotocol/server-fetch"])
await mcp_client.connect()
# Get tools from the server
external_tools = await mcp_client.get_tools()
agent = Agent(
model="gpt-4o",
tools=external_tools
)
await agent.arun("Fetch the contents of https://example.com")
await mcp_client.close()
Environment Variables
The framework uses litellm under the hood. Ensure you set the relevant API keys for your provider:
OPENAI_API_KEYANTHROPIC_API_KEYAZURE_API_KEY,AZURE_API_BASE,AZURE_API_VERSION
License
MIT
Metadata
Release files for apexagents 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| apexagents-1.0.0.tar.gz | 14.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apexagents-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.8 kB
Release files / apexagents-1.0.0.tar.gz
| Download URL | apexagents-1.0.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
362bfc84b10cc1ea969b8d8efa475fd400f52b5c69f04102f0945b11b5e12b39
|
|
BLAKE2b-256 checksum How to use checksums |
5b3db389f945363d182eddc18b51ffe9cb2a2155189aab77442546038f00b628
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / apexagents-1.0.0-py3-none-any.whl
| Download URL | apexagents-1.0.0-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e40256dadef5665f532ec1d9eced63358735a16390ae602a12ce4c4f96082426
|
|
BLAKE2b-256 checksum How to use checksums |
d47431ac1eb19dd528ab9622ece38c0bf586f88fc0fce5199162a82579603777
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for apexagents 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.