OpenVista:基于 Python/React/PyTorch 的开源项目健康分析与预测平台

用户可借助该平台分析和预测 GitHub 开源项目健康状况,其集成 MaxKB 智能问答系统与 GitPulse 多模态预测模型,通过多模态预测、CHAOSS 健康评分及智能问答,将原始数据转化为可操作情报,助力数据驱动决策。【此简介由AI生成】

Branch1Tags0
FilesLast commitLast update
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago

🔮 OpenVista

Multimodal Time-Series Prediction Platform for GitHub Repository Health

OpenVista Dashboard

Python React PyTorch TypeScript License

English · 中文文档


🌟 Overview

OpenVista is a next-generation platform for analyzing and predicting the health of open-source GitHub repositories. The platform integrates two core capabilities:

  1. 🤖 MaxKB Intelligent Q&A System — RAG-based knowledge base for project documentation
  2. 🔮 GitPulse Multimodal Prediction Model — Intelligent forecasting combining time-series and text

Together, these modules provide comprehensive analysis of open-source projects: past, present, and future.


💡 The Problem We're Solving

Open-source projects face numerous challenges in maintaining long-term health and sustainability. Our research, based on 600+ GitHub repositories, reveals critical gaps in how we understand and predict project health:

🔴 Current Pain Points

  1. Fragmented Health Assessment

    • Traditional metrics (Stars, Commits) provide only partial insights
    • No unified framework to evaluate project health holistically
    • Hard to identify early warning signs of declining projects
  2. Incomplete Prediction Models

    • Existing approaches rely solely on time-series metrics (R² ≈ 0.46)
    • Ignore rich textual information (README, Issues, documentation)
    • Cannot capture semantic signals about project direction and community engagement
  3. High Collaboration Friction

    • Poorly written Issues increase maintenance burden
    • Incomplete documentation barriers new contributors
    • Lack of structured guidance for improving project health
  4. Limited Actionable Insights

    • Raw metrics don't translate to actionable recommendations
    • No systematic way to understand "why" a project is struggling
    • Difficult to discover similar projects for learning and collaboration

✅ Our Solution

OpenVista addresses these challenges through three innovations:

  1. Multimodal Prediction — Combining time-series metrics with textual features improves prediction accuracy by 66.7% (R²: 0.46 → 0.77)
  2. CHAOSS-Based Health Scoring — Six-dimensional framework providing comprehensive health assessment
  3. Intelligent Q&A — RAG-powered knowledge base enabling natural language queries about any repository

Our platform transforms raw data into actionable intelligence, helping maintainers, contributors, and organizations make data-driven decisions about open-source projects.


📑 Table of Content


🛠️ Tech Stack

Tech Architecture

Backend

  • Framework: Flask (Python)
  • Deep Learning: PyTorch 2.0+
  • NLP: Transformers (DistilBERT)
  • Data Processing: Pandas, NumPy

Frontend

  • Framework: React 18+ with TypeScript
  • Styling: Tailwind CSS
  • Charts: Recharts + Custom SVG
  • Animation: Framer Motion

AI & Knowledge Base

  • RAG System: MaxKB
  • LLM Backup: DeepSeek API
  • Text Encoding: DistilBERT

Data Sources

  • GitHub API: Issues, PRs, Commits
  • OpenDigger: 16 time-series metrics

📁 Project Structure

OpenVista/
├── 🔧 backend/                     # Flask Backend
│   ├── Agent/                      # AI & MaxKB Integration
│   │   ├── maxkb_client.py         # MaxKB Knowledge Base Client
│   │   ├── prediction_explainer.py # AI Prediction Explainer
│   │   └── qa_agent.py             # Intelligent Q&A Agent
│   │
│   ├── DataProcessor/              # Data Crawling & Processing
│   │   ├── crawl_monthly_data.py   # Main Crawler Entry
│   │   ├── github_text_crawler.py  # GitHub Text Crawler
│   │   ├── maxkb_uploader.py       # MaxKB Document Uploader
│   │   └── monthly_crawler.py      # OpenDigger Data Crawler
│   │
│   ├── GitPulse/                   # GitPulse Prediction Model
│   │   ├── model.py                # Model Architecture
│   │   ├── prediction_service.py   # Prediction Service
│   │   └── gitpulse_weights.pt     # Trained Model Weights (LFS)
│   │
│   ├── CHAOSSEvaluation/           # Community Health Scoring
│   │   └── chaoss_calculator.py    # CHAOSS Metric Calculator
│   │
│   └── app.py                      # Flask API Entry Point
│
├── 🎨 frontend/                    # React Frontend
│
├── 📊 get-dataset/                 # Training Dataset Generator
│
├── 🔬 GitPulse-Training/          # GitPulse Model Training & Reproduction
│   ├── model/                     # Model Architecture Definitions
│   ├── training/                  # Training Scripts
│   ├── Fine-tuning/               # Fine-tuning Experiments
│   ├── predict/                   # Prediction Scripts
│   ├── ablation-test/             # Ablation Studies
│   ├── baseline-test/             # Baseline Comparisons
│   └── Pretrain-data/             # Training Dataset
│
├── 🐳 maxkb-export/                # MaxKB Deployment Config
│   ├── install.sh                  # One-click Install Script
│   ├── docker-compose.yml          # Docker Compose File
│   └── db/                         # Database Backup
│
└── 📄 README.md

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • Docker Desktop (for MaxKB)
  • Git (Git LFS auto-installed)

We provide unified setup scripts that automate all configuration:

Windows PowerShell:

git clone https://github.com/your-username/OpenVista.git
cd OpenVista
.\setup.ps1

Linux / macOS:

git clone https://github.com/your-username/OpenVista.git
cd OpenVista
chmod +x setup.sh && ./setup.sh

The setup script will automatically:

Step Description
📦 Git LFS Pull model weights, training data, knowledge base
🐳 Docker Detect installation, guide setup if needed
🤖 MaxKB Deploy knowledge base, auto-restore data
🔑 API Keys Configure GitHub Token & DeepSeek API Key
📚 Dependencies Optional Python/Node.js installation
🚀 Launch Services Auto-start backend, frontend, open browser

📖 Manual Installation (Advanced)

Click to expand manual steps

1️⃣ Clone & Initialize

git clone https://github.com/your-username/OpenVista.git
cd OpenVista

# Pull large files (model weights, training data)
git lfs install
git lfs pull

2️⃣ Deploy MaxKB

cd maxkb-export
chmod +x install.sh
./install.sh  # Windows: .\install.ps1

Visit http://localhost:8080 to verify MaxKB is running.

3️⃣ Environment Configuration

Create a .env file in the project root directory:

# GitHub API Token (required)
GITHUB_TOKEN=your_github_token

# DeepSeek API Key (for AI features)
DEEPSEEK_API_KEY=your_deepseek_key

4️⃣ Install Dependencies

# Backend
cd backend
pip install -r requirements.txt

# Frontend
cd ../frontend
npm install

🚀 Launch Services

# Terminal 1: Start Backend (port 5000)
cd backend
python app.py

# Terminal 2: Start Frontend (port 3000)
cd frontend
npm run dev

🌐 Access the Platform

Service URL
Frontend http://localhost:3000
Backend API http://localhost:5000
MaxKB Knowledge Base http://localhost:8080

📖 Usage Guide

Basic Workflow

  1. 🔍 Search Repository — Enter owner/repo (e.g., facebook/react)
  2. ⏳ Wait for Crawling — Data fetched from GitHub API & OpenDigger
  3. 📊 Explore Analytics — View time-series charts, Issue analysis
  4. 🔮 Check Predictions — See 12-month forecasts with AI explanations
  5. 📈 CHAOSS Evaluation — Assess community health scores
  6. 🤖 AI Q&A — Use MaxKB to ask questions about the repository

Note: Issue analysis, predictions with AI explanations, and MaxKB Q&A are available only after crawling completes. You can track progress via the frontend progress bar at the bottom of the page or in the backend logs. A completed crawl stores data under backend/DataProcessor/data/owner_repo/, for example backend/DataProcessor/data/odoo_odoo/, with a monthly_data_YYYYMMDD_HHMMSS/ folder containing metadata.json, raw_monthly_data.json, text_for_maxkb/ (README/License/docs), and timeseries_for_model/ (monthly JSON files plus summary).


🤖 MaxKB Intelligent Q&A System

MaxKB Knowledge Base

System Architecture

MaxKB is the AI Q&A core of OpenVista, using RAG (Retrieval-Augmented Generation) technology to enable natural language questions about any analyzed repository.

User Question → MaxKB Retrieves from Knowledge Base → LLM Generates Answer → Response

Knowledge Base Contents

The system automatically builds a knowledge base for each analyzed repository:

Document Type Description
📄 README Project introduction, installation guide, usage instructions
📜 LICENSE Open source license information
📁 docs/ All documents in the project's docs directory
📊 Project Summary AI-generated project analysis report
🐛 Issue Summary Sampled issue data (30 issues/month × 50 months max)

Tech Stack & Tools

Component Tool/Technology Description
Knowledge Base Platform MaxKB Open-source RAG knowledge base system
Deployment Docker Compose One-click deployment with data persistence
Vector Database PostgreSQL + pgvector Efficient vector similarity search
LLM Backend Configurable (DeepSeek/OpenAI etc.) Supports multiple LLM providers

MaxKB Initialization & Setup

If you didn’t set it up earlier, you can configure MaxKB here

Deployment & Configuration

Windows PowerShell:

cd maxkb-export

# One-click install (includes database backup restoration)
.\install.ps1

Linux / macOS:

cd maxkb-export

# One-click install (includes database backup restoration)
chmod +x install.sh
./install.sh

Note: chmod +x is a Linux/Unix command that makes the script executable. Windows users should use install.ps1 instead.

The installation script will automatically:

  • Pull MaxKB Docker image
  • Create data volumes and restore pre-configured data
  • Start service at http://localhost:8080
Option 2: Fresh Installation
# Start with Docker Compose
docker-compose -f docker-compose.maxkb.yml up -d

After installation, open http://localhost:8080. The page should look like:

MaxKB initialization page

Since initialization is already done during install, the default account is:

  • Username: admin
  • Password: MaxKB@123456

After login, follow the MaxKB official docs to:

  1. Create a knowledge base (for project documents)
  2. Create a "Simple Application" and associate it with the knowledge base
  3. Choose and configure the LLM in "Models"; if you need web search, create and configure the required "Tools"

Once finished, you will have a MaxKB-powered RAG knowledge base system.

Configure .env File

Create a .env file in the project root directory with the following configuration:

# MaxKB Service Configuration
MAXKB_URL=http://localhost:8080
MAXKB_USERNAME=admin
MAXKB_PASSWORD=your_password
MAXKB_KNOWLEDGE_ID=your_knowledge_id

# MaxKB AI API (for Q&A)
MAXKB_AI_URL=http://localhost:8080/chat/api/019adeb1-9073-7320-bce2-295...
MAXKB_API_KEY=application-c527aa669276e38ab7880b1f43255c9a
📖 Click to expand: How to get MaxKB API configuration values

How to Get MaxKB API Configuration Values

After setting up MaxKB, write the corresponding API configuration into your .env file:

1. MAXKB_KNOWLEDGE_ID

Steps to get Knowledge Base ID:

  1. Log in to MaxKB at http://localhost:8080
  2. Navigate to 知识库 (Knowledge Base) in the top menu
  3. Create a new knowledge base or select an existing one
  4. Click into the knowledge base to view its documents
  5. Look at the URL in your browser. It will look like:
    http://localhost:8080/admin/knowledge/019ae417-2fc017ed1652/default/document
    
  6. The Knowledge Base ID is the part between /knowledge/ and /default/:
    • In the example above: 019ae417-2fc017ed1652
    • Copy this ID and use it as MAXKB_KNOWLEDGE_ID

Knowledge Base ID Location

2. MAXKB_AI_URL

Steps to get API Base URL:

  1. In MaxKB, navigate to 应用 (Application) in the top menu
  2. Create a new application or select an existing one
  3. On the application overview page, find the API 访问凭据 (API Access Credentials) section
  4. Copy the Base URL value, for example:
    http://localhost:8080/chat/api/019adeb1-9073-7320-bce2-295...
    
  5. Use this as your MAXKB_AI_URL value

API Base URL Location

3. MAXKB_API_KEY

Steps to create API Key:

  1. On the same application overview page, click the API Key button
  2. In the API Key management dialog, click 创建 (Create)
  3. A new API key will be generated, starting with application-, for example:
    application-c527aa669276e38ab7880b1f43255c9a
    
  4. Click the copy icon to copy the API key
  5. Use this as your MAXKB_API_KEY value

API Key Creation

Note: Keep your API key secure and don't commit it to version control. The .env file is already in .gitignore.

Usage

  1. Automatic Document Upload: Documents are automatically uploaded to MaxKB during repository crawling
  2. Intelligent Q&A: Ask questions in the platform's AI Q&A module
  3. Prediction Explanations: MaxKB generates interpretability analysis for predictions
AI Agent

🔬 GitPulse Prediction Model

Model Performance

Performance Comparison

Evaluated on 636 test samples from 4,232 samples(Generated from 600+ projects) (Two-stage training: Pretrain + Fine-tune):

Model MSE ↓ MAE ↓ R² ↑ DA ↑ TA@0.2 ↑
GitPulse (Transformer+Text) 0.0712 0.1075 0.77 73.00% 81.75%
CondGRU+Text 0.0949 0.1243 0.69 68.56% 79.55%
GRU+Text 0.1084 0.1297 0.65 68.28% 79.12%
Transformer 0.1693 0.1667 0.46 62.22% 75.97%
CondGRU 0.1961 0.1872 0.44 61.49% 74.39%
LSTM 0.2142 0.1914 0.46 56.00% 75.00%
MLP 0.2280 0.2025 0.34 56.00% 73.00%
Linear 0.2261 0.1896 0.34 53.00% 74.00%

Text Contribution: Adding text features improves R² from 0.46 → 0.77 (+66.7%)

Model Overview

GitPulse is OpenVista's core multimodal time-series prediction model, capable of simultaneously forecasting 16 OpenDigger metrics.

GitPulse Prediction Interface

Architecture Highlights

Component Technology Purpose
Time-Series Encoder Transformer (2 layers, 4 heads) Captures temporal patterns across 16 metrics
Text Encoder DistilBERT (frozen) + Attention Pooling Extracts features from project descriptions
Fusion Layer Cross-Attention + Dynamic Gating (0.1-0.3) Text-guided temporal feature fusion
Auxiliary Tasks Contrastive Learning + Matching Improves text-timeseries alignment
Prediction Head MLP + Time Projection Outputs predictions for 32 months ahead
📈 Click to see text contribution effect
GitPulse Model Effect

Model Parameters

Parameter Value Description
d_model 128 Model hidden dimension
n_heads 4 Multi-head attention heads
n_layers 2 Transformer encoder layers
hist_len 128 months Historical input length
pred_len 32 months Prediction horizon
n_vars 16 Number of metrics
text_weight 0.1-0.3 Dynamic text contribution

Two-Stage Training

  1. Pretraining: Multi-task learning with MSE + Contrastive Loss (λ=0.1) + Matching Loss (λ=0.05)
  2. Fine-tuning: Full parameter fine-tuning with lower learning rate (1e-5)

Supported Metrics (16 total)

Category Metrics
Popularity OpenRank, Stars, Forks, Attention
Activity Activity, Participants, New Contributors
Contributors Contributors, Inactive Contributors, Bus Factor
Issues New Issues, Closed Issues, Issue Comments
Pull Requests Change Requests, PR Accepted, PR Reviews

Training Your Own Model

cd get-dataset

# Generate dataset (default: 10,000 repos)
python generate_training_dataset.py --count 10000

# Resume from interruption
python generate_training_dataset.py --resume

See get-dataset/README.md for detailed options.

Reproducing GitPulse Model

We provide a complete training repository GitPulse-Training/ for reproducing the GitPulse model from scratch.

Quick Start

cd GitPulse-Training

# Install dependencies
pip install -r requirements.txt

# Train the model (two-stage training)
cd training
python train_multimodal_v4_1.py --epochs 100 --batch_size 8

# Fine-tuning (for best performance)
cd ../Fine-tuning
python finetune_all_v4_1.py \
    --pretrained_checkpoint ../training/checkpoints/best_model_transformer_mm.pt \
    --strategy full \
    --epochs 50 \
    --batch_size 8 \
    --lr 1e-5

Directory Structure

GitPulse-Training/
├── model/                          # Model architecture definitions
│   └── multimodal_ts_v4_1.py      # Transformer+Text model
├── training/                       # Training scripts
│   ├── train_multimodal_v4_1.py   # Main training script
│   └── checkpoints/               # Saved model weights
├── Fine-tuning/                   # Fine-tuning experiments
│   └── results/                   # Fine-tuned models
├── predict/                       # Prediction scripts
│   └── predict_single_repo.py    # Single repository prediction
├── ablation-test/                 # Ablation studies
├── baseline-test/                 # Baseline comparisons
├── merge-test/                    # Fusion method comparisons
├── Pretrain-data/                 # Training dataset
│   └── github_multivar.json      # Multi-variable time-series data
├── evaluate_all_models.py         # Unified evaluation script
└── README.md                      # Detailed training guide

Key Features

  • Two-Stage Training: Pretraining with multi-task learning + full parameter fine-tuning
  • Complete Experiments: Ablation studies, baseline comparisons, fusion method tests
  • Unified Evaluation: Single script to evaluate all models with comprehensive metrics
  • Production Ready: Includes prediction scripts for real-world usage

For detailed training instructions, model architecture, and experiment results, see GitPulse-Training/README.md.


Key Features

Feature Description
🤖 MaxKB AI Q&A RAG-powered knowledge base Q&A for project documentation
🔮 GitPulse Prediction Time-series + text embeddings, forecasting up to 32 months
📊 CHAOSS Evaluation Community health assessment with 6-dimension radar visualization
🔍 Similar Repo Discovery Find related projects via GitHub API-based similarity matching
📈 Interactive Visualization Beautiful charts with 60+ months historical data comparison
⚡ Real-time Crawling Fetch any GitHub repository data on demand
🔮 Intelligent Prediction - 12-month forecasting with historical comparison
Prediction Model

AI-Powered Prediction Explanation:

AI Prediction Explanation
📊 Time-Series Visualization - Multi-dimensional metric analysis
Visualization Dashboard
🏥 CHAOSS Health Evaluation - 6-dimension radar chart analysis
CHAOSS Evaluation
🤖 AI Smart Summary - Project analysis with similar repo recommendations
AI Summary
🐛 Issue Analysis - Intelligent classification and trend analysis
Issue Analysis

Classification Statistics:

Issue Classification
📖 Built-in Documentation - Technical documentation and API reference
Technical Documentation

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📢 Community Initiative

Based on our research findings, we have published a Community Practice Initiative that calls for the open-source ecosystem to prioritize text information quality (documentation, Issue descriptions, etc.) as a core component of project governance.

Key Message: Well-written documentation and structured Issue templates are not optional—they are essential for project sustainability and, in the AI era, critical for lowering contribution barriers. When combined with AI technologies (RAG-based Q&A, intelligent code assistants), high-quality text information can dramatically reduce the onboarding cost for new contributors.

📖 Read the full initiative: doc/倡议书/倡议书.md (Chinese)

The initiative includes:

  • Empirical findings from 600+ GitHub projects
  • Practical recommendations for maintainers, contributors, organizations, and platform developers
  • Emphasis on AI-assisted collaboration and knowledge management

🙏 Acknowledgments

  • MaxKB — RAG Knowledge Base System
  • OpenDigger — Time-series metrics data
  • CHAOSS — Community health metrics framework
  • GitHub API — Repository data source

⭐ Star this repo if you find it useful! ⭐


Made with ❤️ by the OpenVista Team

Empowering open-source with predictive intelligence

Introduction

用户可借助该平台分析和预测 GitHub 开源项目健康状况,其集成 MaxKB 智能问答系统与 GitPulse 多模态预测模型,通过多模态预测、CHAOSS 健康评分及智能问答,将原始数据转化为可操作情报,助力数据驱动决策。【此简介由AI生成】

Customize your domain