Metadata-Version: 2.4
Name: jarvis-research-os
Version: 1.0.0
Summary: JARVIS Research OS - AI-Powered Systematic Literature Review Assistant
Author-email: JARVIS Team <jarvis@kaneko-ai.dev>
License: MIT
Project-URL: Homepage, https://github.com/kaneko-ai/jarvis-ml-pipeline
Project-URL: Documentation, https://github.com/kaneko-ai/jarvis-ml-pipeline/docs
Project-URL: Repository, https://github.com/kaneko-ai/jarvis-ml-pipeline
Project-URL: Issues, https://github.com/kaneko-ai/jarvis-ml-pipeline/issues
Keywords: systematic-review,literature-review,evidence-grading,citation-analysis,PRISMA,active-learning,research-assistant,AI
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Healthcare Industry
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: defusedxml>=0.7.1
Provides-Extra: ml
Requires-Dist: lightgbm>=4.0.0; extra == "ml"
Requires-Dist: numpy>=1.24.0; extra == "ml"
Requires-Dist: scikit-learn>=1.3.0; extra == "ml"
Provides-Extra: pdf
Requires-Dist: pymupdf>=1.22.0; extra == "pdf"
Requires-Dist: pypdf2>=3.0; extra == "pdf"
Requires-Dist: python-docx>=0.8.11; extra == "pdf"
Requires-Dist: python-pptx>=0.6.21; extra == "pdf"
Requires-Dist: reportlab>=4.0; extra == "pdf"
Provides-Extra: llm
Requires-Dist: google-generativeai>=0.3.0; extra == "llm"
Requires-Dist: llama-cpp-python>=0.2.0; extra == "llm"
Provides-Extra: embedding
Requires-Dist: sentence-transformers>=2.2.0; extra == "embedding"
Requires-Dist: rank_bm25>=0.2.2; extra == "embedding"
Provides-Extra: web
Requires-Dist: fastapi>=0.100.0; extra == "web"
Requires-Dist: uvicorn>=0.22.0; extra == "web"
Requires-Dist: python-multipart>=0.0.6; extra == "web"
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == "browser"
Provides-Extra: mcp
Requires-Dist: httpx>=0.25; extra == "mcp"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: safety>=2.3.0; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Provides-Extra: all
Requires-Dist: jarvis-research-os[browser,embedding,llm,mcp,ml,pdf,web]; extra == "all"

# JARVIS Research OS

