Skip to content
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

Intent classification #1

Closed
3 of 4 tasks
luandro opened this issue Nov 1, 2024 · 0 comments · Fixed by #19
Closed
3 of 4 tasks

Intent classification #1

luandro opened this issue Nov 1, 2024 · 0 comments · Fixed by #19
Assignees
Labels
feature New feature
Milestone

Comments

@luandro
Copy link
Contributor

luandro commented Nov 1, 2024

The goal of this issue is to design and implement an Intent Classifier Module that processes incoming messages and directs them to the appropriate plugin within the system based on intent. This module will be responsible for:

  1. Reading and Analyzing Messages: Access and interpret messages from the received messages database. If the message is in audio format, transcribe it to text before proceeding.

  2. Prompt tuning: What transformations should be made in the message to ensure accurate interpretation and classification?

  3. Intent Classification and Routing

Examples:

Greeting: Direct simple "hi" or introductory messages to the Greeting Plugin.

Transcription Requests: Forward transcription-specific requests (e.g., "Please transcribe this") to the Transcription Plugin.

Research Requests: Direct research-related messages to the Research Plugin.

Grant Writing Workflow: Detect and interpret specific requests within a grant-writing workflow, such as editing a section, moving to another section, or performing other grant-related tasks, and route them accordingly.

  1. Flexible Handling of Future Intents: Design the classifier in a way that allows easy addition of new intent categories as more plugins and functionalities are added to the system.

Acceptance Criteria

  • Module accurately transcribes audio messages to text and handles tuning of the prompt.

  • Intent classification correctly routes messages to the appropriate plugin, achieving >90% accuracy.

  • Grant writing intents (e.g., edit a section, move to another section) are detected and routed to the relevant plugin as expected.

  • The code is modular, allowing for easy future expansion to handle additional intents from any plugin spec.

Architecture

flowchart TB
    subgraph "Audio Processing Flow"
        RecvMsg[(received-messages)]
        
        Job[["Trigger.dev Job:
            id: 'process-audio'
            event: 'new-message'
            filter: type === 'audio'"]]
        
        Process["Transcription Process
            1. Get audio content
            2. Send to Whisper API
            3. Receive transcript"]
            
        UpdateMsg["Update Message:
            - content: transcript
            - status: 'transcribed'
            - processed_at: timestamp"]
            
        Error["Error Handler:
            - Log error details
            - Update status: 'failed'
            - Retry policy"]

        RecvMsg -->|New Audio| Job
        Job --> Process
        Process -->|Success| UpdateMsg
        Process -->|Failure| Error
        Error -->|Retry| Process
        UpdateMsg --> RecvMsg
    end

    %% Monitoring
    Monitor["Monitoring:
        - Transcription success rate
        - Processing time
        - Error types
        - Audio quality metrics"]
    
    Monitor -.->|Track| Process
Loading
flowchart TB
    subgraph "Intent Classification System"
        Input[(received-messages)]
        
        Job[["Trigger.dev Job:
            id: 'classify-intent'
            event: 'message-ready'"]]
            
        IntentProcess["Intent Classification:
            1. Load AI model
            2. Get and Add to memory
            3. Classify intent (Tool calling)
            4. Route to plugin"]
        
        PluginJob[["Trigger.dev Job:
            id: '{plugin-intent}'
            event: '{plugin-inputs}'"]]
            
        Error["Error Handling:
            - Invalid intent
            - Model errors
            - API failures"]

        Input -->|Text Ready| Job
        Job --> IntentProcess
        IntentProcess -->|Intent Classified| PluginJob
        IntentProcess -->|Failure| Error
        Error -->|Retry| IntentProcess
    end

    Monitor["LangTrace Monitoring:
        - Model performance
        - Intent distribution
        - Confidence scores
        -  Evaluation
        - Processing time"]
        
    Monitor -.->|Track| IntentProcess
Loading
@luandro luandro self-assigned this Nov 1, 2024
@luandro luandro added the enhancement New feature or request label Nov 1, 2024
@luandro luandro moved this to In Progress in Earth Defenders Assistant Nov 1, 2024
@luandro luandro added this to the MVP milestone Nov 1, 2024
@luandro luandro added feature New feature and removed enhancement New feature or request labels Nov 1, 2024
@luandro luandro moved this from In Progress to Todo in Earth Defenders Assistant Nov 4, 2024
@luandro luandro changed the title Implement Intent Classifier Module for Message Processing Implement intent classification module Nov 4, 2024
@luandro luandro changed the title Implement intent classification module Implement intent classification Nov 4, 2024
@luandro luandro changed the title Implement intent classification Intent classification Nov 4, 2024
@luandro luandro removed their assignment Nov 4, 2024
luandro added a commit that referenced this issue Nov 22, 2024
@luandro luandro moved this from Todo to In Progress in Earth Defenders Assistant Nov 23, 2024
@luandro luandro moved this to In Progress in Earth Defenders Assistant Nov 23, 2024
@Luisotee Luisotee linked a pull request Nov 27, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in Earth Defenders Assistant Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants