<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[agents](../../) / [Exports](../modules) / UsageStorage

# Interface: UsageStorage

Usage storage interface

## Implemented by

- [`FileUsageStorage`](../classes/FileUsageStorage)
- [`MemoryUsageStorage`](../classes/MemoryUsageStorage)
- [`RemoteUsageStorage`](../classes/RemoteUsageStorage)
- [`SilentUsageStorage`](../classes/SilentUsageStorage)

## Table of contents

### Methods

- [save](UsageStorage#save)
- [getStats](UsageStorage#getstats)
- [getAggregatedStats](UsageStorage#getaggregatedstats)
- [clear](UsageStorage#clear)
- [flush](UsageStorage#flush)
- [close](UsageStorage#close)

## Methods

### save

▸ **save**(`entry`): `Promise`\<`void`\>

#### Parameters

| Name    | Type                       |
| :------ | :------------------------- |
| `entry` | [`UsageStats`](UsageStats) |

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/plugins/usage/types.ts:99](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/usage/types.ts#L99)

---

### getStats

▸ **getStats**(`conversationId?`, `timeRange?`): `Promise`\<[`UsageStats`](UsageStats)[]\>

#### Parameters

| Name              | Type     |
| :---------------- | :------- |
| `conversationId?` | `string` |
| `timeRange?`      | `Object` |
| `timeRange.start` | `Date`   |
| `timeRange.end`   | `Date`   |

#### Returns

`Promise`\<[`UsageStats`](UsageStats)[]\>

#### Defined in

[packages/agents/src/plugins/usage/types.ts:100](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/usage/types.ts#L100)

---

### getAggregatedStats

▸ **getAggregatedStats**(`timeRange?`): `Promise`\<[`AggregatedUsageStats`](AggregatedUsageStats)\>

#### Parameters

| Name              | Type     |
| :---------------- | :------- |
| `timeRange?`      | `Object` |
| `timeRange.start` | `Date`   |
| `timeRange.end`   | `Date`   |

#### Returns

`Promise`\<[`AggregatedUsageStats`](AggregatedUsageStats)\>

#### Defined in

[packages/agents/src/plugins/usage/types.ts:101](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/usage/types.ts#L101)

---

### clear

▸ **clear**(): `Promise`\<`void`\>

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/plugins/usage/types.ts:102](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/usage/types.ts#L102)

---

### flush

▸ **flush**(): `Promise`\<`void`\>

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/plugins/usage/types.ts:103](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/usage/types.ts#L103)

---

### close

▸ **close**(): `Promise`\<`void`\>

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/plugins/usage/types.ts:104](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/usage/types.ts#L104)
