customization development extending plugins Extending AgenticAI Extend and customize the framework
Add new capabilities, integrate external systems across 400+ modules
Enterprise Extensibility
Part of 237 enterprise modules with advanced extensibility patterns. See Enterprise Documentation .
Understanding the Architecture AgenticAI is organized into modular components:
Module Purpose core/ Agent classes and orchestration logic memory/ Short-term and long-term memory management llms/ LLM provider integrations tools/ Tool registry and implementations guardrails/ Safety and compliance checks knowledge/ Knowledge base and retrieval orchestration/ Workflow coordination tracing/ Distributed tracing evaluation/ Evaluation framework
Adding a New Agent Create a new class inheriting from Agent Implement required methods Register the agent Python from agenticaiframework import Agent , AgentManager
class CustomAgent ( Agent ):
"""Custom agent with specialized behavior."""
def __init__ ( self , name : str , ** kwargs ):
super () . __init__ ( name = name , role = "custom" , capabilities = [ "text" ])
def act ( self , input_data : str ) -> str :
return f "Processed: { input_data } "
# Register and use
manager = AgentManager ()
agent = CustomAgent ( name = "MyCustomAgent" )
manager . register_agent ( agent )
Create a class inheriting from BaseTool Implement the _run method Register with the decorator Python from agenticaiframework.tools import BaseTool , register_tool
@register_tool ()
class SentimentTool ( BaseTool ):
"""Analyze sentiment of text."""
name = "sentiment_analysis"
description = "Analyzes the sentiment of input text"
def _run ( self , input_data : dict ) -> dict :
text = input_data . get ( "text" , "" )
# Your sentiment analysis logic here
return { "sentiment" : "positive" , "confidence" : 0.95 }
Extending Memory Add a custom memory backend:
Python from agenticaiframework.memory import MemoryManager
class RedisMemoryBackend :
"""Redis-based memory backend."""
def __init__ ( self , redis_client ):
self . client = redis_client
def store ( self , key : str , value : any ) -> None :
self . client . set ( key , value )
def retrieve ( self , key : str ) -> any :
return self . client . get ( key )
def clear ( self , key : str ) -> None :
self . client . delete ( key )
Extending LLM Integrations Add a new LLM provider:
Python from agenticaiframework.llms import LLMManager
def custom_llm_provider ( prompt : str , ** kwargs ) -> str :
"""Custom LLM provider integration."""
# Your LLM API call here
return f "Response to: { prompt } "
# Register the provider
llm = LLMManager ()
llm . register_model ( "custom-llm" , custom_llm_provider )
llm . set_active_model ( "custom-llm" )
Adding Guardrails Implement custom safety checks:
Python from agenticaiframework.guardrails import GuardrailManager
def content_filter ( input_data : str ) -> str :
"""Filter inappropriate content."""
banned_words = [ "spam" , "scam" ]
for word in banned_words :
if word in input_data . lower ():
raise ValueError ( f "Content contains banned word: { word } " )
return input_data
# Register guardrail
guardrails = GuardrailManager ()
guardrails . add_guardrail ( "content_filter" , content_filter )
Custom Communication Protocols Extend communication capabilities:
Python class WebSocketCommunication :
"""WebSocket-based communication."""
def __init__ ( self , url : str ):
self . url = url
self . connection = None
async def connect ( self ):
import websockets
self . connection = await websockets . connect ( self . url )
async def send ( self , message : str ):
await self . connection . send ( message )
async def receive ( self ) -> str :
return await self . connection . recv ()
Testing Extensions Write comprehensive tests for new features:
Python import pytest
from agenticaiframework import Agent
class TestCustomAgent :
def test_agent_creation ( self ):
agent = CustomAgent ( name = "TestAgent" )
assert agent . name == "TestAgent"
def test_agent_act ( self ):
agent = CustomAgent ( name = "TestAgent" )
result = agent . act ( "Hello" )
assert "Processed" in result
# Run tests
# pytest tests/test_custom_agent.py -v
Packaging Extensions Structure your extension as a package:
Text Only my_extension/
βββ __init__.py
βββ agents/
β βββ custom_agent.py
βββ tools/
β βββ custom_tool.py
βββ tests/
βββ test_extension.py
Best Practices Extension Best Practices
Keep extensions modular and focused Write unit tests for all new features Follow PEP8 coding standards Document your changes Use type hints for better IDE support Handle errors gracefully