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

Agentic analyzer #11

Merged
merged 20 commits into from
Feb 4, 2025
Merged

Agentic analyzer #11

merged 20 commits into from
Feb 4, 2025

Conversation

SuperMuel
Copy link
Owner

@SuperMuel SuperMuel commented Feb 4, 2025

Introducing an agentic report generator to replace the Clustering Analyzer

Description

This PR refactors the ClusteringSession model to a more generic AnalysisRun model. This change is crucial for introducing new analysis functionalities beyond just clustering, such as report generation which is implemented here.

Key Changes:

  • Introduces AnalysisRun model: Replaces the ClusteringSession document with a more generic AnalysisRun document to represent different types of analysis sessions.

  • Adds analysis_type field: Introduces an analysis_type field to the AnalysisRun model to differentiate between analysis types (e.g., "clustering", "report").

  • Polymorphic Parameter and Result Models:

    • Introduces AnalysisParams and AnalysisResult as base classes.
    • Creates subclasses ClusteringAnalysisParams, ReportAnalysisParams, ClusteringAnalysisResult, and ReportAnalysisResult to handle parameters and results specific to each analysis type.
  • Deprecates ClusteringSession model: The old ClusteringSession document is removed and replaced by AnalysisRun.

  • Updates Backend and Analyzer: Updates the backend API and analyzer components to utilize the new AnalysisRun and related models.

  • Introduces Report Generation Workflow:

    • Implements a new report generation workflow as an alternative to clustering analysis.
    • Utilizes LangGraph to orchestrate the report generation process as a stateful, multi-actor application.
    • Leverages OpenAI's o3-mini model for generating report outlines and claude-3.5-sonnet for writing report sections.
    • Fetches relevant articles and evaluates them for relevance before report generation.
    • Generates a markdown-formatted report summarizing key subjects and insights from the collected articles.
  • New Analysis Page in Frontend:

    • Adds a new "Analysis" page in the frontend (replacing the "Topics" page) to manage and visualize different types of analysis runs, including report generation.
    • Allows users to select between "Topic Clustering" and "Report Generation" when creating a new analysis run.
    • Displays the generated markdown report in the frontend for "Report Generation" analysis runs.

@SuperMuel SuperMuel merged commit 3baf5a9 into main Feb 4, 2025
1 check passed
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.

1 participant