Metadata-Version: 2.4
Name: agentbrain-import
Version: 0.1.0a1
Summary: Universal Memory-Import Tool — ingest user-memory from major LLM platforms into an AgentBrain workspace.
Author-email: Memory-Import Coder <coder@agentbrain.ch>
License: Proprietary — AgentBrain.ch
Project-URL: Homepage, https://agentbrain.ch
Project-URL: Source, https://github.com/AgentBrainHQ/memory-import-coder
Keywords: agentbrain,memory,llm,import,claude,openai,gemini
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: httpx<1.0,>=0.27
Requires-Dist: pydantic<3.0,>=2.7
Requires-Dist: typer<1.0,>=0.12
Requires-Dist: rich>=13.7
Provides-Extra: llm
Requires-Dist: anthropic>=0.34; extra == "llm"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"

# Universal Memory-Import Tool for AgentBrain

> **"Bring your memory in 60 seconds. From anywhere."**

Migrate existing memory from ChatGPT, Claude.ai, Gemini, Perplexity, or any LLM platform INTO AgentBrain. No lock-in. Your data, portable.

---

## Why this tool exists

### Cold-Start Problem (today, without this)
Customer signs up → workspace_id created → **0 memories**. Cascading impact:
- `substrate_quality_score`: 0 (gate-blocks L3/L4 features per Drift-#21 substrate-gate)
- `recall_pipeline`: empty results
- `bridge_summary` cron: `processed=0` every cycle
- `dream_cycle` first night: no patterns, no predictions
- `llm_insight_generator`: abstain (post Lane-I substrate-gate 2026-06-02)
- `calibration_history`: n=0, no signal
- `identity_backbone` bootstrap-v2: generic-seed only
- **Time-to-aha-moment**: weeks-to-months for organic substrate accumulation
- **Result**: free-tier signup abandons before reaching value

### With this tool (Day-1)
| Metric | Cold-Start | With Import |
|--------|-----------|-------------|
| memories on Day-1 | 0 | 100-10,000+ |
| substrate_quality_score | 0.0 | >0.3 |
| First-recall-demo | empty | actual user-content |
| Time-to-aha | weeks | **60 seconds** |
| bridge_summary | processed=0 | meaningful summaries |
| dream_cycle predictions | none | real patterns |
| identity_backbone seed | generic | inferred from corpus |
| conversion-rate | baseline | expected 2-3× boost |

Plus: **defensive moat**. "Your memory is portable, no lock-in with Anthropic/OpenAI." Hero-Claim Launch material.

---

## Supported Platforms (V1)

| Platform | Source | Format | Memory-Source | Status |
|----------|--------|--------|---------------|--------|
| **Anthropic Claude.ai** | Projects → "Export" | JSON | Project memory + saved instructions | Adapter required |
| **Anthropic Memory Stores API** | Direct API call (customer's API-key) | JSON | API-managed memory-stores | Adapter required |
| **OpenAI ChatGPT** | chatgpt.com/settings → data export | ZIP (conversations.json + memory.json) | Custom Instructions + saved memory | Adapter required |
| **Google Gemini** | takeout.google.com | JSON | Saved Info + Gems context | Adapter required |
| **Perplexity** | Thread export OR Spaces export | JSON | Thread-history + Space context | Adapter required |
| **Generic JSON** | Any structured memory-list | Schema-detected | Catch-all for niche platforms | Adapter required |

V2 candidates (post-Launch): Notion AI, Mem.ai, Obsidian-with-AI-plugin, Cursor, Windsurf.

---

## Architecture (high-level)

```
┌──────────────────┐
│  Customer upload │ (file: .zip / .json)
│  via CLI or UI   │
└────────┬─────────┘
         │
         v
┌──────────────────┐
│ Format-Detector  │ → sniff signature, select adapter
└────────┬─────────┘
         │
         v
┌──────────────────┐
│ Platform Adapter │ → parse → list[RawMemoryUnit]
│ (per platform)   │
└────────┬─────────┘
         │
         v
┌──────────────────┐
│ Quality-Filter   │ → LLM-classifier OR rule-based: memory-worthy ?
│ (optional)       │
└────────┬─────────┘
         │
         v
┌──────────────────┐
│ Normalizer       │ → list[CanonicalMemory] (Pydantic v2)
└────────┬─────────┘
         │
         v
┌──────────────────┐
│ Bulk-Importer    │ → batched POST /memory/store with provenance.imported_from=<platform>
└────────┬─────────┘
         │
         v
┌──────────────────┐
│ Migration-Report │ → log file + customer-facing summary (X imported, Y skipped)
└──────────────────┘
```

---

## Surfaces

### 1. CLI Tool

```bash
# Auto-detect format
agentbrain-import --workspace <ws-id> --api-key <key> --file path/to/export.zip

# Force adapter
agentbrain-import --workspace <ws-id> --api-key <key> --file path/to/export.json --adapter anthropic-claude

# With quality-filter
agentbrain-import --workspace <ws-id> --api-key <key> --file path/to/export.zip --quality-filter haiku

# Dry-run (preview only, no writes)
agentbrain-import --workspace <ws-id> --api-key <key> --file path/to/export.zip --dry-run

# From Anthropic Memory Stores API (live pull, no file)
agentbrain-import --workspace <ws-id> --api-key <key> --anthropic-api-key <ant-key>
```

### 2. Backend Endpoint (optional v2)

```
POST https://api.agentbrain.ch/memory/import
Content-Type: multipart/form-data
X-API-Key: <agentbrain-key>

file: <upload>
adapter: anthropic-claude (optional, default: auto-detect)
quality_filter: haiku (optional, default: off)
dry_run: false
```

Returns: streaming import-progress + final report.

### 3. Customer-Facing Web-UI (Sprint-B Track-2 handles, not here)

Post-signup landing page CTA: "Import your existing memory" → upload-form → trigger backend endpoint.

---

## Eigen-Use (before customer-launch)

**Idee**: vor customer-launch importiere mir Max + Thesh + Aura's eigeni Anthropic Claude.ai history INTO their canary workspaces. Result:
- Demos showe rich substrate (nöd 18-test-residue)
- Self-model has real expertise-domains
- recall_pipeline returns meaningful neighbors
- dream_cycle produces interesting patterns

**Constraint**: Privacy — only Max/Thesh/Aura workspaces, only Thesh-owned data, audit-trail per import.

---

## Status

- SPEC: **Ready** (see [SPEC.md](SPEC.md))
- PLAN: **Ready** (see [PLAN.md](PLAN.md))
- Implementation: **Pending coder-agent dispatch**
- Target: ready by Sprint-A end (2026-06-12) OR earlier per re-priority discussion

---

## Owner

Master Max (CTO). Implementation: TBD coder-agent. Coordination via [inbox-from-master.md](inbox-from-master.md) / [outbox-to-master.md](outbox-to-master.md).
