smart-entities

1.0.1 • Public • Published

Smart Entities

Smart Entities is a module that provides classes for managing content with embeddings. It was designed to be used with markdown files for the Smart Connections Obsidian plugin, but is easily extendable to other file types.

Usage

npm install smart-entities

Classes

SmartEntities

The base class for managing collections of smart entities. It provides methods for:

  • loading the entities from storage
  • saving the entities to storage
  • embedding the entities using a language model

SmartEntity

The base class representing an individual smart entity. It provides properties and methods for managing the entity's data, including:

  • the entity's file path
  • the entity's embedding vector
  • the number of tokens in the entity's content

SmartNotes

A subclass of SmartEntities for managing a collection of smart notes. It adds methods for:

  • importing notes into the collection
  • ensuring embeddings exist for all notes
  • pruning notes that no longer exist

SmartNote

A subclass of SmartEntity representing an individual smart note. It provides properties and methods for working with a note's data, such as:

  • the note's content
  • the note's edit history
  • the blocks contained within the note

SmartBlocks

A subclass of SmartEntities for managing a collection of smart blocks. It adds methods for:

  • importing blocks into the collection
  • pruning blocks that no longer exist

SmartBlock

A subclass of SmartEntity representing an individual smart block. It provides properties and methods for working with a block's data, including:

  • the block's text content
  • the note containing the block
  • the next sequential block in the note

Readme

Keywords

Package Sidebar

Install

npm i smart-entities

Homepage

jsbrains.org

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

29.4 kB

Total Files

3

Last publish

Collaborators

  • wfhbrian