Observed since 20 Oct, 22:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Lightweight AI agent library. Turn Python functions/classes into AI tools instantly.
Turn any Python class into an AI tool. Instantly.
Async-native • MCP support • Multi-providers • ~500 lines of core code
class Database:
def __llm__(self):
return f"Tables: {self.list_tables()}" # AI sees this every turn
def query(self, sql: str) -> list[dict]:
"""Execute SQL query"""
return self.execute(sql)
def describe(self, table: str) -> dict:
"""Get table schema"""
return self.get_schema(table)
agent = Agentlys()
agent.add_tool(Database(conn)) # That's it. All methods are now AI tools.
agent.run("What drove revenue decline in Q3?")
Other frameworks: 50 lines of tool definitions, separate schemas, manual state management.
Agentlys: Your class IS the tool. Methods become actions. __llm__() injects state.
| If you want... | Use |
|---|---|
| Graphs and state machines | LangGraph |
| Team-based agent crews | CrewAI |
| Your existing classes as AI tools | Agentlys |
~500 lines of core code. No framework lock-in. No magic.
pip install 'agentlys[all]' # OpenAI + Anthropic + MCP
def get_weather(city: str) -> str:
"""Get current weather for a city"""
return requests.get(f"https://wttr.in/{city}?format=3").text
agent.add_function(get_weather)
class FileSystem:
def __init__(self, root: str):
self.root = root
def __llm__(self):
"""State shown to AI each turn"""
return f"Current directory: {self.root}\nFiles: {os.listdir(self.root)}"
def read(self, path: str) -> str:
"""Read file contents"""
return open(f"{self.root}/{path}").read()
def write(self, path: str, content: str):
"""Write to file"""
open(f"{self.root}/{path}", 'w').write(content)
agent.add_tool(FileSystem("/workspace"))
# AI now sees file state, can read/write, all from one class
for message in agent.run_conversation("Refactor config.json to use environment variables"):
print(message.content)
# Async conversation loop
async for message in agent.run_conversation_async("Analyze the data"):
print(message.content)
# Single async call
response = await agent.ask_async("What tables exist?")
A coding agent in 15 lines:
from agentlys import Agentlys
from agentlys_tools import CodeEditor, Terminal, Git
agent = Agentlys(
instruction="You are a senior developer",
provider="anthropic",
model="claude-sonnet-4-20250514"
)
agent.add_tool(CodeEditor())
agent.add_tool(Terminal())
agent.add_tool(Git())
agent.run_conversation("Create a FastAPI app with tests")
# Anthropic (default)
agent = Agentlys(provider="anthropic", model="claude-sonnet-4-20250514")
# OpenAI
agent = Agentlys(model="gpt-4o")
# Any OpenAI-compatible API (Ollama, vLLM, LiteLLM, OpenRouter, ...)
agent = Agentlys(model="llama3.1", base_url="http://localhost:11434/v1")
See the Provider Guide for details.
When you have many tools, defer most of them and let the LLM discover what it needs:
agent.add_tool(Database(conn), "db")
agent.add_tool(Charts(), "charts")
agent.add_tool(Documents(), "docs")
agent.add_function(answer)
agent.enable_tool_search(always_loaded=["answer", "Database-db__query"])
# Charts and Documents tools are hidden until the LLM searches for them
Reduces context usage by 50-85% with large tool sets. See API Reference.
Agentlys is for: turning your existing Python code into AI tools with zero ceremony.
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.21.0 | 13 Oct 2026 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:05b31b10df30befa629d39cf62f430b491453ae37cd174d73b501de942754460