@codesoul-co/hypha-memory / extraction
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/extraction.ts - Exports: 11
Using this module
Use the Extraction module for using the public contracts and operations for this capability boundary. It exports 4 classes, 4 functions, 2 interfaces, 1 type.
Import from the package entrypoint
import {
BasicMemoryExtractionSourceAdapter,
DeterministicMemoryExtractor,
InMemoryMemoryExtractionStateStore,
MemoryExtractionCoordinator,
createConversationExtractionAdapter,
createEpisodicRecordExtractionAdapter,
createRuntimeEventExtractionAdapter,
createTruthExtractionAdapter,
} from '@codesoul-co/hypha-memory';
import type {
MemoryExtractionCoordinatorOptions,
MemoryExtractionStateStore,
ExtractionSourceLoader,
} from '@codesoul-co/hypha-memory';Usage patterns
- Use the 3 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 4 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
- The module exposes 4 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
BasicMemoryExtractionSourceAdapter | class | new BasicMemoryExtractionSourceAdapter<T = unknown>(type: MemoryExtractionSourceType, loader: ExtractionSourceLoader<T>, normalizer: (value: T, ref: MemoryExtractionSourceRef) => NormalizedExtractionInput): BasicMemoryExtractionSourceAdapter<T> | Basic Memory Extraction Source Adapter class with 5 public constructor or member entries; its exact declarations are listed below. |
DeterministicMemoryExtractor | class | new DeterministicMemoryExtractor(): DeterministicMemoryExtractor | Deterministic Memory Extractor class with 4 public constructor or member entries; its exact declarations are listed below. |
InMemoryMemoryExtractionStateStore | class | new InMemoryMemoryExtractionStateStore(): InMemoryMemoryExtractionStateStore | In Memory Memory Extraction State Store class with 7 public constructor or member entries; its exact declarations are listed below. |
MemoryExtractionCoordinator | class | new MemoryExtractionCoordinator(options: MemoryExtractionCoordinatorOptions): MemoryExtractionCoordinator | Memory Extraction Coordinator class with 4 public constructor or member entries; its exact declarations are listed below. |
createConversationExtractionAdapter | function | createConversationExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter | Create Conversation Extraction Adapter function with 1 public call signature; parameters and return types are listed below. |
createEpisodicRecordExtractionAdapter | function | createEpisodicRecordExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter | Create Episodic Record Extraction Adapter function with 1 public call signature; parameters and return types are listed below. |
createRuntimeEventExtractionAdapter | function | createRuntimeEventExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter | Create Runtime Event Extraction Adapter function with 1 public call signature; parameters and return types are listed below. |
createTruthExtractionAdapter | function | createTruthExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter | Create Truth Extraction Adapter function with 1 public call signature; parameters and return types are listed below. |
MemoryExtractionCoordinatorOptions | interface | interface MemoryExtractionCoordinatorOptions | Memory Extraction Coordinator Options interface with 4 public fields or methods. |
MemoryExtractionStateStore | interface | interface MemoryExtractionStateStore | Memory Extraction State Store interface with 6 public fields or methods. |
ExtractionSourceLoader | type | type ExtractionSourceLoader = (ref: MemoryExtractionSourceRef) => Promise<T> | Public type alias for Extraction Source Loader; the declaration contains its complete type expression. |
BasicMemoryExtractionSourceAdapter
Basic Memory Extraction Source Adapter class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { BasicMemoryExtractionSourceAdapter } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare class BasicMemoryExtractionSourceAdapter<T = unknown> implements MemoryExtractionSourceAdapter<T> {
readonly type: MemoryExtractionSourceType;
constructor(type: MemoryExtractionSourceType, loader: ExtractionSourceLoader<T>, normalizer: (value: T, ref: MemoryExtractionSourceRef) => NormalizedExtractionInput);
load(refs: MemoryExtractionSourceRef[], cursor?: MemoryExtractionCursor): Promise<MemoryExtractionSourceBatch<T>>;
normalize(batch: MemoryExtractionSourceBatch<T>): Promise<NormalizedExtractionInput[]>;
health(): Promise<ProviderHealth>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | <T = unknown>(type: MemoryExtractionSourceType, loader: ExtractionSourceLoader<T>, normalizer: (value: T, ref: MemoryExtractionSourceRef) => NormalizedExtractionInput): BasicMemoryExtractionSourceAdapter<T> | Creates an instance of this class. |
health | method | health(): Promise<ProviderHealth> | Public method; parameters and return type are shown in the signature. |
load | method | load(refs: MemoryExtractionSourceRef[], cursor?: MemoryExtractionCursor): Promise<MemoryExtractionSourceBatch<T>> | Public method; parameters and return type are shown in the signature. |
normalize | method | normalize(batch: MemoryExtractionSourceBatch<T>): Promise<NormalizedExtractionInput[]> | Public method; parameters and return type are shown in the signature. |
type | property | readonly type: MemoryExtractionSourceType | Public property; its type, readonly modifier and optionality are shown in the signature. |
DeterministicMemoryExtractor
Deterministic Memory Extractor class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DeterministicMemoryExtractor } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare class DeterministicMemoryExtractor implements MemoryExtractor {
readonly id = "memory.extractor.deterministic";
extract(inputs: NormalizedExtractionInput[], profile: MemoryExtractionProfileSpec): Promise<ExtractedMemoryCandidate[]>;
health(): Promise<ProviderHealth>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): DeterministicMemoryExtractor | Creates an instance of this class. |
extract | method | extract(inputs: NormalizedExtractionInput[], profile: MemoryExtractionProfileSpec): Promise<ExtractedMemoryCandidate[]> | Public method; parameters and return type are shown in the signature. |
health | method | health(): Promise<ProviderHealth> | Public method; parameters and return type are shown in the signature. |
id | property | readonly id: "memory.extractor.deterministic" | Public property; its type, readonly modifier and optionality are shown in the signature. |
InMemoryMemoryExtractionStateStore
In Memory Memory Extraction State Store class with 7 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryMemoryExtractionStateStore } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare class InMemoryMemoryExtractionStateStore implements MemoryExtractionStateStore {
getJob(id: string): Promise<MemoryExtractionJob | null>;
saveJob(job: MemoryExtractionJob): Promise<void>;
getBatch(id: string): Promise<MemoryExtractionBatch | null>;
saveBatch(batch: MemoryExtractionBatch): Promise<void>;
getCursor(sourceType: MemoryExtractionSourceType, sourceId: string): Promise<MemoryExtractionCursor | null>;
saveCursor(cursor: MemoryExtractionCursor, expectedSequence?: number): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): InMemoryMemoryExtractionStateStore | Creates an instance of this class. |
getBatch | method | getBatch(id: string): Promise<MemoryExtractionBatch | null> | Public method; parameters and return type are shown in the signature. |
getCursor | method | getCursor(sourceType: MemoryExtractionSourceType, sourceId: string): Promise<MemoryExtractionCursor | null> | Public method; parameters and return type are shown in the signature. |
getJob | method | getJob(id: string): Promise<MemoryExtractionJob | null> | Public method; parameters and return type are shown in the signature. |
saveBatch | method | saveBatch(batch: MemoryExtractionBatch): Promise<void> | Public method; parameters and return type are shown in the signature. |
saveCursor | method | saveCursor(cursor: MemoryExtractionCursor, expectedSequence?: number): Promise<void> | Public method; parameters and return type are shown in the signature. |
saveJob | method | saveJob(job: MemoryExtractionJob): Promise<void> | Public method; parameters and return type are shown in the signature. |
MemoryExtractionCoordinator
Memory Extraction Coordinator class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { MemoryExtractionCoordinator } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare class MemoryExtractionCoordinator {
readonly stateStore: MemoryExtractionStateStore;
constructor(options: MemoryExtractionCoordinatorOptions);
run(request: MemoryExtractionRequest, profile: MemoryExtractionProfileSpec): Promise<{
job: MemoryExtractionJob;
batch: MemoryExtractionBatch;
}>;
getJob(id: string): Promise<MemoryExtractionJob | null>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (options: MemoryExtractionCoordinatorOptions): MemoryExtractionCoordinator | Creates an instance of this class. |
getJob | method | getJob(id: string): Promise<MemoryExtractionJob | null> | Public method; parameters and return type are shown in the signature. |
run | method | run(request: MemoryExtractionRequest, profile: MemoryExtractionProfileSpec): Promise<{ job: MemoryExtractionJob; batch: MemoryExtractionBatch; }> | Public method; parameters and return type are shown in the signature. |
stateStore | property | readonly stateStore: MemoryExtractionStateStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
createConversationExtractionAdapter
Create Conversation Extraction Adapter function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createConversationExtractionAdapter } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare function createConversationExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter;Call signature
createConversationExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapterParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
loader | ExtractionSourceLoader<unknown> | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
BasicMemoryExtractionSourceAdapter<unknown> - Description: The return contract is defined by the type shown above.
createEpisodicRecordExtractionAdapter
Create Episodic Record Extraction Adapter function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createEpisodicRecordExtractionAdapter } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare function createEpisodicRecordExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter;Call signature
createEpisodicRecordExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapterParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
loader | ExtractionSourceLoader<unknown> | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
BasicMemoryExtractionSourceAdapter<unknown> - Description: The return contract is defined by the type shown above.
createRuntimeEventExtractionAdapter
Create Runtime Event Extraction Adapter function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createRuntimeEventExtractionAdapter } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare function createRuntimeEventExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter;Call signature
createRuntimeEventExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapterParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
loader | ExtractionSourceLoader<unknown> | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
BasicMemoryExtractionSourceAdapter<unknown> - Description: The return contract is defined by the type shown above.
createTruthExtractionAdapter
Create Truth Extraction Adapter function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createTruthExtractionAdapter } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export declare function createTruthExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapter;Call signature
createTruthExtractionAdapter(loader: ExtractionSourceLoader<unknown>): BasicMemoryExtractionSourceAdapterParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
loader | ExtractionSourceLoader<unknown> | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
BasicMemoryExtractionSourceAdapter<unknown> - Description: The return contract is defined by the type shown above.
MemoryExtractionCoordinatorOptions
Memory Extraction Coordinator Options interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { MemoryExtractionCoordinatorOptions } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export interface MemoryExtractionCoordinatorOptions {
adapters: MemoryExtractionSourceAdapter[];
extractor: MemoryExtractor;
stateStore?: MemoryExtractionStateStore;
now?: () => string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
adapters | property | adapters: MemoryExtractionSourceAdapter<unknown>[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
extractor | property | extractor: MemoryExtractor | Public property; its type, readonly modifier and optionality are shown in the signature. |
now | method | now?(): string | Public method; parameters and return type are shown in the signature. |
stateStore | property | stateStore?: MemoryExtractionStateStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryExtractionStateStore
Memory Extraction State Store interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { MemoryExtractionStateStore } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export interface MemoryExtractionStateStore {
getJob(id: string): Promise<MemoryExtractionJob | null>;
saveJob(job: MemoryExtractionJob): Promise<void>;
getBatch(id: string): Promise<MemoryExtractionBatch | null>;
saveBatch(batch: MemoryExtractionBatch): Promise<void>;
getCursor(sourceType: MemoryExtractionSourceType, sourceId: string): Promise<MemoryExtractionCursor | null>;
saveCursor(cursor: MemoryExtractionCursor, expectedSequence?: number): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
getBatch | method | getBatch(id: string): Promise<MemoryExtractionBatch | null> | Public method; parameters and return type are shown in the signature. |
getCursor | method | getCursor(sourceType: MemoryExtractionSourceType, sourceId: string): Promise<MemoryExtractionCursor | null> | Public method; parameters and return type are shown in the signature. |
getJob | method | getJob(id: string): Promise<MemoryExtractionJob | null> | Public method; parameters and return type are shown in the signature. |
saveBatch | method | saveBatch(batch: MemoryExtractionBatch): Promise<void> | Public method; parameters and return type are shown in the signature. |
saveCursor | method | saveCursor(cursor: MemoryExtractionCursor, expectedSequence?: number): Promise<void> | Public method; parameters and return type are shown in the signature. |
saveJob | method | saveJob(job: MemoryExtractionJob): Promise<void> | Public method; parameters and return type are shown in the signature. |
ExtractionSourceLoader
Public type alias for Extraction Source Loader; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExtractionSourceLoader } from '@codesoul-co/hypha-memory'; - Source module:
extraction
Declaration
export type ExtractionSourceLoader<T> = (ref: MemoryExtractionSourceRef) => Promise<T>;