Plugins
Astreus provides a powerful plugin system that extends agent capabilities with specialized tools for various tasks and integrations. Plugins allow agents to interact with external services, APIs, and data sources.
Built-in Tools
Astreus automatically provides certain tools when specific components are added to agents:
RAG Tools
When you add a RAG (Retrieval Augmented Generation) instance to an agent, it automatically gets document search and management tools:
- rag_search - Search through documents semantically
- rag_add_document - Add new documents to knowledge base (Vector RAG only)
- rag_get_document - Retrieve specific documents (Vector RAG only)
- rag_delete_document - Remove documents (Vector RAG only)
- rag_search_by_metadata - Search by document metadata (Document RAG only)
import { createRAG } from '@astreus-ai/astreus';
// Create RAG instance
const rag = await createRAG({
type: 'vector',
database: db,
provider: provider
});
// Create agent and add RAG tools
const agent = await createAgent({
name: 'DocumentAssistant',
provider: provider,
memory: memory
});
// Add RAG tools to agent
const ragTools = rag.createRAGTools();
ragTools.forEach(tool => agent.addTool(tool));
Official Plugins
Astreus offers several official plugins to enhance your agents:
- EVM Plugin - Comprehensive Web3 integration for Ethereum and EVM-compatible blockchains
- X Plugin - Interact with the X (formerly Twitter) platform
- WhatsApp Plugin - Send and manage WhatsApp messages using the official WhatsApp Cloud API
- Resend Plugin - Send emails using the Resend API with template support
Getting Started with Plugins
To start using plugins with Astreus, install the desired plugin package alongside Astreus:
npm install @astreus-ai/astreus @astreus-ai/evm-plugin
Then initialize and use the plugin with your agent:
import { createAgent, createMemory, createProvider, createDatabase, PluginManager } from '@astreus-ai/astreus';
import EVMPlugin from '@astreus-ai/evm-plugin';
// Initialize Astreus components
const db = await createDatabase();
const memory = await createMemory({ database: db, tableName: 'memories' });
const provider = createProvider({ type: 'openai', model: 'gpt-4o-mini' });
// Initialize EVM plugin
const evmPlugin = new EVMPlugin({
defaultNetwork: 'sepolia', // Use testnet for development
privateKeys: [process.env.WALLET_PRIVATE_KEY]
});
await evmPlugin.init();
// Create a plugin manager and add the EVM plugin
const pluginManager = new PluginManager({
name: 'web3-plugins',
tools: evmPlugin.getTools()
});
// Create agent
const agent = await createAgent({
name: 'Web3 Agent',
provider: provider,
memory: memory,
plugins: [pluginManager]
});
// Agent automatically gets EVM tools from the plugin manager
await agent.chat('Send 0.1 ETH to vitalik.eth');
Creating Custom Plugins
You can create your own plugins to extend agent capabilities. See the Custom Plugins guide for detailed instructions.
How is this guide?