open-index/open-npm huggingface dataset:
npm package: @open-engram/adapters-embedding
Description: Embedding adapters for Open-Engram — OpenAI, Ollama, and Transformers.js
Latest version: 1.0.1

# @open-engram/adapters-embedding

Embedding adapters for Open-Engram — OpenAI, Ollama, Transformers.js, and CLIP.

## Install

```bash
npm install @open-engram/adapters-embedding
```

## Adapters

### OpenAI

```typescript
import { OpenAIEmbeddingAdapter } from '@open-engram/adapters-embedding/openai';

const embedder = new OpenAIEmbeddingAdapter({ apiKey: process.env.OPENAI_API_KEY });
```

### Transformers.js (offline)

```typescript
import { TransformersEmbeddingAdapter } from '@open-engram/adapters-embedding/transformers';

const embedder = new TransformersEmbeddingAdapter();
```

Runs locally via `@xenova/transformers` — no API key needed. Works fully offline.

### Ollama (local)

```typescript
import { OllamaEmbeddingAdapter } from '@open-engram/adapters-embedding/ollama';

const embedder = new OllamaEmbeddingAdapter({ model: 'nomic-embed-text' });
```

### CLIP (multimodal)

```typescript
import { CLIPEmbeddingAdapter } from '@open-engram/adapters-embedding/clip';

const embedder = new CLIPEmbeddingAdapter();
```

## Peer Dependencies

- `openai` ^4.0.0 (for OpenAI adapter)
- `@xenova/transformers` ^2.17.0 (for Transformers.js adapter)

## License

Apache-2.0
npm package: @open-engram/adapters-llm
Description: LLM adapters for Open-Engram — OpenAI, Anthropic, Ollama, and Mock
Latest version: 1.0.1

# @open-engram/adapters-llm

LLM adapters for Open-Engram — OpenAI, Anthropic, Ollama, and Mock.

## Install

```bash
npm install @open-engram/adapters-llm
```

## Adapters

### OpenAI

```typescript
import { OpenAILLMAdapter } from '@open-engram/adapters-llm/openai';

const llm = new OpenAILLMAdapter({ apiKey: process.env.OPENAI_API_KEY });
```

### Anthropic

```typescript
import { AnthropicLLMAdapter } from '@open-engram/adapters-llm/anthropic';

const llm = new AnthropicLLMAdapter({ apiKey: process.env.ANTHROPIC_API_KEY });
```

### Ollama (local)

```typescript
import { OllamaLLMAdapter } from '@open-engram/adapters-llm/ollama';

const llm = new OllamaLLMAdapter({ model: 'llama3' });
```

### Mock (testing)

```typescript
import { MockLLMAdapter } from '@open-engram/adapters-llm/mock';

const llm = new MockLLMAdapter();
```

Returns deterministic responses — useful for tests and offline development.

## Peer Dependencies

- `openai` ^4.0.0 (for OpenAI adapter)
- `@anthropic-ai/sdk` ^0.30.0 (for Anthropic adapter)

## License

Apache-2.0
npm package: @open-engram/adapters-storage
Description: SQLite storage adapter for Open-Engram with sqlite-vec vector search
Latest version: 1.0.1

# @open-engram/adapters-storage

SQLite storage adapter for Open-Engram with sqlite-vec vector search.

## Install

```bash
npm install @open-engram/adapters-storage
```

## Usage

```typescript
import { SQLiteStorageAdapter } from '@open-engram/adapters-storage';

const storage = new SQLiteStorageAdapter({ path: './engram.db' });
```

Uses `better-sqlite3` for the database and `sqlite-vec` for vector similarity search. Works fully offline with no external services.

## Features

- Full CRUD for episodic and semantic records
- Vector similarity search via sqlite-vec
- Automatic schema migrations
- Single-file database — easy to backup and transport

## License

Apache-2.0
npm package: @open-engram/adapters-storage-postgres
Description: PostgreSQL + pgvector storage adapter for Open-Engram
Latest version: 1.0.1

# @open-engram/adapters-storage-postgres

PostgreSQL + pgvector storage adapter for Open-Engram.

## Install

```bash
npm install @open-engram/adapters-storage-postgres
```

## Usage

```typescript
import { PostgresStorageAdapter } from '@open-engram/adapters-storage-postgres';

const storage = new PostgresStorageAdapter({
  connectionString: process.env.DATABASE_URL,
});
```

## Requirements

