Class FileIndex

java.lang.Object
ai.redouble.demo.extract.FileIndex

public class FileIndex extends Object
The rudimentary index: every extracted text with its vector, in memory, searched by cosine. What a deployment replaces with pgvector or any vector store; the shape a search needs is all that is here. Vectors are comparable only with vectors from the model that produced them, so the index records its model and refuses a query embedded by another. The index is also what the extraction leaves behind for the next workflow: every document's whole text, by path, which the pricing demo reads.
Since:
0.1 (2026-09-14)
Author:
Andrey Santrosyan
  • Field Details

    • INDEXED_CHARS

      public static final int INDEXED_CHARS
      How much of a text is embedded: the head, which is what a search question is usually about. The whole text is kept.
      See Also:
  • Constructor Details

    • FileIndex

      public FileIndex()
  • Method Details

    • put

      public void put(String path, String text, Embedding embedding)
    • size

      public int size()
    • texts

      public Map<String,String> texts()
      Every indexed document's whole text by path, in path order: what a workflow over the extraction reads.
    • getModelId

      public String getModelId()
    • clear

      public void clear()
    • search

      public List<FileIndex.Hit> search(Embedding query, int k)
      The closest entries to a query vector, best first.