CAL (Creevo Agent Library) - A Python library for building agentic AI applications with LLM abstraction, tool management, and conversation memory
Project description
CAL (Creevo Agent Library)
CAL is a Python library for building agentic AI applications with LLM abstraction, tool management, and conversation memory.
Installation
pip install creevo-agent-library
With MCP support:
pip install "creevo-agent-library[mcp]"
Quick Start
import os
from CAL import Agent, GeminiLLM, StopTool, FullCompressionMemory
# Initialize LLM (uses GEMINI_API_KEY env var when api_key is None)
llm = GeminiLLM(model="gemini-2.5-flash", api_key=None, max_tokens=4096)
# Initialize memory with a summarizer LLM (required for compression)
summarizer_llm = GeminiLLM(model="gemini-2.0-flash", api_key=None, max_tokens=2048)
memory = FullCompressionMemory(summarizer_llm=summarizer_llm, max_tokens=50000)
# Create agent
agent = Agent(
llm=llm,
system_prompt="You are a helpful assistant.",
max_calls=10,
max_tokens=4096,
memory=memory,
agent_name="my-agent",
tools=[StopTool()]
)
# Run agent
result = agent.run("Hello, how can you help me?")
print(result.content)
Architecture
CAL provides:
- Agent: Agentic loop implementation with tool execution
- LLM: Abstract base class with Gemini and Anthropic implementations
- Memory: Conversation memory management with compression support
- Tool: Tool system with
@tooldecorator for easy tool creation - Message: Message and content block types for conversation handling
- Logger: OpenTelemetry and Maxim AI logging support
Components
Agent
The Agent class implements the agentic loop:
- LLM generates response (may include tool calls)
- Parse tool uses from response
- Execute tools in parallel
- Add tool results to memory
- Repeat until completion or max iterations
LLM Providers
GeminiLLM: Google Gemini API integrationAnthropicVertexLLM: Anthropic Claude via Vertex AI (stub)
Memory
FullCompressionMemory: LLM-based compression that keeps initial prompt, summarizes middle turns using an LLM, and keeps recent messages. Requires asummarizer_llmfor compression.
Tools
CAL provides three ways to give an agent tools:
@tool decorator — wrap an async function as a tool:
from CAL import tool
@tool
async def my_tool(param1: str, param2: int):
"""Tool description"""
return {
"content": [{"type": "text", "text": f"Result: {param1}, {param2}"}],
"metadata": {}
}
@subagent decorator — delegate to a specialized sub-agent (see src/CAL/subagent.py).
MCP servers — connect to any Model Context Protocol server
and use its tools as regular CAL tools (install with pip install "creevo-agent-library[mcp]"):
from CAL.mcp import connect_mcp_server, disconnect_mcp_tools
# Returns a list of MCPTool instances — same interface as @tool and @subagent
mcp_tools = await connect_mcp_server(command="npx", args=["-y", "@upstash/context7-mcp"])
agent = Agent(
llm=GeminiLLM(model="gemini-3-flash-preview", api_key="...", max_tokens=4096),
system_prompt="You are a helpful assistant.",
max_calls=10,
max_tokens=4096,
memory=FullCompressionMemory(
summarizer_llm=GeminiLLM(model="gemini-3-flash-preview", api_key="...", max_tokens=2048),
max_tokens=50000,
),
agent_name="mcp-agent",
tools=[StopTool(), *mcp_tools], # mix with any other CAL tools
)
result = await agent.run_async("What does React useEffect do?")
await disconnect_mcp_tools(mcp_tools)
See examples/mcp_context7_agent.ipynb for a full walkthrough.
Documentation
For detailed API documentation, see the wiki.
License
MIT License
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 creevo_agent_library-0.1.0.tar.gz.
File metadata
- Download URL: creevo_agent_library-0.1.0.tar.gz
- Upload date:
- Size: 58.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ccb5fb7fa929f64a02afed01d1ca04b4c334d113e58b9fdfbb4e7bf9d1001f2
|
|
| MD5 |
5c7c70ca180973909d01c5cfae17959e
|
|
| BLAKE2b-256 |
9e5ee57e6c764d2daf7ba96431df2fa149af27c143c9ccae2b09c0e38d27b055
|
Provenance
The following attestation bundles were made for creevo_agent_library-0.1.0.tar.gz:
Publisher:
publish.yml on Creevo-App/creevo-agent-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
creevo_agent_library-0.1.0.tar.gz -
Subject digest:
5ccb5fb7fa929f64a02afed01d1ca04b4c334d113e58b9fdfbb4e7bf9d1001f2 - Sigstore transparency entry: 1005006200
- Sigstore integration time:
-
Permalink:
Creevo-App/creevo-agent-library@4cec13af2f123d64b59c90427aa35041f5f43d83 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Creevo-App
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4cec13af2f123d64b59c90427aa35041f5f43d83 -
Trigger Event:
release
-
Statement type:
File details
Details for the file creevo_agent_library-0.1.0-py3-none-any.whl.
File metadata
- Download URL: creevo_agent_library-0.1.0-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e813c361686b6748a4251c7b1e1a033a07581667d66d6ddb88ce0b11ea9e4e5
|
|
| MD5 |
7710652b0b42b4fbd01f206181d97cb9
|
|
| BLAKE2b-256 |
944292edf8094391aa7ec452944b5a732975fd62d96e3974fa02b7e7e532ad69
|
Provenance
The following attestation bundles were made for creevo_agent_library-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Creevo-App/creevo-agent-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
creevo_agent_library-0.1.0-py3-none-any.whl -
Subject digest:
6e813c361686b6748a4251c7b1e1a033a07581667d66d6ddb88ce0b11ea9e4e5 - Sigstore transparency entry: 1005006201
- Sigstore integration time:
-
Permalink:
Creevo-App/creevo-agent-library@4cec13af2f123d64b59c90427aa35041f5f43d83 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Creevo-App
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4cec13af2f123d64b59c90427aa35041f5f43d83 -
Trigger Event:
release
-
Statement type: