@autonomaai/agent-core 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/base-agent.d.ts +112 -0
  2. package/dist/base-agent.d.ts.map +1 -0
  3. package/dist/base-agent.js +173 -0
  4. package/dist/base-agent.js.map +1 -0
  5. package/dist/core.d.ts +81 -0
  6. package/dist/core.d.ts.map +1 -0
  7. package/dist/core.js +633 -0
  8. package/dist/core.js.map +1 -0
  9. package/dist/error-handler.d.ts +78 -0
  10. package/dist/error-handler.d.ts.map +1 -0
  11. package/dist/error-handler.js +129 -0
  12. package/dist/error-handler.js.map +1 -0
  13. package/dist/factory.d.ts +60 -0
  14. package/dist/factory.d.ts.map +1 -0
  15. package/dist/factory.js +621 -0
  16. package/dist/factory.js.map +1 -0
  17. package/dist/index.d.ts +13 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +19 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/streaming.d.ts +24 -0
  22. package/dist/streaming.d.ts.map +1 -0
  23. package/dist/streaming.js +36 -0
  24. package/dist/streaming.js.map +1 -0
  25. package/dist/trading/formatters.d.ts +167 -0
  26. package/dist/trading/formatters.d.ts.map +1 -0
  27. package/dist/trading/formatters.js +271 -0
  28. package/dist/trading/formatters.js.map +1 -0
  29. package/dist/trading/index.d.ts +9 -0
  30. package/dist/trading/index.d.ts.map +1 -0
  31. package/dist/trading/index.js +10 -0
  32. package/dist/trading/index.js.map +1 -0
  33. package/dist/trading/types.d.ts +205 -0
  34. package/dist/trading/types.d.ts.map +1 -0
  35. package/dist/trading/types.js +7 -0
  36. package/dist/trading/types.js.map +1 -0
  37. package/dist/trading/utils.d.ts +120 -0
  38. package/dist/trading/utils.d.ts.map +1 -0
  39. package/dist/trading/utils.js +291 -0
  40. package/dist/trading/utils.js.map +1 -0
  41. package/dist/trading/validation.d.ts +40 -0
  42. package/dist/trading/validation.d.ts.map +1 -0
  43. package/dist/trading/validation.js +247 -0
  44. package/dist/trading/validation.js.map +1 -0
  45. package/dist/types.d.ts +282 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/dist/types.js +21 -0
  48. package/dist/types.js.map +1 -0
  49. package/package.json +57 -0
  50. package/src/base-agent.ts +263 -0
  51. package/src/core.ts +792 -0
  52. package/src/error-handler.ts +166 -0
  53. package/src/factory.ts +687 -0
  54. package/src/global.d.ts +12 -0
  55. package/src/index.ts +24 -0
  56. package/src/streaming.ts +50 -0
  57. package/src/trading/formatters.ts +363 -0
  58. package/src/trading/index.ts +10 -0
  59. package/src/trading/types.ts +263 -0
  60. package/src/trading/utils.ts +355 -0
  61. package/src/trading/validation.ts +321 -0
  62. package/src/types.ts +402 -0
