# @x12i/memorix-memory

> Memorix Memory: source-to-raw collector for context and knowledge pulls (Phase 6 / G6).

Latest version **3.2.1** (published 2026-08-05) · exellix-license license · 0 weekly downloads

## Install

```sh
npm install @x12i/memorix-memory
pnpm add @x12i/memorix-memory
yarn add @x12i/memorix-memory
bun add @x12i/memorix-memory
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.2.1 |
| Published | 2026-08-05 |
| First published | 2026-07-23 |
| Weekly downloads | 0 |
| License | exellix-license |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 9 |
| Unpacked size | 330.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | x12i |

## Links

- npm: https://www.npmjs.com/package/@x12i/memorix-memory
- Repository: https://github.com/x12i/memorix-mono-repo
- Homepage: https://github.com/x12i/memorix-mono-repo#readme
- Issues: https://github.com/x12i/memorix-mono-repo/issues
- npm.io page: https://npm.io/package/@x12i/memorix-memory

## Dependencies (9)

- [mongodb](https://npm.io/package/mongodb.md) ^6.21.0
- [@x12i/memorix-data](https://npm.io/package/@x12i/memorix-data.md) ^3.0.2
- [@x12i/memorix-format](https://npm.io/package/@x12i/memorix-format.md) ^3.0.2
- [@x12i/credorix-client](https://npm.io/package/@x12i/credorix-client.md) ^1.3.1
- [@x12i/connector-common](https://npm.io/package/@x12i/connector-common.md) ^1.0.0
- [@x12i/memorix-metadata](https://npm.io/package/@x12i/memorix-metadata.md) ^3.2.0
- [@x12i/memorix-connector-sdk](https://npm.io/package/@x12i/memorix-connector-sdk.md) ^1.3.0
- [@x12i/memorix-source-connector](https://npm.io/package/@x12i/memorix-source-connector.md) ^1.0.0
- [@x12i/memorix-target-connector](https://npm.io/package/@x12i/memorix-target-connector.md) ^1.0.0

## Recent versions

- 3.2.1 (latest) — 2026-08-05
- 3.0.0 (next) — 2026-07-23
- 0.0.0-bootstrap.0 (bootstrap) — 2026-07-23
- 3.2.0 — 2026-08-05
- 3.1.0 — 2026-08-02
- 3.0.4 — 2026-07-30
- 3.0.3 — 2026-07-30
- 3.0.2 — 2026-07-23
- 3.0.1 — 2026-07-23
- 0.1.0 — 2026-07-23

## README

# `@x12i/memorix-memory`

**Memory** collector: pull from external sources (via `credentialRef` + connectors) and land **exact raw** as `memorix-record/2` with `contentType: "raw"`.

Raw existence never auto-promotes to snapshots — promotion is an explicit pipeline path (`map-normalize` → `validate` → `identity-dedupe` → `write-record`).

## Install

```bash
npm install @x12i/memorix-memory@3.0.2
```

| Audience | Use this package? |
|----------|-------------------|
| Remote app | **No** — `/api/memory` |
| Platform / pipelines | **Yes** (`memory-pull` step / collector) |

## What it does

1. Resolve `SourceDefinition` + routes from effective metadata  
2. Resolve secrets **only** via `credentialRef` (never inline secrets on the API)  
3. Invoke connector: in-process `DefinedConnector` **or** FR-040 remote host (`hostBaseUrl` / `MGC_SOURCE_SERVICE_URL`) via `POST /v1/pull`  
4. `landItem` / commit-page → draft with exact provider payload in `.data` + `_system.provenance.memory`  
5. Write through `@x12i/memorix-data` writer; update pull run / cursor / quarantine ledgers  

Generic providers (e.g. Google Drive) run on the generic connectors platform; Memory never vendors provider SDKs.

## Core surface

```ts
import {
  createMemoryCollector,
  createMongoMemoryRunStore,
  createStaticCredentialProvider,
  createOpxRestConnector,
} from "@x12i/memorix-memory";

const collector = createMemoryCollector({ /* writer, metadata, credentials, frameworkConnectors */ });
await collector.pull(scope, {
  sourceId: "opx-source",
  mode: "knowledge", // or "context" (+ workRef)
});
```

## HTTP equivalents

| Route | Role |
|-------|------|
| `POST /api/memory/pull` | Run a pull (in-process or remote host) |
| `GET /api/memory/raw` | Read landed raw |
| `GET /api/memory/sources` | List sources from metadata |
| `PUT /api/memory/destinations/:id` | Upsert target destination |
| `POST /api/memory/deliver` | Deliver items via remote target host |
| Runs / quarantine / receipts | Under `/api/memory` and operations |

## Hard rules

- Connectors must be read-only for pull.
- Exact provider payload in raw `.data` — no decoration.
- Secrets: `credentialRef` only.

## Docs

- [`docs/runtime-data-journey.md`](../docs/runtime-data-journey.md) (Act II — Memory pull)
- Ebook: [Relationships & Memory](../memorix-docs/06-relationships-and-memory/)
- Hub: [https://docs.memorix.x12i.com](https://docs.memorix.x12i.com)

```bash
npm test
```

---
_Source: https://npm.io/package/@x12i/memorix-memory · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
