Skip to content

Commit e070578

Browse files
committed
feat: Add Financial Chart Tools and MongoDB integration
- Introduced new financial chart tools including Chart Supervisor, Chart Generator, Chart Data Processor, and Chart Type Advisor. - Implemented MongoDB configuration for vector storage and retrieval, enabling advanced semantic search capabilities. - Updated sample dataset to improve formatting and consistency in output. - Enhanced the index.ts file to include new financial chart agents in the Mastra framework. - Documented new tools in AGENTS.md with descriptions, statuses, and dependencies. - Added MongoDB vector query and memory management functionalities to support RAG applications. - Improved error handling and logging for chart generation and data processing tools.
1 parent 071ecb9 commit e070578

13 files changed

Lines changed: 1278 additions & 947 deletions

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@mastra/arize": "^0.1.1",
5151
"@mastra/auth-supabase": "^0.10.9",
5252
"@mastra/client-js": "^0.16.15",
53+
"@mastra/cloudflare-d1": "^0.13.9",
5354
"@mastra/core": "^0.24.6",
5455
"@mastra/deployer": "^0.24.6",
5556
"@mastra/evals": "^0.14.4",
@@ -63,6 +64,7 @@
6364
"@mastra/pg": "^0.17.9",
6465
"@mastra/rag": "^1.3.6",
6566
"@mastra/upstash": "^0.15.9",
67+
"@mastra/vectorize": "^0.11.17",
6668
"@mastra/voice-google": "^0.11.12",
6769
"@mastra/voice-openai": "^0.11.12",
6870
"@mcpc-tech/acp-ai-provider": "^0.1.25",
@@ -163,4 +165,4 @@
163165
"body-parser": "^2.2.1",
164166
"@mastra/core": "^0.24.6"
165167
}
166-
}
168+
}

src/mastra/agents/AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Agent Developer — objective: Implement higher-level behaviors by composing too
1010

1111
This directory contains 22+ agent definitions that map use-case intents to sequences of tool invocations, policies, and memory usage.
1212

13-
## Current Agents (22 files)
13+
## Current Agents (26 files)
1414

1515
| File | Export | Agent ID | Purpose | Dependencies |
1616
| ---------------------------- | -------------------------- | -------------------------- | ---------------------------------------------------------------- | --------------------------------- |
@@ -28,6 +28,10 @@ This directory contains 22+ agent definitions that map use-case intents to seque
2828
| `contentStrategistAgent.ts` | `contentStrategistAgent` | `contentStrategistAgent` | Develops content strategies and plans | Research Tools |
2929
| `scriptWriterAgent.ts` | `scriptWriterAgent` | `scriptWriterAgent` | Writes scripts for video and audio content | NLP, Script Formatting |
3030
| `stockAnalysisAgent.ts` | `stockAnalysisAgent` | `stockAnalysisAgent` | Analyzes stock market data with technical/fundamental analysis | Polygon, Finnhub, AlphaVantage |
31+
| `recharts.ts` | `chartTypeAdvisorAgent` | `chart-type-advisor` | Recommends optimal Recharts chart types for financial data | Recharts |
32+
| `recharts.ts` | `chartDataProcessorAgent` | `chart-data-processor` | Transforms financial API data into Recharts format | Polygon, Finnhub, AlphaVantage |
33+
| `recharts.ts` | `chartGeneratorAgent` | `chart-generator` | Generates Recharts React component code | Recharts |
34+
| `recharts.ts` | `chartSupervisorAgent` | `chart-supervisor` | Orchestrates the chart creation pipeline | Polygon, Finnhub, AlphaVantage |
3135
| `dataExportAgent.ts` | `dataExportAgent` | `dataExportAgent` | JSON → CSV conversion, file writing, backup, validation | CSV/JSON Tools, File System |
3236
| `dataIngestionAgent.ts` | `dataIngestionAgent` | `dataIngestionAgent` | CSV parsing, file reading, structure validation | CSV/JSON Tools, File System |
3337
| `dataTransformationAgent.ts` | `dataTransformationAgent` | `dataTransformationAgent` | CSV↔JSON↔XML transformations and restructuring | Data Processing Tools |
@@ -110,6 +114,7 @@ npm test src/mastra/__tests__/agents/your-agent.test.ts
110114

111115
| Version | Date (UTC) | Changes |
112116
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ |
117+
| 2.1.0 | 2025-11-28 | Added 4 Financial Chart agents: chartTypeAdvisorAgent, chartDataProcessorAgent, chartGeneratorAgent, chartSupervisorAgent. |
113118
| 2.0.0 | 2025-11-26 | Major update: 22 agents documented. Added data pipeline, research paper, document processing, knowledge indexing agents. |
114119
| 1.2.0 | 2025-11-19 | Added content creation and stock analysis agents. |
115120
| 1.1.0 | 2025-11-16 | Complete reorganization of agents documentation. Added detailed sections for each agent, development guidelines, and best practices. |

src/mastra/agents/contentStrategistAgent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { pgMemory } from '../config/pg-storage';
44
import { webScraperTool } from '../tools/web-scraper-tool';
55
import { InternalSpans } from '@mastra/core/ai-tracing';
66
import { structureScorer, creativityScorer } from '../scorers';
7+
import { chartSupervisorTool } from '../tools/financial-chart-tools';
78

89
export const contentStrategistAgent = new Agent({
910
id: 'content-strategist',
@@ -89,6 +90,7 @@ Output:
8990
memory: pgMemory,
9091
tools: {
9192
webScraperTool,
93+
chartSupervisorTool
9294
},
9395
scorers: {
9496
structure: {

src/mastra/agents/copywriterAgent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { pgMemory } from '../config/pg-storage'
1212
import { googleAI, googleAIFlashLite } from '../config/google'
1313
import { creativityScorer, responseQualityScorer, toneConsistencyScorer, structureScorer } from '../scorers'
1414
import { InternalSpans } from '@mastra/core/ai-tracing'
15+
import { chartSupervisorTool } from '../tools/financial-chart-tools'
1516

1617
// Define runtime context for this agent
1718
export interface CopywriterAgentContext {
@@ -131,6 +132,7 @@ Provide the final content in a clear, well-structured format appropriate for the
131132
// linkExtractorTool,
132133
htmlToMarkdownTool,
133134
contentCleanerTool,
135+
chartSupervisorTool
134136
},
135137
scorers: {
136138
creativity: {

src/mastra/agents/dataIngestionAgent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
getDataFileInfoTool,
1414
} from '../tools/data-file-manager'
1515
import { readCSVDataTool } from '../tools/data-processing-tools'
16+
import { chartSupervisorTool } from '../tools/financial-chart-tools'
1617

1718
export interface DataIngestionContext {
1819
userId?: string
@@ -97,6 +98,7 @@ export const dataIngestionAgent = new Agent({
9798
dataValidatorTool,
9899
listDataDirTool,
99100
getDataFileInfoTool,
101+
chartSupervisorTool
100102
},
101103
options: { tracingPolicy: { internal: InternalSpans.AGENT } },
102104
})

0 commit comments

Comments
 (0)