Skip to content

Add support for VectorDB and Document Semantic Search #15

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

Draft
wants to merge 1 commit into
base: feature/enhancements
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ test/perf/.generated

# Dependencies
node_modules/
*/.idea/
**/.idea/
12 changes: 12 additions & 0 deletions config/gni/devtools_grd_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,9 @@ grd_files_release_sources = [
"front_end/panels/ai_chat/tools/StreamlinedSchemaExtractorTool.js",
"front_end/panels/ai_chat/tools/VisitHistoryManager.js",
"front_end/panels/ai_chat/tools/FullPageAccessibilityTreeToMarkdownTool.js",
"front_end/panels/ai_chat/tools/VectorDBClient.js",
"front_end/panels/ai_chat/tools/BookmarkStoreTool.js",
"front_end/panels/ai_chat/tools/DocumentSearchTool.js",
"front_end/panels/ai_chat/common/utils.js",
"front_end/panels/ai_chat/common/log.js",
"front_end/panels/ai_chat/common/context.js",
Expand All @@ -646,6 +649,9 @@ grd_files_release_sources = [
"front_end/panels/ai_chat/agent_framework/AgentRunner.js",
"front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.js",
"front_end/panels/ai_chat/agent_framework/implementation/ConfiguredAgents.js",
"front_end/panels/ai_chat/agent_framework/implementation/EmailAgents.js",
"front_end/panels/ai_chat/agent_framework/implementation/JobApplicationAgents.js",
"front_end/panels/ai_chat/agent_framework/implementation/OnboardingAgents.js",
"front_end/panels/ai_chat/common/MarkdownViewerUtil.js",
"front_end/panels/ai_chat/evaluation/runner/VisionAgentEvaluationRunner.js",
"front_end/panels/ai_chat/evaluation/runner/EvaluationRunner.js",
Expand All @@ -654,6 +660,12 @@ grd_files_release_sources = [
"front_end/panels/ai_chat/evaluation/framework/MarkdownReportGenerator.js",
"front_end/panels/ai_chat/evaluation/framework/types.js",
"front_end/panels/ai_chat/evaluation/test-cases/action-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/email-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/job-application-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/onboarding-agent-tests.js",
"front_end/panels/ai_chat/evaluation/examples/run-email-agent-tests.js",
"front_end/panels/ai_chat/evaluation/examples/run-job-application-tests.js",
"front_end/panels/ai_chat/evaluation/examples/run-onboarding-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/research-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/schema-extractor-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/streamlined-schema-extractor-tests.js",
Expand Down
24 changes: 24 additions & 0 deletions front_end/panels/ai_chat/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ devtools_module("ai_chat") {
"tools/StreamlinedSchemaExtractorTool.ts",
"tools/CombinedExtractionTool.ts",
"tools/FullPageAccessibilityTreeToMarkdownTool.ts",
"tools/VectorDBClient.ts",
"tools/BookmarkStoreTool.ts",
"tools/DocumentSearchTool.ts",
"agent_framework/ConfigurableAgentTool.ts",
"agent_framework/AgentRunner.ts",
"agent_framework/implementation/ConfiguredAgents.ts",
"agent_framework/implementation/EmailAgents.ts",
"agent_framework/implementation/JobApplicationAgents.ts",
"agent_framework/implementation/OnboardingAgents.ts",
"evaluation/framework/types.ts",
"evaluation/framework/judges/LLMEvaluator.ts",
"evaluation/framework/GenericToolEvaluator.ts",
Expand All @@ -70,6 +76,12 @@ devtools_module("ai_chat") {
"evaluation/test-cases/streamlined-schema-extractor-tests.ts",
"evaluation/test-cases/research-agent-tests.ts",
"evaluation/test-cases/action-agent-tests.ts",
"evaluation/test-cases/email-agent-tests.ts",
"evaluation/test-cases/job-application-agent-tests.ts",
"evaluation/test-cases/onboarding-agent-tests.ts",
"evaluation/examples/run-email-agent-tests.ts",
"evaluation/examples/run-job-application-tests.ts",
"evaluation/examples/run-onboarding-agent-tests.ts",
"evaluation/runner/EvaluationRunner.ts",
"evaluation/runner/VisionAgentEvaluationRunner.ts",
"common/MarkdownViewerUtil.ts",
Expand Down Expand Up @@ -135,9 +147,15 @@ _ai_chat_sources = [
"tools/StreamlinedSchemaExtractorTool.ts",
"tools/CombinedExtractionTool.ts",
"tools/FullPageAccessibilityTreeToMarkdownTool.ts",
"tools/VectorDBClient.ts",
"tools/BookmarkStoreTool.ts",
"tools/DocumentSearchTool.ts",
"agent_framework/ConfigurableAgentTool.ts",
"agent_framework/AgentRunner.ts",
"agent_framework/implementation/ConfiguredAgents.ts",
"agent_framework/implementation/EmailAgents.ts",
"agent_framework/implementation/JobApplicationAgents.ts",
"agent_framework/implementation/OnboardingAgents.ts",
"evaluation/framework/types.ts",
"evaluation/framework/judges/LLMEvaluator.ts",
"evaluation/framework/GenericToolEvaluator.ts",
Expand All @@ -151,6 +169,12 @@ _ai_chat_sources = [
"evaluation/test-cases/streamlined-schema-extractor-tests.ts",
"evaluation/test-cases/research-agent-tests.ts",
"evaluation/test-cases/action-agent-tests.ts",
"evaluation/test-cases/email-agent-tests.ts",
"evaluation/test-cases/job-application-agent-tests.ts",
"evaluation/test-cases/onboarding-agent-tests.ts",
"evaluation/examples/run-email-agent-tests.ts",
"evaluation/examples/run-job-application-tests.ts",
"evaluation/examples/run-onboarding-agent-tests.ts",
"evaluation/runner/EvaluationRunner.ts",
"evaluation/runner/VisionAgentEvaluationRunner.ts",
"common/MarkdownViewerUtil.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ import { FetcherTool } from '../../tools/FetcherTool.js';
import { FinalizeWithCritiqueTool } from '../../tools/FinalizeWithCritiqueTool.js';
import { SchemaBasedExtractorTool } from '../../tools/SchemaBasedExtractorTool.js';
import { StreamlinedSchemaExtractorTool } from '../../tools/StreamlinedSchemaExtractorTool.js';
import { BookmarkStoreTool } from '../../tools/BookmarkStoreTool.js';
import { DocumentSearchTool } from '../../tools/DocumentSearchTool.js';
import { NavigateURLTool, PerformActionTool, GetAccessibilityTreeTool, SearchContentTool, NavigateBackTool, NodeIDsToURLsTool, TakeScreenshotTool } from '../../tools/Tools.js';
import { AIChatPanel } from '../../ui/AIChatPanel.js';
import { ChatMessageEntity, type ChatMessage } from '../../ui/ChatView.js';
import {
ConfigurableAgentTool,
ToolRegistry, type AgentToolConfig, type ConfigurableAgentArgs
} from '../ConfigurableAgentTool.js';
import { initializeEmailAgents } from './EmailAgents.js';
import { initializeJobApplicationAgents } from './JobApplicationAgents.js';
import { initializeOnboardingAgents } from './OnboardingAgents.js';

/**
* Initialize all configured agents
Expand All @@ -31,6 +36,10 @@ export function initializeConfiguredAgents(): void {
ToolRegistry.registerToolFactory('get_page_content', () => new GetAccessibilityTreeTool());
ToolRegistry.registerToolFactory('search_content', () => new SearchContentTool());
ToolRegistry.registerToolFactory('take_screenshot', () => new TakeScreenshotTool());

// Register bookmark and document search tools
ToolRegistry.registerToolFactory('bookmark_store', () => new BookmarkStoreTool());
ToolRegistry.registerToolFactory('document_search', () => new DocumentSearchTool());

// Create and register Research Agent
const researchAgentConfig = createResearchAgentConfig();
Expand Down Expand Up @@ -77,6 +86,15 @@ export function initializeConfiguredAgents(): void {
const ecommerceProductInfoAgentConfig = createEcommerceProductInfoAgentConfig();
const ecommerceProductInfoAgent = new ConfigurableAgentTool(ecommerceProductInfoAgentConfig);
ToolRegistry.registerToolFactory('ecommerce_product_info_fetcher_tool', () => ecommerceProductInfoAgent);

// Initialize all email agents
initializeEmailAgents();

// Initialize all job application agents
initializeJobApplicationAgents();

// Initialize all onboarding agents
initializeOnboardingAgents();
}

/**
Expand Down Expand Up @@ -148,7 +166,9 @@ Remember: You are a tool that executes research autonomously. Complete your task
'navigate_back',
'fetcher_tool',
'schema_based_extractor',
'node_ids_to_urls'
'node_ids_to_urls',
'bookmark_store',
'document_search'
],
maxIterations: 15,
modelName: () => AIChatPanel.getMiniModel(),
Expand Down
1 change: 1 addition & 0 deletions front_end/panels/ai_chat/core/BaseOrchestratorAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export function getSystemPrompt(agentType: string): string {
export function getAgentTools(agentType: string): Array<Tool<any, any>> {
return AGENT_CONFIGS[agentType]?.availableTools || [
ToolRegistry.getToolInstance('action_agent') || (() => { throw new Error('action_agent tool not found'); })(),
ToolRegistry.getToolInstance('document_search') || (() => { throw new Error('document_search tool not found'); })(),
new NavigateURLTool(),
new NavigateBackTool(),
new SchemaBasedExtractorTool(),
Expand Down
Loading