@@ -0,0 +1,621 @@
1
+ /**
2
+ * Factory functions for creating pre-configured agents.
3
+ *
4
+ * Provides convenient functions for creating agents optimized for specific use cases
5
+ * with appropriate defaults and capabilities.
6
+ */
7
+ import { StandardAgent, AgentBuilder, AgentUtils } from './core.js';
8
+ /**
9
+ * Create a trading agent with pre-configured capabilities for market making,
10
+ * exchange connectivity, and risk management.
11
+ */
12
+ export function createTradingAgent(config = {}) {
13
+ const defaultConfig = {
14
+ name: config.name || 'Trading Agent',
15
+ description: config.description || 'AI trading agent with Hummingbot integration',
16
+ tools: {
17
+ enableAgentKit: true,
18
+ enableMCP: true,
19
+ enableRAG: true,
20
+ mcpServerUrl: config.tools?.mcpServerUrl || process.env.HUMMINGBOT_MCP_URL || 'http://localhost:8000',
21
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
22
+ ...config.tools
23
+ },
24
+ prompt: {
25
+ systemMessage: `You are an AI Trading Agent that controls a revolutionary Hummingbot trading system through the Model Context Protocol (MCP). You are empowered to create, manage, and execute automated trading strategies with professional-grade capabilities.`,
26
+ capabilities: [
27
+ 'trading_controller_management',
28
+ 'exchange_connectivity',
29
+ 'market_data_analysis',
30
+ 'risk_management',
31
+ 'portfolio_optimization',
32
+ 'automated_trading',
33
+ 'performance_analytics'
34
+ ],
35
+ context: `
36
+ **🚀 Core Trading System:**
37
+ - Controller-Based Architecture with 90% resource reduction and 60x faster deployment
38
+ - Live Exchange Connectivity: Real trading on Hyperliquid, Binance, Bybit
39
+ - Multi-Strategy Support: Pure market making, Avellaneda, TWAP, Grid trading, Arbitrage
40
+ - Real-Time Management: Hot configuration updates, performance monitoring, risk management
41
+
42
+ **📊 Available Trading Operations:**
43
+ - System Health: Monitor system status, capabilities, and performance metrics
44
+ - Controller Management: Create, start, stop, configure trading controllers
45
+ - Exchange Integration: Connect controllers to live exchanges
46
+ - Live Trading: Execute real trades, monitor positions, manage account balances
47
+ - Market Data: Access real-time market data, order books, price feeds
48
+ - Performance Analytics: Track PnL, win rates, trading volumes, health scores
49
+ `,
50
+ enableConversationMemory: true,
51
+ ...config.prompt
52
+ },
53
+ memory: {
54
+ enabled: true,
55
+ persistentThreadId: true,
56
+ maxMessages: 100,
57
+ ...config.memory
58
+ },
59
+ services: {
60
+ messageService: true,
61
+ ragService: true,
62
+ analyticsService: true,
63
+ loggingEnabled: true,
64
+ ...config.services
65
+ },
66
+ ...config
67
+ };
68
+ return StandardAgent.createTradingAgent(defaultConfig);
69
+ }
70
+ /**
71
+ * Create a data analysis agent optimized for market research,
72
+ * pattern recognition, and report generation.
73
+ */
74
+ export function createDataAnalysisAgent(config = {}) {
75
+ const defaultConfig = {
76
+ name: config.name || 'Data Analysis Agent',
77
+ description: config.description || 'AI agent specialized in data analysis and market research',
78
+ tools: {
79
+ enableMCP: true,
80
+ enableRAG: true,
81
+ mcpServerUrl: config.tools?.mcpServerUrl || process.env.DATA_COLLECTOR_MCP_URL || 'http://localhost:8003',
82
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
83
+ ...config.tools
84
+ },
85
+ prompt: {
86
+ systemMessage: `You are an AI Data Analysis Agent specialized in cryptocurrency market research, statistical analysis, and pattern recognition. You can access and analyze comprehensive market data to provide insights and recommendations.`,
87
+ capabilities: [
88
+ 'data_collection',
89
+ 'statistical_analysis',
90
+ 'pattern_recognition',
91
+ 'report_generation',
92
+ 'visualization',
93
+ 'market_research',
94
+ 'trend_analysis'
95
+ ],
96
+ context: `
97
+ **📊 Data Analysis Capabilities:**
98
+ - Multi-Chain, Multi-DEX data access: EVM chains and Hyperliquid L1
99
+ - Real-time and historical price data, order books, spreads
100
+ - Token-level analytics and trading volume insights
101
+ - Statistical analysis and pattern recognition
102
+ - Report generation and data visualization
103
+
104
+ **🔍 Available Data Sources:**
105
+ - Hyperliquid L1: Native API integration for orderbook, trades, volume, OHLCV
106
+ - EVM DEXs: Moralis and 0x API for token prices, swaps, aggregation
107
+ - Historical data: OHLCV, volume, spreads, market metrics
108
+ `,
109
+ enableConversationMemory: true,
110
+ ...config.prompt
111
+ },
112
+ memory: {
113
+ enabled: true,
114
+ persistentThreadId: true,
115
+ maxMessages: 150,
116
+ ...config.memory
117
+ },
118
+ services: {
119
+ messageService: true,
120
+ ragService: true,
121
+ analyticsService: true,
122
+ loggingEnabled: true,
123
+ ...config.services
124
+ },
125
+ ...config
126
+ };
127
+ return StandardAgent.createDataAnalysisAgent(defaultConfig);
128
+ }
129
+ /**
130
+ * Create a customer service agent optimized for answering questions,
131
+ * knowledge base search, and issue resolution.
132
+ */
133
+ export function createCustomerServiceAgent(config = {}) {
134
+ const defaultConfig = {
135
+ name: config.name || 'Customer Service Agent',
136
+ description: config.description || 'AI customer service agent with knowledge base integration',
137
+ tools: {
138
+ enableRAG: true,
139
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
140
+ ...config.tools
141
+ },
142
+ prompt: {
143
+ systemMessage: `You are an AI Customer Service Agent designed to help users with questions, troubleshooting, and guidance. You have access to comprehensive documentation and can search through knowledge bases to provide accurate and helpful responses.`,
144
+ capabilities: [
145
+ 'question_answering',
146
+ 'knowledge_base_search',
147
+ 'issue_escalation',
148
+ 'conversation_management',
149
+ 'sentiment_analysis',
150
+ 'troubleshooting',
151
+ 'documentation_retrieval'
152
+ ],
153
+ context: `
154
+ **🎯 Customer Service Capabilities:**
155
+ - Knowledge Base Access: Search through documentation, guides, and technical resources
156
+ - Issue Resolution: Troubleshoot problems and provide step-by-step solutions
157
+ - Conversation Management: Maintain context and provide personalized assistance
158
+ - Escalation: Identify when issues need human intervention
159
+
160
+ **📚 Available Knowledge Tools:**
161
+ - search_knowledge_base: Search for specific documentation or information
162
+ - get_contextual_information: Get relevant context for current discussion
163
+ - comprehensive_search: Deep research on complex topics
164
+ - check_knowledge_base_status: Verify knowledge base availability
165
+ `,
166
+ enableConversationMemory: true,
167
+ ...config.prompt
168
+ },
169
+ memory: {
170
+ enabled: true,
171
+ persistentThreadId: true,
172
+ maxMessages: 200,
173
+ ...config.memory
174
+ },
175
+ services: {
176
+ messageService: true,
177
+ ragService: true,
178
+ loggingEnabled: true,
179
+ ...config.services
180
+ },
181
+ ...config
182
+ };
183
+ return StandardAgent.createCustomerServiceAgent(defaultConfig);
184
+ }
185
+ /**
186
+ * Create a general-purpose agent with minimal configuration.
187
+ * Good starting point for custom implementations.
188
+ */
189
+ export function createGenericAgent(config) {
190
+ const defaultConfig = {
191
+ name: config.name || 'Generic Agent',
192
+ description: config.description || 'General-purpose AI agent',
193
+ tools: {
194
+ enableRAG: false,
195
+ enableMCP: false,
196
+ enableAgentKit: false,
197
+ ...config.tools
198
+ },
199
+ prompt: {
200
+ systemMessage: config.prompt?.systemMessage || 'You are a helpful AI assistant.',
201
+ capabilities: config.prompt?.capabilities || ['general_assistance'],
202
+ enableConversationMemory: true,
203
+ ...config.prompt
204
+ },
205
+ memory: {
206
+ enabled: true,
207
+ persistentThreadId: false,
208
+ maxMessages: 50,
209
+ ...config.memory
210
+ },
211
+ services: {
212
+ messageService: false,
213
+ ragService: false,
214
+ analyticsService: false,
215
+ loggingEnabled: true,
216
+ ...config.services
217
+ },
218
+ ...config
219
+ };
220
+ return new StandardAgent(defaultConfig);
221
+ }
222
+ /**
223
+ * Create an agent using a fluent builder pattern for complex configurations.
224
+ */
225
+ export function createAgentBuilder() {
226
+ return new AgentBuilder();
227
+ }
228
+ /**
229
+ * Create a Solana token analysis agent using DexScreener MCP tools.
230
+ * Specialized for discovering trending tokens, market analysis, and risk assessment.
231
+ */
232
+ export function createSolanaAnalysisAgent(config = {}) {
233
+ const defaultConfig = {
234
+ name: config.name || 'Solana Analysis Agent',
235
+ description: config.description || 'AI agent specialized in Solana token analysis and market discovery',
236
+ tools: {
237
+ enableMCP: true,
238
+ enableRAG: true,
239
+ mcpServerUrl: config.tools?.mcpServerUrl || process.env.DEXSCREENER_MCP_URL || 'http://localhost:3010',
240
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
241
+ ...config.tools
242
+ },
243
+ prompt: {
244
+ systemMessage: `You are an AI Solana Token Analysis Agent with access to real-time DexScreener data. You specialize in discovering trending tokens, analyzing market conditions, and providing risk assessments for the high-volatility Solana ecosystem.`,
245
+ capabilities: [
246
+ 'solana_token_discovery',
247
+ 'trending_analysis',
248
+ 'risk_assessment',
249
+ 'market_insights',
250
+ 'liquidity_analysis',
251
+ 'momentum_tracking',
252
+ 'opportunity_identification'
253
+ ],
254
+ context: `
255
+ **🌟 Solana Token Analysis Capabilities:**
256
+ - Real-time trending token discovery via DexScreener API
257
+ - Quality filtering with minimum liquidity, volume, and price change thresholds
258
+ - Multi-DEX coverage: Raydium, Orca, Jupiter, Serum, and more
259
+ - Advanced market insights and risk categorization
260
+
261
+ **🔍 Available DexScreener Tools:**
262
+ - get_trending_tokens: Find momentum opportunities and popular tokens
263
+ - get_latest_tokens: Discover new launches and emerging opportunities
264
+ - analyze_trending_tokens: Comprehensive market analysis with risk assessment
265
+ - get_server_context: AI agent guidance and best practices
266
+
267
+ **⚠️ Risk Assessment Framework:**
268
+ - High Risk: <$10k liquidity, >100% price moves, new tokens, single DEX
269
+ - Medium Risk: $10-100k liquidity, 20-100% moves, limited history
270
+ - Lower Risk: >$100k liquidity, multiple DEXs, stable trading patterns
271
+
272
+ **🚀 Solana Ecosystem Context:**
273
+ - Fast transactions (400ms blocks), low fees (<$0.01)
274
+ - High volatility environment with community-driven tokens
275
+ - DEX-centric trading with Pump.fun launches common
276
+ - Quick momentum shifts in meme token ecosystem
277
+
278
+ **🎯 Always emphasize the high-risk nature of new/trending tokens and provide clear risk levels with every recommendation.**
279
+ `,
280
+ enableConversationMemory: true,
281
+ ...config.prompt
282
+ },
283
+ memory: {
284
+ enabled: true,
285
+ persistentThreadId: true,
286
+ maxMessages: 100,
287
+ ...config.memory
288
+ },
289
+ services: {
290
+ messageService: true,
291
+ ragService: true,
292
+ analyticsService: true,
293
+ loggingEnabled: true,
294
+ ...config.services
295
+ },
296
+ ...config
297
+ };
298
+ return StandardAgent.createDataAnalysisAgent(defaultConfig);
299
+ }
300
+ /**
301
+ * Create a multi-chain market data agent using the enhanced data-collector MCP tools.
302
+ * Supports Hyperliquid L1 and EVM chains with advanced market intelligence.
303
+ */
304
+ export function createMarketDataAgent(config = {}) {
305
+ const defaultConfig = {
306
+ name: config.name || 'Market Data Agent',
307
+ description: config.description || 'AI agent for multi-chain market data analysis with enhanced OHLCV capabilities',
308
+ tools: {
309
+ enableMCP: true,
310
+ enableRAG: true,
311
+ mcpServerUrl: config.tools?.mcpServerUrl || process.env.DATA_COLLECTOR_MCP_URL || 'http://localhost:8003',
312
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
313
+ ...config.tools
314
+ },
315
+ prompt: {
316
+ systemMessage: `You are an AI Market Data Agent with access to cutting-edge multi-chain market intelligence. You can analyze price data, orderbooks, trading intensity, and provide enhanced OHLCV data across Hyperliquid L1 and EVM chains.`,
317
+ capabilities: [
318
+ 'multi_chain_analysis',
319
+ 'enhanced_ohlcv_construction',
320
+ 'orderbook_analysis',
321
+ 'trading_intensity_metrics',
322
+ 'token_discovery',
323
+ 'symbol_resolution',
324
+ 'performance_monitoring',
325
+ 'cross_chain_comparison'
326
+ ],
327
+ context: `
328
+ **🔥 Enhanced Market Data Capabilities:**
329
+ - Multi-Chain Support: Hyperliquid L1 (94% complete) + EVM chains (Ethereum, Arbitrum, Base, etc.)
330
+ - Enhanced OHLCV: Breakthrough intelligent ticks-to-candlesticks aggregation
331
+ - Real-time orderbook data with bid-ask spread analysis
332
+ - Trading intensity metrics with activity scoring
333
+ - Universal symbol resolution across all supported chains
334
+
335
+ **🛠️ Available MCP Tools:**
336
+ - get_token_price: Latest prices for any token on supported chains
337
+ - get_token_volume: Volume data with configurable intervals and token formats
338
+ - get_orderbook: Real-time orderbook with depth control
339
+ - get_enhanced_ohlcv: Professional OHLCV data from high-resolution ticks (BREAKTHROUGH!)
340
+ - discover_tokens: AI-optimized token discovery with filtering and sorting
341
+ - get_trading_intensity: Activity metrics with automated scoring
342
+ - resolve_symbol: Universal symbol-to-metadata resolution
343
+ - get_performance_metrics: System latency and optimization insights
344
+
345
+ **🎯 Key Features:**
346
+ - Hyperliquid Token Format Support: spot, perp, auto-detection
347
+ - Configurable parameters via centralized calculation engine
348
+ - Cost-optimized on-demand architecture (90%+ API cost reduction)
349
+ - ~264ms average latency for complex Enhanced OHLCV operations
350
+
351
+ **💡 AI Optimization Notes:**
352
+ - Use tokenFormat=spot for spot tokens like PURR/USDC
353
+ - Use tokenFormat=perp for perpetual tokens like BTC, ETH
354
+ - Use tokenFormat=auto for intelligent detection (tries perp first)
355
+ - Enhanced OHLCV is the first system to overcome Hyperliquid API limitations
356
+ `,
357
+ enableConversationMemory: true,
358
+ ...config.prompt
359
+ },
360
+ memory: {
361
+ enabled: true,
362
+ persistentThreadId: true,
363
+ maxMessages: 120,
364
+ ...config.memory
365
+ },
366
+ services: {
367
+ messageService: true,
368
+ ragService: true,
369
+ analyticsService: true,
370
+ loggingEnabled: true,
371
+ ...config.services
372
+ },
373
+ ...config
374
+ };
375
+ return StandardAgent.createDataAnalysisAgent(defaultConfig);
376
+ }
377
+ /**
378
+ * Create a RAG-enhanced trading agent with comprehensive knowledge retrieval and decision support.
379
+ * Integrates dual-layer RAG (concept + history) with market data and Solana analysis capabilities.
380
+ *
381
+ * This agent represents the Phase 2 RAG-Agent Integration from the Consolidation Memorandum.
382
+ */
383
+ export function createRAGEnhancedTradingAgent(config = {}) {
384
+ const defaultConfig = {
385
+ name: config.name || 'RAG-Enhanced Trading Agent',
386
+ description: config.description || 'Advanced AI trading agent with dual-layer RAG knowledge retrieval, historical decision analysis, and comprehensive market intelligence',
387
+ tools: {
388
+ enableMCP: true,
389
+ enableRAG: true,
390
+ enableAgentKit: true,
391
+ mcpServerUrl: config.tools?.mcpServerUrl || process.env.HUMMINGBOT_MCP_URL || 'http://localhost:8000',
392
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
393
+ ...config.tools
394
+ },
395
+ prompt: {
396
+ systemMessage: `You are an advanced RAG-Enhanced Trading Agent with comprehensive knowledge retrieval and decision support capabilities. You combine real-time market data with historical analysis and conceptual knowledge for informed trading decisions.`,
397
+ capabilities: [
398
+ 'dual_layer_rag_search',
399
+ 'historical_decision_analysis',
400
+ 'market_context_enrichment',
401
+ 'knowledge_base_search',
402
+ 'comprehensive_market_intelligence',
403
+ 'risk_assessment_with_history',
404
+ 'trading_strategy_optimization',
405
+ 'decision_feedback_loop'
406
+ ],
407
+ context: `
408
+ **🧠 Dual-Layer RAG Architecture:**
409
+ - **Concept Layer**: Trading documentation, strategy guides, risk management principles, market analysis frameworks
410
+ - **History Layer**: Past trading decisions, performance data, execution logs, market patterns, strategy outcomes
411
+ - **Parallel Processing**: Simultaneous search across both layers for comprehensive context
412
+ - **Source Provenance**: Clear attribution of information sources for trust and verification
413
+
414
+ **📊 RAG-Enhanced Trading Capabilities:**
415
+
416
+ **Knowledge Base Search:**
417
+ - search_knowledge_base: Find relevant trading concepts and historical patterns
418
+ - retrieve_contextual_information: Get comprehensive context from both concept and history layers
419
+ - comprehensive_search: Deep analysis with layer statistics and performance tracking
420
+
421
+ **Historical Decision Analysis:**
422
+ - get_historical_decisions: Lookup past trading decisions and their outcomes
423
+ - Performance feedback loop: Learn from historical successes and failures
424
+ - Pattern recognition: Identify recurring market conditions and strategy effectiveness
425
+
426
+ **Market Context Enrichment:**
427
+ - enrich_market_context: Combine conceptual knowledge with historical patterns
428
+ - Multi-dimensional analysis: Technical, fundamental, and sentiment perspectives
429
+ - Risk-adjusted insights: Historical context for current market conditions
430
+
431
+ **🔄 Decision-Making Framework:**
432
+ 1. **Context Retrieval**: Search knowledge base for relevant trading concepts
433
+ 2. **Historical Analysis**: Review similar past decisions and outcomes
434
+ 3. **Market Enrichment**: Combine current data with historical patterns
435
+ 4. **Risk Assessment**: Historical risk analysis with current market conditions
436
+ 5. **Strategy Selection**: Data-driven strategy choice based on historical performance
437
+ 6. **Execution Decision**: Informed decision with full context and risk awareness
438
+ 7. **Feedback Loop**: Store decision and outcome for future learning
439
+
440
+ **⚠️ RAG-Enhanced Risk Management:**
441
+ - Historical volatility patterns and their outcomes
442
+ - Past strategy performance in similar market conditions
443
+ - Risk-adjusted returns based on historical data
444
+ - Market regime identification using historical patterns
445
+ - Adaptive position sizing based on historical drawdowns
446
+
447
+ **🎯 Trading Integration:**
448
+ - Combine RAG insights with real-time market data (Hyperliquid, Solana DEXs)
449
+ - Historical context for technical analysis and pattern recognition
450
+ - Strategy validation using historical backtesting data
451
+ - Continuous learning and adaptation based on decision outcomes
452
+
453
+ **📈 Performance Enhancement:**
454
+ - Historical decision lookup for strategy optimization
455
+ - Market context enrichment for better timing decisions
456
+ - Comprehensive search for edge case handling
457
+ - Knowledge base status monitoring for system health
458
+
459
+ **Always leverage both historical experience and conceptual knowledge to make well-informed trading decisions with proper risk management based on historical patterns.**
460
+ `,
461
+ enableConversationMemory: true,
462
+ ...config.prompt
463
+ },
464
+ memory: {
465
+ enabled: true,
466
+ persistentThreadId: true,
467
+ maxMessages: 150,
468
+ ...config.memory
469
+ },
470
+ services: {
471
+ messageService: true,
472
+ ragService: true,
473
+ analyticsService: true,
474
+ loggingEnabled: true,
475
+ ...config.services
476
+ },
477
+ ...config
478
+ };
479
+ return StandardAgent.createTradingAgent(defaultConfig);
480
+ }
481
+ /**
482
+ * Create an agent from environment variables.
483
+ * Useful for deployment scenarios where configuration comes from env vars.
484
+ */
485
+ export function createAgentFromEnvironment(overrides = {}) {
486
+ const envConfig = AgentUtils.getEnvironmentConfig();
487
+ const finalConfig = { ...envConfig, ...overrides };
488
+ const validation = AgentUtils.validateConfig(finalConfig);
489
+ if (!validation.valid) {
490
+ throw new Error(`Invalid agent configuration: ${validation.errors.join(', ')}`);
491
+ }
492
+ return new StandardAgent(finalConfig);
493
+ }
494
+ /**
495
+ * Create a DeFi Yield Optimization agent with comprehensive yield farming,
496
+ * risk assessment, and portfolio optimization capabilities.
497
+ */
498
+ export function createDeFiYieldAgent(config = {}) {
499
+ const defaultConfig = {
500
+ name: config.name || 'DeFi Yield Optimizer',
501
+ description: config.description || 'AI agent specialized in DeFi yield optimization, risk assessment, and portfolio management',
502
+ tools: {
503
+ enableMCP: true,
504
+ enableRAG: true,
505
+ enableAgentKit: true,
506
+ mcpServerUrl: config.tools?.mcpServerUrl || process.env.APY_STRATEGY_MCP_URL || 'http://localhost:3008',
507
+ ragServerUrl: config.tools?.ragServerUrl || process.env.RAG_MCP_URL || 'http://localhost:3002',
508
+ ...config.tools
509
+ },
510
+ prompt: {
511
+ systemMessage: `You are an AI DeFi Yield Optimization Agent with access to comprehensive yield farming, liquidity mining, and protocol analysis capabilities. You specialize in finding optimal yield opportunities, managing portfolio risk, and maximizing returns across DeFi protocols.`,
512
+ capabilities: [
513
+ 'defi_yield_optimization',
514
+ 'protocol_risk_assessment',
515
+ 'cross_chain_arbitrage',
516
+ 'portfolio_optimization',
517
+ 'yield_strategy_backtesting',
518
+ 'automated_rebalancing',
519
+ 'mev_protection',
520
+ 'smart_contract_analysis',
521
+ 'liquidity_mining',
522
+ 'yield_farming_strategies'
523
+ ],
524
+ context: `
525
+ **🏦 DeFi Yield Optimization Capabilities:**
526
+ - **Multi-Chain Yield Discovery**: Find optimal yield opportunities across Ethereum, Arbitrum, Polygon, Base, Optimism
527
+ - **Advanced Portfolio Optimization**: AI-driven allocation using Maximum Sharpe, Risk Parity, and Mean-Variance optimization
528
+ - **Real-Time Risk Assessment**: VaR calculation, correlation analysis, stress testing, and protocol risk evaluation
529
+ - **Strategy Backtesting**: Historical performance simulation with transaction costs and slippage modeling
530
+ - **Cross-Chain Arbitrage**: Detect and analyze arbitrage opportunities across chains and protocols
531
+ - **Performance Tracking**: Real-time yield monitoring with attribution analysis and benchmark comparison
532
+ - **Automated Rebalancing**: Smart rebalancing with MEV protection and gas optimization
533
+ - **Protocol Analysis**: Deep-dive risk assessment of DeFi protocols including smart contract audits
534
+
535
+ **⚡ Available DeFi Operations:**
536
+
537
+ **Yield Discovery & Analysis:**
538
+ - find_yield_opportunities: Discover high-APY opportunities across 200+ DeFi protocols
539
+ - get_apy_history: Analyze historical yield data with trend analysis and volatility metrics
540
+ - assess_protocol_risk: Comprehensive protocol risk evaluation including audit scores
541
+
542
+ **Portfolio Optimization:**
543
+ - optimize_yield_allocation: AI-driven portfolio optimization with risk constraints
544
+ - calculate_portfolio_risk: Real-time VaR, correlation, and concentration risk analysis
545
+ - track_yield_performance: Performance monitoring with attribution and benchmark analysis
546
+
547
+ **Advanced Analytics:**
548
+ - analyze_arbitrage_opportunities: Cross-chain and cross-protocol arbitrage detection
549
+ - backtest_strategy: Historical strategy simulation with comprehensive cost modeling
550
+
551
+ **🔄 DeFi Workflow:**
552
+ 1. **Market Scanning**: Scan yield opportunities across multiple chains and protocols
553
+ 2. **Risk Assessment**: Evaluate protocol risks, smart contract audits, and market conditions
554
+ 3. **Portfolio Optimization**: Use mathematical optimization to determine optimal allocations
555
+ 4. **Strategy Backtesting**: Test strategies against historical data with realistic costs
556
+ 5. **Execution Planning**: Plan deposits, withdrawals, and rebalancing with MEV protection
557
+ 6. **Performance Monitoring**: Track yields, attributions, and risk metrics in real-time
558
+ 7. **Continuous Optimization**: Automated rebalancing and strategy refinement
559
+
560
+ **🎯 Supported Protocols & Features:**
561
+ - **Lending Protocols**: Aave, Compound, Euler, Radiant Capital, etc.
562
+ - **DEX Liquidity**: Uniswap V3, Curve, Balancer, Velodrome, etc.
563
+ - **Yield Farming**: Convex, Yearn, Beefy, etc.
564
+ - **Liquid Staking**: Lido, Rocket Pool, Frax, etc.
565
+ - **Cross-Chain**: Native bridges, LayerZero, Synapse, etc.
566
+
567
+ **⚙️ Configuration Guidelines:**
568
+ - **Risk Tolerance**: Set max protocol allocation (default 25%), max risk score limits
569
+ - **Optimization Strategy**: Choose Maximum Sharpe Ratio, Risk Parity, or Mean-Variance
570
+ - **Rebalancing**: Configure thresholds (default 2%) and frequency (daily/weekly/monthly)
571
+ - **Gas Optimization**: Consider transaction costs in all strategy decisions
572
+ - **MEV Protection**: Use private mempools and slippage protection for large transactions
573
+
574
+ **🛡️ Risk Management Framework:**
575
+ - **Portfolio Risk Limits**: VaR thresholds, concentration limits, correlation constraints
576
+ - **Protocol Due Diligence**: Smart contract audits, TVL stability, governance analysis
577
+ - **Liquidity Assessment**: Exit liquidity, impermanent loss analysis, slippage estimation
578
+ - **Market Risk**: Volatility analysis, correlation monitoring, stress testing scenarios
579
+
580
+ **📈 Performance Analytics:**
581
+ - **Yield Attribution**: Break down performance by protocol, asset, chain, and strategy
582
+ - **Risk-Adjusted Returns**: Sharpe ratio, Sortino ratio, maximum drawdown analysis
583
+ - **Benchmark Comparison**: Compare against passive strategies and market indices
584
+ - **Cost Analysis**: Track gas costs, slippage, and protocol fees impact on returns
585
+
586
+ **🚨 Alert System:**
587
+ - **Risk Alerts**: Portfolio VaR breaches, concentration risk, protocol issues
588
+ - **Performance Alerts**: Underperformance, negative yields, high slippage
589
+ - **Market Alerts**: Significant APY changes, new opportunities, protocol updates
590
+ - **Rebalancing Alerts**: When portfolio drift exceeds thresholds
591
+
592
+ Before making any DeFi recommendations, always:
593
+ 1. Assess current market conditions and protocol health
594
+ 2. Evaluate risk-adjusted returns, not just raw APY
595
+ 3. Consider transaction costs and gas fees in all calculations
596
+ 4. Check for protocol audits and security track record
597
+ 5. Analyze liquidity and potential exit scenarios
598
+
599
+ **Always prioritize capital preservation and risk management over maximum yield. Focus on sustainable, risk-adjusted returns with proper diversification across protocols and chains.**
600
+ `,
601
+ enableConversationMemory: true,
602
+ ...config.prompt
603
+ },
604
+ memory: {
605
+ enabled: true,
606
+ persistentThreadId: true,
607
+ maxMessages: 150,
608
+ ...config.memory
609
+ },
610
+ services: {
611
+ messageService: true,
612
+ ragService: true,
613
+ analyticsService: true,
614
+ loggingEnabled: true,
615
+ ...config.services
616
+ },
617
+ ...config
618
+ };
619
+ return StandardAgent.createDataAnalysisAgent(defaultConfig);
620
+ }
621
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAsC,EAAE;IACzE,MAAM,aAAa,GAAgB;QACjC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,eAAe;QACpC,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,8CAA8C;QAEjF,KAAK,EAAE;YACL,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,uBAAuB;YACrG,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,uBAAuB;YAC9F,GAAG,MAAM,CAAC,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;;;;;;;;;;;;;;;;;;OA4ER;YACD,wBAAwB,EAAE,IAAI;YAC9B,GAAG,MAAM,CAAC,MAAM;SACjB;QAED,MAAM,EAAE;YACN,OAAO,EAAE,IAAI;YACb,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,GAAG;YAChB,GAAG,MAAM,CAAC,MAAM;SACjB;QAED,QAAQ,EAAE;YACR,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,IAAI;YACpB,GAAG,MAAM,CAAC,QAAQ;SACnB;QAED,GAAG,MAAM;KACV,CAAC;IAEF,OAAO,aAAa,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @autonoma/agent-core
3
+ *
4
+ * Standardized agent core for autonoma AI trading platform.
5
+ * Provides consistent agent architecture with LangGraph + AgentKit integration.
6
+ */
7
+ export { StandardAgent, AgentUtils } from './core.js';
8
+ export { BaseAgent } from './base-agent.js';
9
+ export * from './factory.js';
10
+ export * from './types.js';
11
+ export * from './streaming.js';
12
+ export * from './error-handler.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAG3B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @autonoma/agent-core
3
+ *
4
+ * Standardized agent core for autonoma AI trading platform.
5
+ * Provides consistent agent architecture with LangGraph + AgentKit integration.
6
+ */
7
+ // Core agent implementation
8
+ export { StandardAgent, AgentUtils } from './core.js';
9
+ // Base agent class for reusability
10
+ export { BaseAgent } from './base-agent.js';
11
+ // Agent factory functions
12
+ export * from './factory.js';
13
+ // Type definitions
14
+ export * from './types.js';
15
+ // Streaming helpers
16
+ export * from './streaming.js';
17
+ // Standardized error handling
18
+ export * from './error-handler.js';
19
+ //# sourceMappingURL=index.js.map