Skip to content

Feat/ai agents#1

Merged
Leninner merged 2 commits into
developfrom
feat/ai-agents
Oct 7, 2025
Merged

Feat/ai agents#1
Leninner merged 2 commits into
developfrom
feat/ai-agents

Conversation

@Leninner

Copy link
Copy Markdown
Collaborator

No description provided.

@Leninner Leninner requested review from Copilot and devjaes September 29, 2025 01:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an AI agents system for processing voice commands to automatically create transactions, savings goals, and budgets using OpenAI's Whisper and GPT models.

  • Implements a voice command processing system with AI agents for different financial entities
  • Adds OpenAI integration for audio transcription and natural language processing
  • Creates a multi-agent architecture with specialized services for transactions, goals, budgets, and validation

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/features/ai-agents/infrastructure/controllers/voice-command.controller.ts Main controller handling voice command API endpoint with authentication
src/features/ai-agents/infrastructure/adapters/openai-transcription.adapter.ts OpenAI Whisper integration for audio transcription
src/features/ai-agents/infrastructure/adapters/openai-llm.adapter.ts OpenAI GPT integration for intent classification and data extraction
src/features/ai-agents/domain/ports/transcription.port.ts Interface definitions for transcription and LLM services
src/features/ai-agents/domain/entities/voice-command.entity.ts Domain entities and types for voice commands and agent responses
src/features/ai-agents/application/use-cases/process-voice-command.use-case.ts Use case orchestrating voice command processing logic
src/features/ai-agents/application/services/voice-orchestrator.service.ts Main orchestrator coordinating all AI agents
src/features/ai-agents/application/services/validation-agent.service.ts Agent responsible for validating extracted data
src/features/ai-agents/application/services/transaction-agent.service.ts Specialized agent for processing transaction data
src/features/ai-agents/application/services/goal-agent.service.ts Specialized agent for processing savings goal data
src/features/ai-agents/application/services/budget-agent.service.ts Specialized agent for processing budget data
src/features/ai-agents/README.md Documentation for the AI agents system
src/app.ts Integration of AI agents controller into main application
package.json Addition of LangChain dependencies
docker-compose.yaml PostgreSQL version upgrade
Dockerfile Build configuration update

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


export class OpenAILLMAdapter implements ILLMService {
private apiKey: string;
private apiUrl = 'https://api.openai.com/v1/completions';

Copilot AI Sep 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OpenAI completions endpoint is deprecated. Use the chat completions endpoint 'https://api.openai.com/v1/chat/completions' instead for GPT models.

Suggested change
private apiUrl = 'https://api.openai.com/v1/completions';
private apiUrl = 'https://api.openai.com/v1/chat/completions';

Copilot uses AI. Check for mistakes.
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-3.5-turbo-instruct',

Copilot AI Sep 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'gpt-3.5-turbo-instruct' model is for the deprecated completions endpoint. When switching to chat completions, use 'gpt-3.5-turbo' or 'gpt-4' and format the request with a messages array instead of a prompt string.

Copilot uses AI. Check for mistakes.
Comment thread package.json
"dependencies": {
"@getbrevo/brevo": "^2.2.0",
"@hono/zod-openapi": "^0.18.3",
"@langchain/core": "^0.3.77",

Copilot AI Sep 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LangChain dependencies are added but not used in the codebase. Consider removing these unused dependencies or implement LangChain integration if intended.

Copilot uses AI. Check for mistakes.
Comment thread package.json
"i": "^0.3.7",
"jose": "^5.9.6",
"json2csv": "^6.0.0-alpha.2",
"langchain": "^0.3.34",

Copilot AI Sep 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LangChain dependencies are added but not used in the codebase. Consider removing these unused dependencies or implement LangChain integration if intended.

Suggested change
"langchain": "^0.3.34",

Copilot uses AI. Check for mistakes.

const app = new Hono();

const OPENAI_API_KEY = process.env.OPENAI_API_KEY || '';

Copilot AI Sep 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an empty string as fallback for OPENAI_API_KEY could lead to API calls with invalid credentials. Consider throwing an error or using a more explicit validation when the API key is missing.

Suggested change
const OPENAI_API_KEY = process.env.OPENAI_API_KEY || '';
if (!process.env.OPENAI_API_KEY) {
throw new Error("OPENAI_API_KEY environment variable is required but not set.");
}
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;

Copilot uses AI. Check for mistakes.

@devjaes devjaes left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elegant

@Leninner Leninner merged commit 805ca0a into develop Oct 7, 2025
1 check passed
@Leninner Leninner deleted the feat/ai-agents branch October 7, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants