Repository navigation
feat: refactor vector storage configuration and implement LanceDB #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -46,7 +46,7 @@ export const codeArchitectAgent = new Agent({ | |||
| instructions: ({ requestContext }: { requestContext: RequestContext<CodingRuntimeContext> }) => { | ||||
| const userTier = requestContext.get('user-tier') ?? 'free' | ||||
| const language = requestContext.get('language') ?? 'en' | ||||
| const projectRoot = requestContext.get('projectRoot') ?? process.cwd() | ||||
| // const projectRoot = requestContext.get('projectRoot') ?? process.cwd() | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove commented-out code. Commented-out code should be removed rather than left in the codebase. Version control preserves the history if needed. As per coding guidelines: "Avoid commenting out dead code. Use version control instead of maintaining commented code blocks." 🧹 Proposed fix- // const projectRoot = requestContext.get('projectRoot') ?? process.cwd()📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||
|
|
||||
| return { | ||||
| role: 'system', | ||||
|
|
@@ -55,7 +55,6 @@ export const codeArchitectAgent = new Agent({ | |||
| **Context:** | ||||
| - User Tier: ${userTier} | ||||
| - Language: ${language} | ||||
| - Project Root: ${projectRoot} | ||||
|
|
||||
| **Core Capabilities:** | ||||
| 1. **Architecture Analysis**: Evaluate existing code structure, identify patterns and anti-patterns | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import { listEvents } from '../tools/calendar-tool' | |||||||||||||||||||||||||||||||
| import { execaTool } from '../tools/execa-tool' | ||||||||||||||||||||||||||||||||
| import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google' | ||||||||||||||||||||||||||||||||
| import type { RequestContext } from '@mastra/core/request-context' | ||||||||||||||||||||||||||||||||
| import { TokenLimiterProcessor } from '@mastra/core/processors' | ||||||||||||||||||||||||||||||||
| import { BatchPartsProcessor, TokenLimiterProcessor } from '@mastra/core/processors' | ||||||||||||||||||||||||||||||||
| import { webScraperTool } from '../tools' | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| export interface DaneContext { | ||||||||||||||||||||||||||||||||
|
|
@@ -41,7 +41,13 @@ export const daneCommitMessage = new Agent({ | |||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| model: googleAIFlashLite, | ||||||||||||||||||||||||||||||||
| memory: pgMemory, | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(1048576)] | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(128576), | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| new BatchPartsProcessor({ | ||||||||||||||||||||||||||||||||
| batchSize: 10, | ||||||||||||||||||||||||||||||||
| maxWaitTime: 75, | ||||||||||||||||||||||||||||||||
| emitOnNonText: true | ||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
|
Comment on lines
+44
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Inconsistent formatting in outputProcessors array. The array formatting and indentation is inconsistent across agent definitions. Consider aligning the formatting for better readability and maintainability. ♻️ Suggested formatting- outputProcessors: [new TokenLimiterProcessor(128576),
- new BatchPartsProcessor({
- batchSize: 10,
- maxWaitTime: 75,
- emitOnNonText: true
- }),
- ]
+ outputProcessors: [
+ new TokenLimiterProcessor(128576),
+ new BatchPartsProcessor({
+ batchSize: 10,
+ maxWaitTime: 75,
+ emitOnNonText: true,
+ }),
+ ],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| export const daneIssueLabeler = new Agent({ | ||||||||||||||||||||||||||||||||
|
|
@@ -70,7 +76,13 @@ export const daneIssueLabeler = new Agent({ | |||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| model: googleAIFlashLite, | ||||||||||||||||||||||||||||||||
| memory: pgMemory, | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(1048576)] | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(128576), | ||||||||||||||||||||||||||||||||
| new BatchPartsProcessor({ | ||||||||||||||||||||||||||||||||
| batchSize: 10, | ||||||||||||||||||||||||||||||||
| maxWaitTime: 75, | ||||||||||||||||||||||||||||||||
| emitOnNonText: true | ||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| export const daneLinkChecker = new Agent({ | ||||||||||||||||||||||||||||||||
|
|
@@ -104,7 +116,13 @@ export const daneLinkChecker = new Agent({ | |||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| model: googleAIFlashLite, | ||||||||||||||||||||||||||||||||
| memory: pgMemory, | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(1048576)] | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(128576), | ||||||||||||||||||||||||||||||||
| new BatchPartsProcessor({ | ||||||||||||||||||||||||||||||||
| batchSize: 10, | ||||||||||||||||||||||||||||||||
| maxWaitTime: 75, | ||||||||||||||||||||||||||||||||
| emitOnNonText: true | ||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| export const daneChangeLog = new Agent({ | ||||||||||||||||||||||||||||||||
|
|
@@ -140,7 +158,13 @@ export const daneChangeLog = new Agent({ | |||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| model: googleAIFlashLite, | ||||||||||||||||||||||||||||||||
| memory: pgMemory, | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(1048576)] | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(128576), | ||||||||||||||||||||||||||||||||
| new BatchPartsProcessor({ | ||||||||||||||||||||||||||||||||
| batchSize: 10, | ||||||||||||||||||||||||||||||||
| maxWaitTime: 75, | ||||||||||||||||||||||||||||||||
| emitOnNonText: true | ||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| export const dane = new Agent({ | ||||||||||||||||||||||||||||||||
|
|
@@ -160,40 +184,30 @@ export const dane = new Agent({ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # Our tools: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## readPDF | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capable of reading PDF files. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## fsTool | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capable of reading and writing files to the local filesystem. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## execaTool | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capabale of executing files on the local system. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## googleSearch | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capabale answering all questions by finding the answer on Google search. | ||||||||||||||||||||||||||||||||
| Pass the query as a JS object. If you have links, ALWAYS CITE YOUR SOURCES. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## browserTool | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capable of scraping the web. Pass the url as a JS object. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## listEvents | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS. | ||||||||||||||||||||||||||||||||
| DO NOT ATTEMPT TO DO ANYTHING MORE. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## imageTool | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capable of generating images and saving them to disk. Pass the directory and an image prompt. | ||||||||||||||||||||||||||||||||
| ## webScraperTool | ||||||||||||||||||||||||||||||||
| Makes you a powerful agent capable of scraping web pages. Use this tool to get information from web pages. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # Rules | ||||||||||||||||||||||||||||||||
| * **Tool Efficiency:** Do NOT use the same tool repetitively or back-to-back for the same query. | ||||||||||||||||||||||||||||||||
| * DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE. Use the 'googleSearch' tool to find the answer. | ||||||||||||||||||||||||||||||||
| * DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE. Use the 'webScraperTool' tool to find the answer. | ||||||||||||||||||||||||||||||||
| * Don't reference tools when you communicate with the user. Do not mention what tools you are using. | ||||||||||||||||||||||||||||||||
| * Tell the user what you are doing. | ||||||||||||||||||||||||||||||||
| `, | ||||||||||||||||||||||||||||||||
| providerOptions: { | ||||||||||||||||||||||||||||||||
| google: { | ||||||||||||||||||||||||||||||||
| thinkingConfig: { | ||||||||||||||||||||||||||||||||
| includeThoughts: true, | ||||||||||||||||||||||||||||||||
| thinkingLevel: 'high', | ||||||||||||||||||||||||||||||||
| thinkingLevel: 'low', | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| responseModalities: ['TEXT'], | ||||||||||||||||||||||||||||||||
| } satisfies GoogleGenerativeAIProviderOptions, | ||||||||||||||||||||||||||||||||
|
|
@@ -208,5 +222,11 @@ export const dane = new Agent({ | |||||||||||||||||||||||||||||||
| webScraperTool, | ||||||||||||||||||||||||||||||||
| listEvents, | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(1048576)] | ||||||||||||||||||||||||||||||||
| outputProcessors: [new TokenLimiterProcessor(128576), | ||||||||||||||||||||||||||||||||
| new BatchPartsProcessor({ | ||||||||||||||||||||||||||||||||
| batchSize: 10, | ||||||||||||||||||||||||||||||||
| maxWaitTime: 75, | ||||||||||||||||||||||||||||||||
| emitOnNonText: true | ||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
|
Comment on lines
+225
to
+231
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider extracting shared outputProcessors configuration. The same ♻️ Extract shared configuration// At the top of the file, after imports
const defaultOutputProcessors = [
new TokenLimiterProcessor(128576),
new BatchPartsProcessor({
batchSize: 10,
maxWaitTime: 75,
emitOnNonText: true,
}),
];
// Then in each agent:
outputProcessors: defaultOutputProcessors,🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @mastra/qdrant package is being added to dependencies, but based on the PR description and the fact that qdrant.ts is being kept (with only an import path fix), this seems intentional. However, the PR title says "refactor vector storage configuration and implement LanceDB" and the description mentions "Removed the Qdrant vector configuration file", which conflicts with keeping qdrant.ts and adding the @mastra/qdrant dependency. This inconsistency should be clarified.