[![CI](https://github.com/kaneko-ai/jarvis-ml-pipeline/actions/workflows/eval.yml/badge.svg)](https://github.com/kaneko-ai/jarvis-ml-pipeline/actions)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**AI-Powered Research Operating System for Systematic Literature Reviews**

JARVIS Research OS is a local-first, AI-powered research assistant that helps researchers conduct systematic literature reviews with evidence grading, citation analysis, and contradiction detection.

## Release Status

- Current release target: `v1.0.0`

## ✨ Features

### Phase 1: Local-First Foundation
- **Hybrid Search**: Sentence Transformers + BM25 with RRF fusion
- **Offline Mode**: Network detection and graceful degradation
- **Free APIs**: arXiv, Crossref, Unpaywall integration

### Phase 2: Differentiation Features
- **Evidence Grading**: CEBM evidence level classification (1a-5)
- **Citation Analysis**: Support/Contrast/Mention stance classification
- **Contradiction Detection**: Negation, antonym, and quantitative contradiction detection
- **PRISMA Diagrams**: PRISMA 2020 flow diagram generation (Mermaid/SVG)
- **Paper Scoring**: Comprehensive quality scoring with multiple signals
- **Active Learning**: Efficient screening with uncertainty sampling

### Phase 3: Ecosystem
- **MCP Hub**: External search servers (PubMed/Semantic Scholar/OpenAlex)
- **Browser Agent**: Safe browser automation with security policy
- **Skills System**: Task-specific workflows via `SKILL.md`
- **Multi-Agent Orchestrator**: Parallel agents + approval flow
- **Plugin System**: Extensible architecture
- **Zotero Integration**: Reference management
- **Export Formats**: RIS, BibTeX, Markdown

## 🚀 Quick Start

### Installation

```bash
# Clone repository
git clone https://github.com/kaneko-ai/jarvis-ml-pipeline.git
cd jarvis-ml-pipeline

# Install with uv (recommended)
uv sync

# Or with pip
pip install -e .
```

### Basic Usage

```python
from jarvis_core.evidence import grade_evidence
from jarvis_core.citation import extract_citation_contexts, classify_citation_stance
from jarvis_core.contradiction import Claim, ContradictionDetector

# Grade evidence level
grade = grade_evidence(
    title="A randomized controlled trial...",
    abstract="Methods: We conducted a double-blind RCT..."
)
print(f"Evidence Level: {grade.level.value} ({grade.level.description})")

# Analyze citations
contexts = extract_citation_contexts(text, paper_id="paper_A")
for ctx in contexts:
    stance = classify_citation_stance(ctx.get_full_context())
    print(f"Citation to {ctx.cited_paper_id}: {stance.stance.value}")

# Detect contradictions
detector = ContradictionDetector()
claim_a = Claim(claim_id="1", text="Drug X increases survival", paper_id="A")
claim_b = Claim(claim_id="2", text="Drug X decreases survival", paper_id="B")
result = detector.detect(claim_a, claim_b)
print(f"Contradiction: {result.is_contradictory}")
```

### CLI Usage

```bash
# Search papers
jarvis search "machine learning cancer diagnosis"

# Run full pipeline
jarvis run --config pipeline.yaml

# Generate PRISMA diagram
jarvis prisma --output prisma_flow.svg
```

### MCP Hub Example

```bash
# Register MCP servers and list tools
jarvis mcp list --config configs/mcp_config.json

# Invoke MCP tool
jarvis mcp invoke search_pubmed --params '{"query": "cancer immunotherapy"}'
```

### Browser Agent Example

```python
from jarvis_core.browser.subagent import BrowserSubagent
from jarvis_core.browser.schema import SecurityPolicy

policy = SecurityPolicy(url_allow_list=["pubmed.ncbi.nlm.nih.gov"])
agent = BrowserSubagent(security_policy=policy, headless=True)
```

### Skills System Example

```bash
# List skills and show details
jarvis skills list
jarvis skills show MCP
```

## 📦 Core Modules

| Module | Description |
|--------|-------------|
| `embeddings/` | Sentence Transformers, BM25, Hybrid search |
| `network/` | Network detection, offline mode |
| `sources/` | arXiv, Crossref, Unpaywall clients |
| `evidence/` | CEBM evidence grading |
| `citation/` | Citation context and stance analysis |
| `contradiction/` | Claim normalization and contradiction detection |
| `prisma/` | PRISMA 2020 flow diagram generation |
| `paper_scoring/` | Paper quality scoring |
| `active_learning/` | Active learning for efficient screening |

## 🧪 Testing

```bash
# Run all tests
uv run pytest

# Run specific module tests
uv run pytest tests/test_evidence_grading.py -v

# Run with coverage
uv run pytest --cov=jarvis_core
```

## 📖 Documentation

- [API Reference](docs/api/README.md)
- [User Guide](docs/user_guide.md)
- [Contributing](CONTRIBUTING.md)

## 🔧 Configuration

Create `config.yaml`:

```yaml
search:
  default_sources:
    - pubmed
    - arxiv
  max_results: 100

embeddings:
  model: all-MiniLM-L6-v2
  device: auto

evidence:
  use_llm: false
  ensemble_strategy: weighted_average

offline:
  enabled: true
  sync_on_connect: true
```

## 📄 License

MIT License - see [LICENSE](LICENSE) for details.

## 🙏 Acknowledgments

- [Sentence Transformers](https://www.sbert.net/)
- [PubMed](https://pubmed.ncbi.nlm.nih.gov/)
- [arXiv](https://arxiv.org/)
- [PRISMA Statement](http://www.prisma-statement.org/)
