# Class SharedMemoryStore

In-memory store for cross-stage knowledge sharing.

- Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:45

##### Index

### Constructors

constructor

### Accessors

size

### Methods

write
read
readFromStage
summarize
clear

## Constructors

### constructor

- new SharedMemoryStore(maxEntries?: number): SharedMemoryStore

  #### Parameters

  - maxEntries: number = 100

  #### Returns SharedMemoryStore

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:49

## Accessors

### size

- get size(): number

  Get entry count.

  #### Returns number

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:89

## Methods

### write

- write(sourceStage: string, tag: SharedMemoryTag, content: unknown): void

  Write a memory entry.

  #### Parameters

  - sourceStage: string
  - tag: SharedMemoryTag
  - content: unknown

  #### Returns void

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:54

### read

- read(tag?: SharedMemoryTag): readonly SharedMemoryEntry[]

  Read all entries, optionally filtered by tag.

  #### Parameters

  - `Optional` tag: SharedMemoryTag

  #### Returns readonly SharedMemoryEntry[]

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:67

### readFromStage

- readFromStage(sourceStage: string): readonly SharedMemoryEntry[]

  Read entries from a specific stage.

  #### Parameters

  - sourceStage: string

  #### Returns readonly SharedMemoryEntry[]

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:73

### summarize

- summarize(maxLength?: number): string

  Get summary of all entries as context string for LLM consumption.

  #### Parameters

  - maxLength: number = 2000

  #### Returns string

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:78

### clear

- clear(): void

  Clear all entries.

  #### Returns void

  - Defined in packages/nexus-agents/src/pipeline/shared-memory.ts:94