[**@s4ai/core Documentation v0.3.23**](../../../README.md)

***

[@s4ai/core Documentation](../../../modules.md) / [autonomous/q-dd-temporal-memory-model](../README.md) / QDDTemporalMemoryModel

# Class: QDDTemporalMemoryModel

Defined in: autonomous/q-dd-temporal-memory-model.js:7

Q-DD Orchestrator - Temporal Memory Model
Tracks past (logs), present (runtime), future (roadmap) states
Enables historical reasoning and predictive decision-making

## Constructors

### Constructor

> **new QDDTemporalMemoryModel**(): `QDDTemporalMemoryModel`

Defined in: autonomous/q-dd-temporal-memory-model.js:8

#### Returns

`QDDTemporalMemoryModel`

## Properties

### stateSnapshots

> **stateSnapshots**: `any`[]

Defined in: autonomous/q-dd-temporal-memory-model.js:16

***

### temporalIndex

> **temporalIndex**: `Map`\<`any`, `any`\>

Defined in: autonomous/q-dd-temporal-memory-model.js:15

***

### timelineEvents

> **timelineEvents**: `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:9

#### future

> **future**: `never`[] = `[]`

#### past

> **past**: `never`[] = `[]`

#### present

> **present**: `never`[] = `[]`

***

### trends

> **trends**: `Map`\<`any`, `any`\>

Defined in: autonomous/q-dd-temporal-memory-model.js:17

## Methods

### calculatePercentChange()

> **calculatePercentChange**(`trendName`, `value`): `number`

Defined in: autonomous/q-dd-temporal-memory-model.js:130

Calculate percent change from previous value

#### Parameters

##### trendName

`any`

##### value

`any`

#### Returns

`number`

***

### calculatePredictionConfidence()

> **calculatePredictionConfidence**(`data`): `number`

Defined in: autonomous/q-dd-temporal-memory-model.js:256

Calculate confidence in prediction

#### Parameters

##### data

`any`

#### Returns

`number`

***

### diffStates()

> **diffStates**(`prev`, `curr`): `object`[]

Defined in: autonomous/q-dd-temporal-memory-model.js:305

Diff two state objects

#### Parameters

##### prev

`any`

##### curr

`any`

#### Returns

`object`[]

***

### getFutureContext()

> **getFutureContext**(`fromTime`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:192

Get future context (planned actions)

#### Parameters

##### fromTime

`any`

#### Returns

`object`

##### highPriority

> **highPriority**: `any`[]

##### nearTerm

> **nearTerm**: `any`[]

##### plannedActions

> **plannedActions**: `any`[] = `futureEvents`

***

### getPastContext()

> **getPastContext**(`startTime`, `endTime`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:161

Get past context (historical)

#### Parameters

##### startTime

`any`

##### endTime

`any`

#### Returns

`object`

##### eventCount

> **eventCount**: `number` = `pastEvents.length`

##### events

> **events**: `any`[] = `pastEvents`

##### keyIncidents

> **keyIncidents**: `any`[]

##### timespan

> **timespan**: `number`

***

### getPresentContext()

> **getPresentContext**(): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:179

Get present context (current state)

#### Returns

`object`

##### state

> **state**: `never`

##### stateHash

> **stateHash**: `any`

##### timestamp

> **timestamp**: `number`

***

### getStateChanges()

> **getStateChanges**(`startTime`, `endTime`): \{ `changes`: `never`[]; `totalTime?`: `undefined`; \} \| \{ `changes`: `object`[]; `totalTime`: `number`; \}

Defined in: autonomous/q-dd-temporal-memory-model.js:275

Get state changes between two times

#### Parameters

##### startTime

`any`

##### endTime

`any`

#### Returns

\{ `changes`: `never`[]; `totalTime?`: `undefined`; \} \| \{ `changes`: `object`[]; `totalTime`: `number`; \}

***

### getTemporalAnalysisReport()

> **getTemporalAnalysisReport**(`lookbackHours?`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:346

Get temporal analysis report

#### Parameters

##### lookbackHours?

`number` = `24`

#### Returns

`object`

##### futureAnalysis

> **futureAnalysis**: `object`

###### futureAnalysis.plannedActions

> **plannedActions**: `any`[] = `context.futureContext.plannedActions`

###### futureAnalysis.predictions

> **predictions**: `object`

##### lookbackHours

> **lookbackHours**: `number`

##### pastAnalysis

> **pastAnalysis**: `object`

###### pastAnalysis.keyEvents

> **keyEvents**: `any`[] = `context.pastContext.keyIncidents`

###### pastAnalysis.totalEventCount

> **totalEventCount**: `number` = `context.pastContext.eventCount`

##### presentAnalysis

> **presentAnalysis**: `object` = `context.presentContext`

###### presentAnalysis.state

> **state**: `never`

###### presentAnalysis.stateHash

> **stateHash**: `any`

###### presentAnalysis.timestamp

> **timestamp**: `number`

##### timestamp

> **timestamp**: `number`

##### trends

> **trends**: `object` = `context.trends`

***

### getTemporalContext()

> **getTemporalContext**(`lookbackHours?`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:143

Get temporal context for decision-making

#### Parameters

##### lookbackHours?

`number` = `24`

#### Returns

`object`

##### futureContext

> **futureContext**: `object`

###### futureContext.highPriority

> **highPriority**: `any`[]

###### futureContext.nearTerm

> **nearTerm**: `any`[]

###### futureContext.plannedActions

> **plannedActions**: `any`[] = `futureEvents`

##### pastContext

> **pastContext**: `object`

###### pastContext.eventCount

> **eventCount**: `number` = `pastEvents.length`

###### pastContext.events

> **events**: `any`[] = `pastEvents`

###### pastContext.keyIncidents

> **keyIncidents**: `any`[]

###### pastContext.timespan

> **timespan**: `number`

##### presentContext

> **presentContext**: `object`

###### presentContext.state

> **state**: `never`

###### presentContext.stateHash

> **stateHash**: `any`

###### presentContext.timestamp

> **timestamp**: `number`

##### timestamp

> **timestamp**: `number` = `now`

##### trends

> **trends**: `object`

***

### getTrendsSummary()

> **getTrendsSummary**(`lookbackHours?`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:207

Get trends summary

#### Parameters

##### lookbackHours?

`number` = `24`

#### Returns

`object`

***

### hashState()

> **hashState**(`state`): `string`

Defined in: autonomous/q-dd-temporal-memory-model.js:332

Hash state for change detection

#### Parameters

##### state

`any`

#### Returns

`string`

***

### indexEvent()

> **indexEvent**(`timestamp`, `event`): `void`

Defined in: autonomous/q-dd-temporal-memory-model.js:96

Index event by timestamp

#### Parameters

##### timestamp

`any`

##### event

`any`

#### Returns

`void`

***

### predictFutureState()

> **predictFutureState**(`hoursAhead?`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:231

Predict future state based on trends

#### Parameters

##### hoursAhead?

`number` = `1`

#### Returns

`object`

***

### recordFutureEvent()

> **recordFutureEvent**(`event`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:77

Record future event (planned)

#### Parameters

##### event

`any`

#### Returns

`object`

##### recorded

> **recorded**: `object` = `futureEvent`

###### recorded.dependencies

> **dependencies**: `any`

###### recorded.description

> **description**: `any` = `event.description`

###### recorded.expectedOutcome

> **expectedOutcome**: `any`

###### recorded.plannedTime

> **plannedTime**: `any`

###### recorded.priority

> **priority**: `any`

###### recorded.type

> **type**: `any`

##### success

> **success**: `boolean` = `true`

***

### recordPastEvent()

> **recordPastEvent**(`event`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:23

Record past event (historical)

#### Parameters

##### event

`any`

#### Returns

`object`

##### recorded

> **recorded**: `object` = `pastEvent`

###### recorded.description

> **description**: `any` = `event.description`

###### recorded.metadata

> **metadata**: `any`

###### recorded.severity

> **severity**: `any`

###### recorded.timestamp

> **timestamp**: `any`

###### recorded.type

> **type**: `any`

##### success

> **success**: `boolean` = `true`

***

### recordPresentState()

> **recordPresentState**(`state`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:41

Record current state (present)

#### Parameters

##### state

`any`

#### Returns

`object`

##### recorded

> **recorded**: `object` = `presentState`

###### recorded.activeEngines

> **activeEngines**: `any`

###### recorded.metrics

> **metrics**: `object`

###### recorded.metrics.acquisitionMetrics

> **acquisitionMetrics**: `any`

###### recorded.metrics.activeEngines

> **activeEngines**: `any`

###### recorded.metrics.apiStatus

> **apiStatus**: `any`

###### recorded.metrics.dbStatus

> **dbStatus**: `any`

###### recorded.metrics.healthScore

> **healthScore**: `any`

###### recorded.metrics.revenuePerHour

> **revenuePerHour**: `any`

###### recorded.runningOperations

> **runningOperations**: `any`

###### recorded.timestamp

> **timestamp**: `number`

###### recorded.type

> **type**: `string` = `'present_state'`

##### success

> **success**: `boolean` = `true`

***

### recordTrend()

> **recordTrend**(`trendName`, `value`, `timestamp?`): `object`

Defined in: autonomous/q-dd-temporal-memory-model.js:106

Track metric trend over time

#### Parameters

##### trendName

`any`

##### value

`any`

##### timestamp?

`number` = `...`

#### Returns

`object`

##### percentChange

> **percentChange**: `number`

##### timestamp

> **timestamp**: `number`

##### value

> **value**: `any`
