**feat: add findSimilar method for entity similarity search**
### Changes: - Introduced a `findSimilar` method in `src/brainyData.ts`: - Enables searching for entities similar to a given entity ID. - Supports options such as result limit, noun type filtering, verb inclusion, and search mode (local, remote, or combined). - Filters out the original entity in results and returns limited output based on the specified options. - Updated `brainyDataInterface` in `src/types/brainyDataInterface.ts` to include the new `findSimilar` method definition. ### Purpose: Added the `findSimilar` method to enhance entity retrieval capabilities by enabling similarity-based searches. This feature improves data exploration and provides a flexible API for building advanced search and recommendation functionalities.
This commit is contained in:
parent
e8ac0cab06
commit
c13e124c71
2 changed files with 46 additions and 0 deletions
|
|
@ -44,4 +44,12 @@ export interface BrainyDataInterface<T = unknown> {
|
|||
* @returns The ID of the created relationship
|
||||
*/
|
||||
relate(sourceId: string, targetId: string, relationType: string, metadata?: unknown): Promise<string>
|
||||
|
||||
/**
|
||||
* Find entities similar to a given entity ID
|
||||
* @param id ID of the entity to find similar entities for
|
||||
* @param options Additional options
|
||||
* @returns Array of search results with similarity scores
|
||||
*/
|
||||
findSimilar(id: string, options?: { limit?: number }): Promise<unknown[]>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue