feat: add semantic fact search and embeddings
This commit is contained in:
@@ -71,3 +71,34 @@ export interface ListTopicsOptions {
|
||||
includeFacts?: boolean;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface EmbeddingProvider {
|
||||
model: string;
|
||||
dimensions: number;
|
||||
embed(input: string): Promise<number[]>;
|
||||
embedMany?(inputs: string[]): Promise<number[][]>;
|
||||
}
|
||||
|
||||
export interface IndexFactEmbeddingsInput {
|
||||
provider: EmbeddingProvider;
|
||||
}
|
||||
|
||||
export interface SearchFactsInput {
|
||||
query: string;
|
||||
provider: EmbeddingProvider;
|
||||
topicNames?: string[];
|
||||
limit?: number;
|
||||
minimumScore?: number;
|
||||
}
|
||||
|
||||
export interface FindSimilarFactsInput {
|
||||
statement: string;
|
||||
provider: EmbeddingProvider;
|
||||
topicNames?: string[];
|
||||
limit?: number;
|
||||
minimumScore?: number;
|
||||
}
|
||||
|
||||
export interface ScoredFact extends Fact {
|
||||
score: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user