Creating an agent with code examples
Basic Agent with RAG
Creating a simple research agent with a search function (vectorSearch).
const researchAgent = new AgentCore({
name: 'research-bot',
prompt: 'Analyze technical documents...',
functions: [{
func: vectorSearch,
name: 'document_search',
description: 'Search knowledge base',
paramsToPass: {
query: 'string'
}
}]
});Multi-Agent Workflow
Creating a multi-agent system with a parent agent (editorAgent) and child agents (fact-checker, style-enforcer) for content editing tasks.
Self-Reflecting Agent
Example of an agent with a self-reflection function (selfReflectingAgent) that periodically analyzes its own performance.
Personal Assistant Agent
Creating a personal assistant agent (personalAssistant) with functions for calendar management, sending emails, and child agents for meeting preparation and travel planning.
Support Agent
Example of a tech support agent (supportBot) with knowledge base search functions, ticket creation capabilities, and a child agent for log analysis. It also includes reflection for knowledge base updates.
News Analysis Agent
Creating a news analysis agent (newsAnalyzer) with functions for news retrieval, sentiment analysis, a child agent for trend detection, and reflection for generating daily reports.
Last updated