Package dyntabs.ai

Class EasyIndexer

java.lang.Object
dyntabs.ai.EasyIndexer

public class EasyIndexer extends Object
The write side of EasyAI RAG: takes documents and persists their embeddings into a vector store, so an assistant can retrieve them later.

Analogy: if an @EasyAIAssistant that reads from a store is the "reader", EasyIndexer is the "librarian who shelves the books." You hand it raw documents (paths, byte arrays, or plain text); it parses, splits, embeds, and files them away in Milvus under the collection chosen via IndexerBuilder.toMilvus(java.lang.String, int, java.lang.String). One call replaces the parse → split → embed → batch-insert boilerplate you'd otherwise write against the raw Milvus client.

You don't construct this directly — it comes from EasyAI.indexer():


 // Index files on disk / classpath
 int n = EasyAI.indexer()
               .toMilvus("localhost", 19530, "documents")
               .index("file:/data/policy.pdf", "classpath:faq.txt");

 // Index bytes pulled from a DMS or DB BLOB
 byte[] pdf = dms.download("DOC-1");
 EasyAI.indexer()
       .toMilvus()                                   // settings from easyai.properties
       .index(DocumentSource.of("policy.pdf", pdf));
 
See Also:
  • Method Details

    • index

      public int index(String... sources)
      Indexes documents identified by path strings (classpath, file system, or relative).

      Terminal step of the EasyAI.indexer().toMilvus(...).index(...) chain. Delegates loading to RagEngine.loadDocuments(String[]) and persistence to MilvusEngine.ingest(List, MilvusConfig).

      Parameters:
      sources - one or more paths, each optionally prefixed classpath: or file:
      Returns:
      the number of documents successfully ingested
    • index

      public int index(DocumentSource... sources)
      Indexes in-memory documents (byte arrays) — for content from a DMS, database BLOB, REST API, or user upload.

      Terminal step of the indexer chain. Delegates parsing to RagEngine.parseDocumentSources(List) and persistence to MilvusEngine.ingest(List, MilvusConfig).

      Parameters:
      sources - one or more DocumentSources carrying file name + bytes
      Returns:
      the number of documents successfully ingested
    • index

      public int index(List<DocumentSource> sources)
      Indexes a list of in-memory documents (byte arrays). Same behaviour as index(DocumentSource...), for when you already hold a List.
      Parameters:
      sources - the documents to ingest
      Returns:
      the number of documents successfully ingested