Metadata-Version: 2.4
Name: context-onboard
Version: 0.1.0
Summary: Ingest, process, and package business context for AI assistants
Home-page: https://github.com/contextbase/context-onboard
Author: ContextBase
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Provides-Extra: slack
Requires-Dist: slack_sdk>=3.0.0; extra == "slack"
Provides-Extra: google
Requires-Dist: google-auth>=2.0.0; extra == "google"
Requires-Dist: google-api-python-client>=2.0.0; extra == "google"
Provides-Extra: airtable
Requires-Dist: requests>=2.25.0; extra == "airtable"
Provides-Extra: yaml
Requires-Dist: pyyaml>=5.1; extra == "yaml"
Provides-Extra: all
Requires-Dist: slack_sdk>=3.0.0; extra == "all"
Requires-Dist: google-auth>=2.0.0; extra == "all"
Requires-Dist: google-api-python-client>=2.0.0; extra == "all"
Requires-Dist: pyyaml>=5.1; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# ContextBase Onboarding Service

Ingest, process, and package organizational context for AI assistants.

**context-onboard** extracts knowledge from your team's existing tools and surfaces it as structured knowledge graphs, ready-to-use system prompts for Claude/GPT/Gemini, and beautiful HTML reports.

## Features

- **🔌 Multi-source ingestion** — Slack, Email (IMAP), Google Drive, Airtable
- **🧠 Knowledge graph** — Deduplicates entities, merges relationships, computes statistics
- **📝 AI prompts** — Generates system prompts for Claude, GPT-4, and Gemini
- **🎁 Deliverable packaging** — Creates ZIP archives with graph JSON, prompts, and HTML reports
- **🔧 MCP-style config** — Tool-use configuration for Model Context Protocol

## Quick Start

```bash
# Install
pip install context-onboard

# With all extras
pip install "context-onboard[all]"
```

## Usage

### 1. Ingest — Pull data from your sources

Create a config file (`config.yaml`):

```yaml
output_dir: ./data
ingestors:
  slack:
    token: xoxb-your-bot-token
    enabled: true
  email:
    host: imap.gmail.com
    username: user@gmail.com
    password: "app-password"
    max_messages: 200
    enabled: true
  drive:
    token:
      token: ya29...
      refresh_token: 1//...
    max_files: 100
    enabled: true
  airtable:
    api_key: patXXXX...
    base_ids:
      - appXXXX1
    enabled: true
```

Then run:

```bash
context-onboard ingest --config config.yaml
```

### 2. Build — Generate knowledge graph and prompts from existing data

```bash
context-onboard build --data ./data --company "Acme Corp" --output ./output
```

### 3. Package — Create a deliverable ZIP

```bash
context-onboard package --data ./output --output ./deliverable --company "Acme Corp"
```

## Architecture

```
context_onboard/
├── __init__.py              # Package init, version 0.1.0
├── models.py                # Core data models (Entity, Relationship, ContextPackage)
├── cli.py                   # CLI entry point (argparse)
├── ingestors/
│   ├── base.py              # BaseIngestor ABC
│   ├── slack.py             # SlackIngestor (slack_sdk)
│   ├── email.py             # EmailIngestor (imaplib — stdlib)
│   ├── drive.py             # GoogleDriveIngestor (google-api-python-client)
│   └── airtable.py          # AirtableIngestor (requests)
├── processors/
│   ├── knowledge_graph.py   # Deduplication, merging, graph stats
│   └── prompt_library.py    # Claude, GPT, Gemini prompt generation + MCP config
└── output/
    └── package.py           # ZIP packaging + HTML report generation
```

## Data Models

| Model | Description |
|---|---|
| `EntityType` | Enum: PERSON, TEAM, PROJECT, DOCUMENT, TOOL, PROCESS, GLOSSARY_TERM |
| `Entity` | A node in the context graph (id, name, type, description, metadata) |
| `Relationship` | A typed, weighted edge between two entities (0-1 strength) |
| `ContextPackage` | A complete snapshot from one ingest source or the merged graph |

## Optional Dependencies

| Feature | Install command |
|---|---|
| Slack | `pip install "context-onboard[slack]"` |
| Google Drive | `pip install "context-onboard[google]"` |
| Airtable | `pip install "context-onboard[airtable]"` (requests included by default) |
| YAML config | `pip install "context-onboard[yaml]"` |
| All | `pip install "context-onboard[all]"` |

Email ingestor uses **stdlib only** (imaplib, email) — no extra deps needed.

## Development

```bash
git clone https://github.com/contextbase/context-onboard.git
cd context-onboard
pip install -e ".[dev]"
pytest
```

## License

MIT