- PostgreSQL 15+
- [pgvector](https://github.com/pgvector/pgvector) extension enabled

## Features

- Full CRUD for episodic and semantic records
- Vector similarity search via pgvector
- Connection pooling via `pg`
- Automatic table creation and migrations

## License

Apache-2.0
npm package: @open-engram/adapters-storage-powersync
Description: PowerSync bi-directional sync storage adapter for Open-Engram
Latest version: 1.0.1

# @open-engram/adapters-storage-powersync

PowerSync bi-directional sync storage adapter for Open-Engram.

## Install

```bash
npm install @open-engram/adapters-storage-powersync
```

## Usage

```typescript
import { PowerSyncStorageAdapter } from '@open-engram/adapters-storage-powersync';

const storage = new PowerSyncStorageAdapter({
  powerSyncUrl: process.env.POWERSYNC_URL,
});
```

## Overview

Enables real-time bi-directional sync between multiple agents or devices via [PowerSync](https://www.powersync.com/). Key capabilities:

- **Offline-first** — works without connectivity, syncs when online
- **Multi-agent sync** — agents share knowledge via Sync Streams
- **Conflict resolution** — handles concurrent writes across agents
- **Connectivity state machine** — ONLINE / DEGRADED / OFFLINE / ISOLATED

## Peer Dependencies

- `@powersync/web` ^1.0.0

## License

Apache-2.0
npm package: @open-engram/adapters-storage-supabase
Description: Supabase storage adapter for Open-Engram with vector search via pgvector RPC
Latest version: 1.0.1

# @open-engram/adapters-storage-supabase

Supabase storage adapter for Open-Engram with vector search via pgvector RPC.

## Install

```bash
npm install @open-engram/adapters-storage-supabase
```

## Usage

```typescript
import { SupabaseStorageAdapter } from '@open-engram/adapters-storage-supabase';

const storage = new SupabaseStorageAdapter({
  supabaseUrl: process.env.SUPABASE_URL,
  supabaseKey: process.env.SUPABASE_ANON_KEY,
});
```

## Requirements

- Supabase project with pgvector extension enabled
- RPC functions for vector similarity search

## Features

- Full CRUD for episodic and semantic records
- Vector similarity search via Supabase RPC + pgvector
- Row-level security compatible
- Real-time subscriptions support

## Peer Dependencies

- `@supabase/supabase-js` ^2.45.0

## License

Apache-2.0
npm package: @open-engram/cli
Description: Developer CLI for Open-Engram memory architecture
Latest version: 1.0.1

# @open-engram/cli

Developer CLI for the Open-Engram memory architecture.

## Install

```bash
npm install -g @open-engram/cli
```

## Usage

```bash
# Show memory status
engram status

# Interactive memory explorer
engram inspect

# Run consolidation
engram consolidate

# Export memory state
engram export --output snapshot.json

# Import memory state
engram import snapshot.json
```

## Commands

| Command | Description |
|---|---|
| `engram status` | Show store stats and working memory usage |
| `engram inspect` | Interactive browser for all four stores |
| `engram consolidate` | Trigger consolidation pipeline |
| `engram export` | Export full memory state to JSON |
| `engram import` | Import memory state from JSON |

## License

Apache-2.0
npm package: @open-engram/core
Description: Core memory architecture for Open-Engram — stores, gates, retrieval, consolidation
Latest version: 1.0.1

# @open-engram/core

Core memory architecture for Open-Engram — a biologically-grounded, four-store memory system for AI agents.

## Install

```bash
npm install @open-engram/core
```

## Overview

Implements the four-store memory model inspired by Standard Consolidation Theory, Complementary Learning Systems, Baddeley's working memory model, and thalamic gating theory:

- **Sensory Buffer** — high-throughput ingestion with TTL-based expiry
- **Working Memory** — capacity-limited active context scored by Recency-Frequency-Relevance (RFR)
- **Episodic Store** — contextually-indexed event records with vector search
- **Semantic Store** — long-term structured knowledge with versioning and conflict resolution

Plus subsystems: Attention Gate, Consolidation Engine (7-stage distillation pipeline), and Tiered Retrieval (T0/T1/T2).

## Quick Start

```typescript
import { EngramClient } from '@open-engram/core';

const client = await EngramClient.create({
  workingMemory: { tokenBudget: 8192 },
  consolidation: { trigger: 'session-end' },
});

// Ingest an event
await client.sense({ content: 'User prefers dark mode', source: 'settings' });

// Run attention gate → promote to working memory
await client.focus();

// Search across stores
const results = await client.recall('user preferences', { limit: 5 });

// Save a fact to semantic memory
await client.remember('User prefers dark mode', { confidence: 0.9 });

// Run consolidation pipeline (episodic → semantic)
await client.consolidate();

// Export full memory state
const snapshot = await client.export();
```

## API

| Method | Description |
|---|---|
| `sense(event)` | Ingest into sensory buffer |
| `focus()` | Run attention gate, promote to working memory |
| `recall(query, opts)` | Search across episodic + semantic stores |
| `remember(content, opts)` | Write directly to semantic store |
| `checkpoint(label)` | Snapshot working memory to episodic store |
| `consolidate()` | Run 7-stage distillation pipeline |
| `forget(id)` | Remove a specific record |
| `purge()` | Clear all stores |
| `pin(id)` / `unpin(id)` | Protect entries from eviction |
| `status()` | Memory stats and store counts |
| `export()` / `import(data)` | Serialize/deserialize full state |

## Adapters

The core package uses an in-memory adapter by default. For persistent storage, use:

- [`@open-engram/adapters-storage`](https://www.npmjs.com/package/@open-engram/adapters-storage) — SQLite + sqlite-vec
- [`@open-engram/adapters-storage-postgres`](https://www.npmjs.com/package/@open-engram/adapters-storage-postgres) — PostgreSQL + pgvector
- [`@open-engram/adapters-storage-powersync`](https://www.npmjs.com/package/@open-engram/adapters-storage-powersync) — PowerSync bi-directional sync
- [`@open-engram/adapters-storage-supabase`](https://www.npmjs.com/package/@open-engram/adapters-storage-supabase) — Supabase + pgvector RPC

## License

Apache-2.0
npm package: @open-engram/dashboard
Description: Observability dashboard for Open-Engram memory architecture
Latest version: 1.0.1

# @open-engram/dashboard

Observability dashboard for the Open-Engram memory architecture.

## Install

```bash
npm install @open-engram/dashboard
```

## Usage

```typescript
import { createDashboard } from '@open-engram/dashboard';
import { EngramClient } from '@open-engram/core';

const client = await EngramClient.create();
const dashboard = createDashboard(client);

// Start dashboard server
dashboard.listen(3001);
```

## Features

- Real-time view of all four memory stores
- Working memory token budget gauge
- Consolidation pipeline activity log
- Store entry counts and growth over time
- Retrieval trace inspector

## License

Apache-2.0
npm package: @open-engram/fhir
Description: FHIR R4 resource types and text converter for Open-Engram
Latest version: 1.0.1

# @open-engram/fhir

FHIR R4 resource types and text converter for Open-Engram.

## Install

```bash
npm install @open-engram/fhir
```

## Overview

Converts FHIR R4 clinical resources into text representations suitable for ingestion into Open-Engram's memory stores. Useful for healthcare AI agents that need to process structured clinical data.

## Usage

```typescript
import { fhirToText } from '@open-engram/fhir';

const text = fhirToText(patientResource);
// "Patient: John Doe, DOB: 1990-01-15, MRN: 12345"

// Then ingest into engram
await client.sense({ content: text, source: 'fhir' });
```

## Supported Resources

- Patient
- Observation
- Condition
- MedicationRequest
- Encounter
- DiagnosticReport

## License

Apache-2.0
npm package: @open-engram/langchain
Description: LangChain.js integration for Open-Engram — tools and BaseMemory subclass
Latest version: 1.0.1

# @open-engram/langchain

[LangChain.js](https://js.langchain.com/) integration for Open-Engram — tools and BaseMemory subclass.

## Install

```bash
npm install @open-engram/langchain @open-engram/core
```

## Usage

### As Tools

```typescript
import { EngramClient } from '@open-engram/core';
import { createEngramTools } from '@open-engram/langchain';

const client = await EngramClient.create();
const tools = createEngramTools(client);

// Pass to a LangChain agent
```

### As BaseMemory

```typescript
import { EngramClient } from '@open-engram/core';
import { EngramMemory } from '@open-engram/langchain';

const client = await EngramClient.create();
const memory = new EngramMemory({ client });

// Use with LangChain chains
const chain = new ConversationChain({ memory });
```

## Peer Dependencies

- `@open-engram/core` ^1.0.0
- `@langchain/core` ^0.3.0

## License

Apache-2.0
npm package: @open-engram/mastra
Description: Mastra plugin for Open-Engram memory architecture
Latest version: 1.0.1

# @open-engram/mastra

[Mastra](https://mastra.ai/) plugin for the Open-Engram memory architecture.

## Install

```bash
npm install @open-engram/mastra @open-engram/core
```

## Usage

```typescript
import { EngramClient } from '@open-engram/core';
import { createEngramTools } from '@open-engram/mastra';

const client = await EngramClient.create();
const tools = createEngramTools(client);

// Use with a Mastra agent
const agent = new Agent({
  tools: {
    ...tools,
  },
});
```

## Tools Provided

| Tool | Description |
|---|---|
| `engram_sense` | Ingest events into sensory buffer |
| `engram_focus` | Run attention gate, update working memory |
| `engram_recall` | Search across episodic + semantic stores |
| `engram_remember` | Write facts to semantic store |
| `engram_checkpoint` | Snapshot working memory to episodic store |
| `engram_consolidate` | Run consolidation pipeline |
| `engram_forget` | Remove a specific record |
| `engram_status` | Get memory stats |

## Peer Dependencies

- `@open-engram/core` ^1.0.0
- `@mastra/core` ^0.5.0

## License

Apache-2.0
npm package: @open-engram/observability
Description: Observability adapters for Open-Engram — OpenTelemetry and console logging
Latest version: 1.0.1

# @open-engram/observability

Observability adapters for Open-Engram — OpenTelemetry and console logging.

## Install

```bash
npm install @open-engram/observability
```

## Usage

### OpenTelemetry

```typescript
import { OTelObservabilityAdapter } from '@open-engram/observability';

const obs = new OTelObservabilityAdapter({
  serviceName: 'my-agent',
});
```

Exports traces, metrics, and spans compatible with any OpenTelemetry collector (Jaeger, Grafana, Datadog, etc.).

### Console

```typescript
import { ConsoleObservabilityAdapter } from '@open-engram/observability';

const obs = new ConsoleObservabilityAdapter();
```

Logs memory operations to stdout — useful for development and debugging.

## Peer Dependencies

- `@opentelemetry/api` ^1.9.0
- `@opentelemetry/sdk-trace-base` ^1.25.0
- `@opentelemetry/sdk-metrics` ^1.25.0

## License

Apache-2.0
npm package: @open-engram/types
Description: Type definitions and Zod schemas for Open-Engram memory architecture
Latest version: 1.0.1

# @open-engram/types

Type definitions and Zod schemas for the Open-Engram memory architecture.

## Install

```bash
npm install @open-engram/types
```

## Overview

Shared TypeScript types and runtime-validated Zod schemas used across all `@open-engram/*` packages. Includes definitions for:

- Memory records (sensory events, working memory entries, episodic records, semantic facts)
- Adapter interfaces (`StorageAdapter`, `EmbeddingAdapter`, `LLMAdapter`)
- Configuration schemas (`EngramConfig`, store configs, gate configs)
- Consolidation types (distillation results, conflict resolution strategies)
- Retrieval types (`RetrievalTrace`, tiered results)
- Connectivity state machine states

## Usage

```typescript
import type {
  SemanticRecord,
  EpisodicRecord,
  StorageAdapter,
  EmbeddingAdapter,
  EngramConfig,
} from '@open-engram/types';
```

## License

Apache-2.0
npm package: @open-engram/vercel-ai
Description: Vercel AI SDK integration for Open-Engram — tools and middleware
Latest version: 1.0.1

# @open-engram/vercel-ai

[Vercel AI SDK](https://sdk.vercel.ai/) integration for Open-Engram — tools and middleware.

## Install

```bash
npm install @open-engram/vercel-ai @open-engram/core
```

## Usage

```typescript
import { EngramClient } from '@open-engram/core';
import { createEngramTools } from '@open-engram/vercel-ai';
import { generateText } from 'ai';

const client = await EngramClient.create();
const tools = createEngramTools(client);

const result = await generateText({
  model: yourModel,
  tools,
  prompt: 'What do you remember about the user?',
});
```

## Tools Provided

| Tool | Description |
|---|---|
| `engram_sense` | Ingest events into sensory buffer |
| `engram_focus` | Run attention gate, update working memory |
| `engram_recall` | Search across episodic + semantic stores |
| `engram_remember` | Write facts to semantic store |
| `engram_checkpoint` | Snapshot working memory to episodic store |
| `engram_consolidate` | Run consolidation pipeline |

## Peer Dependencies

- `@open-engram/core` ^1.0.0
- `ai` ^4.0.0

## License

Apache-2.0