An open API service indexing awesome lists of open source software.

https://github.com/opf/openproject-haystack


https://github.com/opf/openproject-haystack

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# OpenProject Haystack
## AI-Powered Project Management

[![OpenProject](https://img.shields.io/badge/OpenProject-Compatible-blue.svg)](https://www.openproject.org/)
[![AI](https://img.shields.io/badge/AI-Powered-green.svg)](https://github.com/deepset-ai/haystack)
[![Docker](https://img.shields.io/badge/Docker-Ready-blue.svg)](https://www.docker.com/)
[![GDPR](https://img.shields.io/badge/GDPR-Compliant-green.svg)](https://gdpr.eu/)

---

## Table of Contents

- [๐ŸŽฏ Executive Summary](#-executive-summary)
- [๐Ÿ”’ Responsible AI Principles](#-responsible-ai-principles)
- [๐Ÿ—๏ธ System Architecture](#๏ธ-system-architecture)
- [โšก Quick Start](#-quick-start)
- [๐Ÿ”ง Technical Documentation](#-technical-documentation)
- [๐Ÿ“š Detailed Documentation](#-detailed-documentation)

---

## ๐ŸŽฏ Executive Summary

OpenProject Haystack is an AI-powered project management enhancement system that delivers automated compliance, proactive risk management, and data-driven decision support. The system transforms traditional project management workflows into intelligent, automated processes that ensure PMFlex compliance while significantly reducing manual overhead.

### Key Business Benefits

| Capability | Traditional Approach | Our AI Solution | Business Impact |
|------------|---------------------|-----------------|-----------------|
| **Status Reports** | 4-8 hours manual work | 2 minutes automated | **80% time savings** |
| **Issue Detection** | Reactive (after problems occur) | Predictive (2-4 weeks early) | **40% reduction in overruns** |
| **Compliance** | Manual review and correction | Automatic PMFlex adherence | **95% reduction in audit issues** |
| **Quality** | Inconsistent, human error prone | AI-powered, standardized | **90% reduction in review time** |

### Strategic Value Propositions

- **๐ŸŽฏ 100% PMFlex Compliance**: Automatic adherence to German federal project management standards
- **๐Ÿ“ˆ Proactive Risk Management**: Early detection of project health issues before they become critical
- **๐Ÿ’ผ Data-Driven Decision Support**: Real-time project health analytics and predictive insights
- **โšก Operational Efficiency**: 80% time savings through automated report generation and workflows

**๐Ÿ“ˆ [View Complete Executive Summary](./EXECUTIVE_SUMMARY.md)** - Full business case, ROI analysis, and strategic benefits

---

## ๐Ÿ”’ Responsible AI Principles

OpenProject Haystack follows strict ethical AI guidelines to ensure responsible deployment in government environments:

### Core Principles

**๐Ÿ  Self-Hosting & Data Sovereignty**
- All AI models run locally on your infrastructure
- Complete control over data processing and storage
- No external data transmission or cloud dependencies
- Minimizes security risks and ensures compliance

**๐Ÿ‘ค Human Decision Authority**
- AI serves as decision support, never autonomous decision-making
- Transparent recommendations with clear explanations
- Human oversight required for all critical decisions
- Clear accountability chains maintained

**๐Ÿ” Privacy & GDPR Compliance**
- Strict data isolation between projects and tenants
- Minimal data collection principles
- Automated data deletion routines
- Complete audit trails and documentation

**๐ŸŒฑ Sustainability & Ethics**
- Energy-efficient model selection
- Ethical training data sourcing
- Regular bias testing and mitigation
- Cultural fairness and inclusivity

**๐Ÿ”’ [Read Full AI Governance Guidelines](./LEITFADEN_VERANTWORTUNGSVOLLE_KI_OPENPROJECT.md)** - Comprehensive AI governance and compliance framework

---

## ๐Ÿ—๏ธ System Architecture

### Complete System Overview

```mermaid
graph TB
%% External Systems
OP[๐Ÿข OpenProject Instance
Project Data Source]
USER[๐Ÿ‘ค Project Manager
End User]

%% PMFlex Knowledge Base
PM[๐Ÿ“š PMFlex.one
German Federal Standards
โ€ข Handbooks
โ€ข Templates
โ€ข Guidelines]

%% Haystack System Core
subgraph "๐Ÿค– OpenProject Haystack System"
API[๐Ÿ”Œ API Layer
FastAPI Application
โ€ข OpenAI Compatible
โ€ข Project Endpoints]

subgraph "๐Ÿง  AI Intelligence Core"
RAG[๐Ÿ” RAG Pipeline
Document Retrieval
โ€ข Vector Store
โ€ข Context Enhancement]
LLM[โšก Ollama LLM
German Language
โ€ข Report Generation
โ€ข Hint Creation]
end

subgraph "๐Ÿ“Š Analysis Engine"
ANALYZER[๐Ÿ”ฌ Project Analyzer
โ€ข 10 Health Checks
โ€ข Risk Assessment
โ€ข Performance Metrics]
end
end

%% Data Flow
USER --> API
API --> OP
OP --> ANALYZER
ANALYZER --> RAG
PM --> RAG
RAG --> LLM
LLM --> API
API --> USER

%% Styling
classDef external fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef knowledge fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef core fill:#e8f5e8,stroke:#388e3c,stroke-width:2px
classDef ai fill:#fff3e0,stroke:#f57c00,stroke-width:2px
classDef analysis fill:#fce4ec,stroke:#c2185b,stroke-width:2px

class OP,USER external
class PM knowledge
class API core
class RAG,LLM ai
class ANALYZER analysis
```

### Key Components

| Component | Primary Function | Business Value |
|-----------|------------------|----------------|
| **PMFlex.one** | German federal compliance standards | Ensures 100% regulatory adherence |
| **API Layer** | Interface for all system interactions | Seamless integration with existing tools |
| **RAG System** | Context-aware document retrieval | Intelligent, compliance-driven responses |
| **Ollama LLM** | German language AI generation | Professional, accurate content creation |
| **Analysis Engine** | Real-time project health monitoring | Proactive risk identification and management |

### Smart Report Generation Workflow

```mermaid
flowchart LR
A[Project Manager Request] --> B[๐Ÿ”„ Automated Data Collection]
B --> C[๐Ÿ“Š AI Analysis & Insights]
C --> D[๐Ÿ“‹ PMFlex Standards Integration]
D --> E[๐Ÿ“„ Professional German Report]

B1[โฑ๏ธ 15 minutes] --> B
C1[๐ŸŽฏ 100% Accuracy] --> C
D1[โœ… Full Compliance] --> D
E1[๐Ÿ“ˆ Executive Ready] --> E

style A fill:#e3f2fd
style E fill:#c8e6c9
style B fill:#fff3e0
style C fill:#f3e5f5
style D fill:#e8f5e8
```

**๐Ÿ”„ [See Detailed Workflow Documentation](./WORKFLOW_DIAGRAMS_AND_SUMMARIES.md)** - Complete technical workflows and system diagrams

---

## โšก Quick Start

### Development with Docker Compose

```bash
# Clone the repository
git clone https://github.com/opf/openproject-haystack.git
cd openproject-haystack

# Start the services (models will be automatically installed)
docker compose up --build

# The API will be available at:
# - Health check: http://localhost:8000/health
# - API docs: http://localhost:8000/docs
# - OpenAI compatible: http://localhost:8000/v1/chat/completions
```

### Core Capabilities

**๐Ÿ“Š Project Status Reports**
```bash
curl -X POST "http://localhost:8000/generate-project-status-report" \
-H "Content-Type: application/json" \
-d '{
"project": {"id": 1, "type": "agile"},
"openproject": {
"base_url": "https://your-openproject.com",
"user_token": "your-api-key"
}
}'
```

**๐Ÿ’ก Project Management Hints**
```bash
curl -X POST "http://localhost:8000/project-management-hints" \
-H "Content-Type: application/json" \
-d '{
"project": {"id": 1, "type": "agile"},
"openproject": {
"base_url": "https://your-openproject.com",
"user_token": "your-api-key"
}
}'
```

**๐Ÿค– OpenAI-Compatible Chat**
```bash
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral:latest",
"messages": [
{"role": "user", "content": "Help me with project management"}
]
}'
```

---

## ๐Ÿ”ง Technical Documentation

### Stack & Architecture

- **Python 3.11** - Modern Python with type hints
- **FastAPI** - High-performance API framework
- **Haystack AI** - Advanced NLP pipeline management
- **Ollama** - Local LLM inference with German language support
- **Docker & Docker Compose** - Reproducible deployment environments
- **RAG System** - Context-aware document retrieval and enhancement

### Project Structure

```
openproject-haystack/
โ”œโ”€โ”€ README.md # This comprehensive documentation
โ”œโ”€โ”€ EXECUTIVE_SUMMARY.md # Business case and strategic benefits
โ”œโ”€โ”€ LEITFADEN_VERANTWORTUNGSVOLLE_KI_OPENPROJECT.md # AI governance
โ”œโ”€โ”€ WORKFLOW_DIAGRAMS_AND_SUMMARIES.md # Technical workflows
โ”œโ”€โ”€ requirements.txt # Python dependencies
โ”œโ”€โ”€ Dockerfile # Container configuration
โ”œโ”€โ”€ docker-compose.yml # Multi-service orchestration
โ”œโ”€โ”€ config/
โ”‚ โ””โ”€โ”€ settings.py # Environment configuration
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ main.py # FastAPI application entry point
โ”‚ โ”œโ”€โ”€ api/
โ”‚ โ”‚ โ””โ”€โ”€ routes.py # API endpoints (OpenAI + custom)
โ”‚ โ”œโ”€โ”€ pipelines/
โ”‚ โ”‚ โ”œโ”€โ”€ generation.py # LLM generation pipelines
โ”‚ โ”‚ โ””โ”€โ”€ rag_pipeline.py # RAG system implementation
โ”‚ โ”œโ”€โ”€ services/
โ”‚ โ”‚ โ”œโ”€โ”€ openproject_client.py # OpenProject API integration
โ”‚ โ”‚ โ”œโ”€โ”€ document_processor.py # Document processing
โ”‚ โ”‚ โ””โ”€โ”€ vector_store.py # Vector database management
โ”‚ โ”œโ”€โ”€ models/
โ”‚ โ”‚ โ””โ”€โ”€ schemas.py # Pydantic models and schemas
โ”‚ โ””โ”€โ”€ templates/
โ”‚ โ””โ”€โ”€ report_templates.py # Report generation templates
โ”œโ”€โ”€ documents/
โ”‚ โ””โ”€โ”€ pmflex/ # PMFlex compliance documents
โ””โ”€โ”€ tests/ # Test suite
```

### API Endpoints

#### Project Management Endpoints
- `POST /generate-project-status-report` - Generate comprehensive project status reports
- `POST /project-management-hints` - Get AI-powered project management recommendations
- `GET /health` - System health check

#### OpenAI-Compatible Endpoints
- `POST /v1/chat/completions` - Chat completion (OpenAI-compatible)
- `GET /v1/models` - List available models
- `GET /v1/models/{model_id}` - Get specific model information

#### RAG System Management
- `POST /rag/initialize` - Initialize RAG system with PMFlex documents
- `GET /rag/status` - Get RAG system status and statistics
- `POST /rag/refresh` - Refresh document index
- `POST /rag/search` - Search PMFlex documents

### Configuration

Environment variables for customization:

```bash
# Core Configuration
OLLAMA_URL=http://ollama:11434
OLLAMA_MODEL=mistral:latest
API_HOST=0.0.0.0
API_PORT=8000

# Model Management
MODELS_TO_PULL=mistral:latest,llama2:7b
REQUIRED_MODELS=mistral:latest

# Generation Parameters
GENERATION_NUM_PREDICT=1000
GENERATION_TEMPERATURE=0.7

# Logging
LOG_LEVEL=INFO
LOG_FORMAT=%(asctime)s - %(name)s - %(levelname)s - %(message)s

# RAG System
RAG_CHUNK_SIZE=500
RAG_CHUNK_OVERLAP=50
RAG_MAX_CHUNKS=5
```

### Testing

```bash
# Test OpenAI API compatibility
python test_openai_api.py

# Test project status report generation
python test_project_status_report.py

# Test project management hints
python test_project_hints.py

# Test RAG system
python test_haystack_api.py
```

### Integration Examples

#### With OpenAI Python Client
```python
from openai import OpenAI

client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="dummy-key"
)

response = client.chat.completions.create(
model="mistral:latest",
messages=[
{"role": "system", "content": "You are a project management assistant."},
{"role": "user", "content": "How can I improve my project timeline?"}
]
)
```

#### With LangChain
```python
from langchain.chat_models import ChatOpenAI

llm = ChatOpenAI(
openai_api_base="http://localhost:8000/v1",
openai_api_key="dummy-key",
model_name="mistral:latest"
)
```

### Features

- โœ… **AI-Powered Project Analysis**: 10 automated health checks and risk assessments
- โœ… **PMFlex Compliance**: Automatic adherence to German federal standards
- โœ… **German Language Support**: Native German report generation and hints
- โœ… **OpenAI API Compatibility**: Drop-in replacement for OpenAI services
- โœ… **Self-Hosted Security**: Complete data sovereignty and privacy
- โœ… **RAG-Enhanced Context**: Intelligent document retrieval and context enhancement
- โœ… **Real-Time Integration**: Live OpenProject data analysis
- โœ… **Professional Reporting**: Executive-ready status reports and insights
- โœ… **Predictive Analytics**: Early warning system for project issues
- โœ… **Automated Workflows**: Streamlined project management processes

---

## ๐Ÿ“š Detailed Documentation

### ๐Ÿ“‹ Core Documentation
- **[Executive Summary](./EXECUTIVE_SUMMARY.md)** - Complete business case, ROI analysis, strategic benefits, and implementation roadmap
- **[Responsible AI Guidelines](./LEITFADEN_VERANTWORTUNGSVOLLE_KI_OPENPROJECT.md)** - Comprehensive AI governance, ethical principles, and compliance framework
- **[Workflow Diagrams & Summaries](./WORKFLOW_DIAGRAMS_AND_SUMMARIES.md)** - Technical workflows, system architecture, and detailed process documentation

### ๐Ÿ”ง Technical Documentation
- **[RAG System Documentation](./RAG_SYSTEM_README.md)** - RAG implementation details, document processing, and vector store management
- **[Deployment Guide](./DEPLOYMENT_GUIDE.md)** - Production deployment instructions, scaling, and infrastructure requirements
- **[Project Hints API](./PROJECT_HINTS_API.md)** - API documentation for project management hints and recommendations

### ๐Ÿ“Š Feature Documentation
- **[BlockNote AI Integration](./BLOCKNOTE_AI_INTEGRATION.md)** - BlockNote editor integration and streaming capabilities
- **[Hint Generation Enhancements](./HINT_GENERATION_ENHANCEMENTS.md)** - Advanced hint generation and optimization
- **[Memory Requirements](./MEMORY_REQUIREMENTS.md)** - System requirements and performance optimization

### ๐Ÿงช Testing & Development
- **[Local Ollama Testing](./LOCAL_OLLAMA_TESTING.md)** - Local development and testing procedures
- **[Mixtral Migration](./MIXTRAL_MIGRATION.md)** - Model migration and optimization guide
- **[Embedding Persistence](./EMBEDDING_PERSISTENCE_README.md)** - Document embedding and persistence strategies

---

## ๐Ÿš€ Getting Started by Role

### ๐Ÿ‘” For Executives
1. Read the [Executive Summary](./EXECUTIVE_SUMMARY.md) for business benefits and ROI
2. Review the [Responsible AI Guidelines](./LEITFADEN_VERANTWORTUNGSVOLLE_KI_OPENPROJECT.md) for governance
3. Understand the strategic value proposition and competitive advantages

### ๐Ÿ”’ For Compliance Teams
1. Study the [Responsible AI Guidelines](./LEITFADEN_VERANTWORTUNGSVOLLE_KI_OPENPROJECT.md) for GDPR compliance
2. Review data sovereignty and self-hosting principles
3. Understand audit trails and documentation requirements

### ๐Ÿ‘จโ€๐Ÿ’ป For Developers
1. Follow the [Quick Start](#-quick-start) guide for immediate setup
2. Explore the [Technical Documentation](#-technical-documentation) for implementation details
3. Review the [API Endpoints](#api-endpoints) for integration options

### ๐Ÿ“Š For Project Managers
1. Understand the core capabilities and business benefits
2. Test the project status report and hints generation features
3. Review the [Project Hints API](./PROJECT_HINTS_API.md) for practical usage

---

## ๐Ÿ“ž Support & Community

- **GitHub Issues**: Report bugs and request features
- **Documentation**: Comprehensive guides and API documentation
- **Community**: Join discussions and share experiences
- **Enterprise Support**: Contact for enterprise deployment assistance

---

## ๐Ÿ“œ License

This project is licensed under the GNU General Public License v3.0. See the [LICENSE](./LICENSE) file for details.

---

*OpenProject Haystack - Transforming project management through responsible AI innovation*