{
  "name": "com.l1fe.forge:forge-embed",
  "language": "kotlin",
  "version": "0.1.0",
  "description": "Kotlin/JVM forge-embed module.",
  "manifest": "forge-kt/forge-embed/build.gradle.kts",
  "manifestSha256": "9a22b37276939ccd154f2971c677adc84aa2e87503cc613d6cc78d3de774500a",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/kotlin/forge-embed",
  "features": {},
  "files": [
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Chunking.kt",
      "sha256": "34c12f426c23b230f05843a3857a994ccc7c868ed7e1c14579af2dc16c790bc4",
      "artifactSha256": "8eca95c0f22dcb030a413a87b68498f6474da85cc33104e48a541cc91dd5f74d",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Chunking.kt.txt",
      "declarations": [
        {
          "name": "public data class TextChunk(",
          "line": 19,
          "signature": "public data class TextChunk(\nval text: String,\nval index: Int,\nval startOffset: Int,\n)\n\n/**\n* Interface for text splitting strategies.\n*\n* ANVIL Spec Section 9.5\n*/\npublic interface TextSplitter",
          "documentation": ""
        },
        {
          "name": "public interface TextSplitter",
          "line": 30,
          "signature": "public interface TextSplitter",
          "documentation": ""
        },
        {
          "name": "public fun split(text: String): List<TextChunk>",
          "line": 38,
          "signature": "public fun split(text: String): List<TextChunk>\n}\n\n/**\n* A recursive character text splitter.\n*\n* Splits text by trying separators in order: double newline, single newline,\n* sentence-ending punctuation, space, and finally individual characters.\n* Each chunk has a configurable overlap with the previous chunk.\n*\n* @property chunkSize The target maximum chunk size in characters.\n* @property chunkOverlap The number of characters to overlap between chunks.\n* @property separators The list of separators to try, in order.\n*/\npublic class RecursiveCharacterSplitter(\npublic val chunkSize: Int;",
          "documentation": ""
        },
        {
          "name": "public class RecursiveCharacterSplitter(",
          "line": 52,
          "signature": "public class RecursiveCharacterSplitter(\npublic val chunkSize: Int;",
          "documentation": ""
        },
        {
          "name": "public val chunkSize: Int;",
          "line": 53,
          "signature": "public val chunkSize: Int;",
          "documentation": ""
        },
        {
          "name": "public val chunkOverlap: Int;",
          "line": 54,
          "signature": "public val chunkOverlap: Int;",
          "documentation": ""
        },
        {
          "name": "public val separators: List<String>;",
          "line": 55,
          "signature": "public val separators: List<String>;",
          "documentation": ""
        },
        {
          "name": "public val DEFAULT_SEPARATORS: List<String>;",
          "line": 106,
          "signature": "public val DEFAULT_SEPARATORS: List<String>;",
          "documentation": ""
        },
        {
          "name": "public class TokenSplitter(",
          "line": 129,
          "signature": "public class TokenSplitter(\npublic val maxTokens: Int;",
          "documentation": ""
        },
        {
          "name": "public val maxTokens: Int;",
          "line": 130,
          "signature": "public val maxTokens: Int;",
          "documentation": ""
        },
        {
          "name": "public val tokenOverlap: Int;",
          "line": 131,
          "signature": "public val tokenOverlap: Int;",
          "documentation": ""
        },
        {
          "name": "public val charsPerToken: Int;",
          "line": 132,
          "signature": "public val charsPerToken: Int;",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Document.kt",
      "sha256": "b7dd0b581bc8592841112e289a50f8aacd50f132b293fcdd5922d8d66bc74e91",
      "artifactSha256": "bd42db1f81f55483333692e31b544b71bae54d7691c82221633ba8a5064295a2",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Document.kt.txt",
      "declarations": [
        {
          "name": "public data class Document(",
          "line": 26,
          "signature": "public data class Document(\nval id: String,\nval content: String,\nval metadata: Map<String, String>;",
          "documentation": ""
        },
        {
          "name": "public interface DocumentLoader",
          "line": 38,
          "signature": "public interface DocumentLoader",
          "documentation": ""
        },
        {
          "name": "public suspend fun load(): List<Document>",
          "line": 46,
          "signature": "public suspend fun load(): List<Document>\n}\n\n/**\n* A document loader that loads from raw text content.\n*\n* @property id The document ID.\n* @property text The raw text content.\n* @property metadata Optional metadata.\n* @property source Optional source identifier.\n*/\npublic class TextLoader(\nprivate val id: String,\nprivate val text: String,\nprivate val metadata: Map<String, String>;",
          "documentation": ""
        },
        {
          "name": "public class TextLoader(",
          "line": 57,
          "signature": "public class TextLoader(\nprivate val id: String,\nprivate val text: String,\nprivate val metadata: Map<String, String>;",
          "documentation": ""
        },
        {
          "name": "public class JsonLoader(",
          "line": 86,
          "signature": "public class JsonLoader(\nprivate val jsonString: String,\nprivate val contentField: String;",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Embed.kt",
      "sha256": "fb8d0091f80061fdcc5e9a49f360a53d4aa8c86c8923300a349f6fbc1e9572cb",
      "artifactSha256": "378de77dd18d239b9f4d4203b8c6c36088020b3cd0726a53a9f1a6f1c6e787b0",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Embed.kt.txt",
      "declarations": [
        {
          "name": "public data class EmbeddingResult(",
          "line": 22,
          "signature": "public data class EmbeddingResult(\nval embedding: List<Float>,\nval dimensions: Int,\nval model: String?;",
          "documentation": ""
        },
        {
          "name": "public data class BatchEmbeddingResult(",
          "line": 42,
          "signature": "public data class BatchEmbeddingResult(\nval embeddings: List<EmbeddingResult>,\nval model: String?;",
          "documentation": ""
        },
        {
          "name": "public data class EmbedOptions(",
          "line": 56,
          "signature": "public data class EmbedOptions(\nval model: String?;",
          "documentation": ""
        },
        {
          "name": "public interface EmbeddingProvider",
          "line": 70,
          "signature": "public interface EmbeddingProvider",
          "documentation": ""
        },
        {
          "name": "public suspend fun embed(text: String, options: EmbedOptions;",
          "line": 80,
          "signature": "public suspend fun embed(text: String, options: EmbedOptions;",
          "documentation": ""
        },
        {
          "name": "public suspend fun embedMany(",
          "line": 90,
          "signature": "public suspend fun embedMany(\ntexts: List<String>,\noptions: EmbedOptions;",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/EmbedError.kt",
      "sha256": "e355460aa9b1ede97ba6c56e9574c67096dbb78d1da93118424df6a66cc4c550",
      "artifactSha256": "003b58f4fcf7ebf08a017246d5808798a2cf2b9f1f982030a72977ea8ce92718",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/EmbedError.kt.txt",
      "declarations": [
        {
          "name": "public sealed class ForgeEmbedError(",
          "line": 14,
          "signature": "public sealed class ForgeEmbedError(\nmessage: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public class ProviderError(",
          "line": 25,
          "signature": "public class ProviderError(\npublic val provider: String,\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val provider: String,",
          "line": 26,
          "signature": "public val provider: String,\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val reason: String,",
          "line": 27,
          "signature": "public val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public class DimensionMismatch(",
          "line": 38,
          "signature": "public class DimensionMismatch(\npublic val expected: Int,\npublic val actual: Int,\npublic val operation: String,\n) : ForgeEmbedError(\n\"vector dimension mismatch in $operation: expected $expected, got $actual\"\n)\n\n/**\n* A vector store entry was not found.\n*\n* @property id The entry ID that was not found.\n*/\npublic class EntryNotFound(\npublic val id: String,\n) : ForgeEmbedError(\"vector store entry '$id' not found\")\n\n/**\n* The reranker returned an error.\n*\n* @property reason The failure reason.\n*/\npublic class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val expected: Int,",
          "line": 39,
          "signature": "public val expected: Int,\npublic val actual: Int,\npublic val operation: String,\n) : ForgeEmbedError(\n\"vector dimension mismatch in $operation: expected $expected, got $actual\"\n)\n\n/**\n* A vector store entry was not found.\n*\n* @property id The entry ID that was not found.\n*/\npublic class EntryNotFound(\npublic val id: String,\n) : ForgeEmbedError(\"vector store entry '$id' not found\")\n\n/**\n* The reranker returned an error.\n*\n* @property reason The failure reason.\n*/\npublic class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val actual: Int,",
          "line": 40,
          "signature": "public val actual: Int,\npublic val operation: String,\n) : ForgeEmbedError(\n\"vector dimension mismatch in $operation: expected $expected, got $actual\"\n)\n\n/**\n* A vector store entry was not found.\n*\n* @property id The entry ID that was not found.\n*/\npublic class EntryNotFound(\npublic val id: String,\n) : ForgeEmbedError(\"vector store entry '$id' not found\")\n\n/**\n* The reranker returned an error.\n*\n* @property reason The failure reason.\n*/\npublic class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val operation: String,",
          "line": 41,
          "signature": "public val operation: String,\n) : ForgeEmbedError(\n\"vector dimension mismatch in $operation: expected $expected, got $actual\"\n)\n\n/**\n* A vector store entry was not found.\n*\n* @property id The entry ID that was not found.\n*/\npublic class EntryNotFound(\npublic val id: String,\n) : ForgeEmbedError(\"vector store entry '$id' not found\")\n\n/**\n* The reranker returned an error.\n*\n* @property reason The failure reason.\n*/\npublic class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public class EntryNotFound(",
          "line": 51,
          "signature": "public class EntryNotFound(\npublic val id: String,\n) : ForgeEmbedError(\"vector store entry '$id' not found\")\n\n/**\n* The reranker returned an error.\n*\n* @property reason The failure reason.\n*/\npublic class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val id: String,",
          "line": 52,
          "signature": "public val id: String,\n) : ForgeEmbedError(\"vector store entry '$id' not found\")\n\n/**\n* The reranker returned an error.\n*\n* @property reason The failure reason.\n*/\npublic class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public class RerankError(",
          "line": 60,
          "signature": "public class RerankError(\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val reason: String,",
          "line": 61,
          "signature": "public val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public class ChunkingError(",
          "line": 70,
          "signature": "public class ChunkingError(\npublic val reason: String,\n) : ForgeEmbedError(\"chunking failed: $reason\")\n\n/**\n* Document loading failed.\n*\n* @property source The source that failed to load.\n* @property reason The failure reason.\n*/\npublic class DocumentLoadError(\npublic val source: String,\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val reason: String,",
          "line": 71,
          "signature": "public val reason: String,\n) : ForgeEmbedError(\"chunking failed: $reason\")\n\n/**\n* Document loading failed.\n*\n* @property source The source that failed to load.\n* @property reason The failure reason.\n*/\npublic class DocumentLoadError(\npublic val source: String,\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public class DocumentLoadError(",
          "line": 80,
          "signature": "public class DocumentLoadError(\npublic val source: String,\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val source: String,",
          "line": 81,
          "signature": "public val source: String,\npublic val reason: String,\ncause: Throwable?;",
          "documentation": ""
        },
        {
          "name": "public val reason: String,",
          "line": 82,
          "signature": "public val reason: String,\ncause: Throwable?;",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Rerank.kt",
      "sha256": "e5984c8d6d64a3c436dbe74a2295c2b003497fa9d4c465e1c0f58b2ad09d0359",
      "artifactSha256": "f46f061523cf8c17a4c18e078516ebb571e2f46929d61d58ce2a967f2535cf7d",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Rerank.kt.txt",
      "declarations": [
        {
          "name": "public data class RerankResult(",
          "line": 22,
          "signature": "public data class RerankResult(\nval index: Int,\nval score: Double,\nval document: String,\n)\n\n/**\n* The output of a reranking operation.\n*\n* @property results The reranked documents, ordered by relevance (highest first).\n* @property model The reranker model used (if available).\n*/\n@Serializable\npublic data class RerankOutput(\nval results: List<RerankResult>,\nval model: String?;",
          "documentation": ""
        },
        {
          "name": "public data class RerankOutput(",
          "line": 35,
          "signature": "public data class RerankOutput(\nval results: List<RerankResult>,\nval model: String?;",
          "documentation": ""
        },
        {
          "name": "public data class RerankOptions(",
          "line": 47,
          "signature": "public data class RerankOptions(\nval model: String?;",
          "documentation": ""
        },
        {
          "name": "public interface Reranker",
          "line": 58,
          "signature": "public interface Reranker",
          "documentation": ""
        },
        {
          "name": "public suspend fun rerank(",
          "line": 69,
          "signature": "public suspend fun rerank(\nquery: String,\ndocuments: List<String>,\noptions: RerankOptions;",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Similarity.kt",
      "sha256": "06bac6998295e7b40324ffcefebf015ba7784d852ac831f75c8c9d28e5a8ec45",
      "artifactSha256": "812af7bfe97a40e32dc597fb8a7af0b9d12b9c46dab8a97b8dd58898b2b1388a",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/Similarity.kt.txt",
      "declarations": [
        {
          "name": "public fun cosineSimilarity(a: List<Float>, b: List<Float>): Double",
          "line": 26,
          "signature": "public fun cosineSimilarity(a: List<Float>, b: List<Float>): Double",
          "documentation": ""
        },
        {
          "name": "public fun euclideanDistance(a: List<Float>, b: List<Float>): Double",
          "line": 56,
          "signature": "public fun euclideanDistance(a: List<Float>, b: List<Float>): Double",
          "documentation": ""
        },
        {
          "name": "public fun dotProduct(a: List<Float>, b: List<Float>): Double",
          "line": 75,
          "signature": "public fun dotProduct(a: List<Float>, b: List<Float>): Double",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/VectorStore.kt",
      "sha256": "375f5b4d4f27ffeb7a1daf80e2875a85aa1736571cfd0b562a3b857276b92369",
      "artifactSha256": "a374eca4566b7e6f57bfbfb528cb1988596ad95dba5e7dee045d1e4b73ad4873",
      "url": "/reference/source/forge-kt/forge-embed/src/main/kotlin/com/l1fe/forge/embed/VectorStore.kt.txt",
      "declarations": [
        {
          "name": "public data class VectorEntry(",
          "line": 23,
          "signature": "public data class VectorEntry(\nval id: String,\nval embedding: List<Float>,\nval content: String,\nval metadata: Map<String, String>;",
          "documentation": ""
        },
        {
          "name": "public data class SearchResult(",
          "line": 37,
          "signature": "public data class SearchResult(\nval entry: VectorEntry,\nval score: Double,\n)\n\n/**\n* Options for vector store search.\n*\n* @property topK The maximum number of results to return.\n* @property minScore The minimum similarity score threshold.\n* @property metadataFilter Optional metadata key-value pairs to filter by.\n*/\n@Serializable\npublic data class SearchOptions(\nval topK: Int;",
          "documentation": ""
        },
        {
          "name": "public data class SearchOptions(",
          "line": 50,
          "signature": "public data class SearchOptions(\nval topK: Int;",
          "documentation": ""
        },
        {
          "name": "public interface VectorStore",
          "line": 63,
          "signature": "public interface VectorStore",
          "documentation": ""
        },
        {
          "name": "public suspend fun upsert(entry: VectorEntry)",
          "line": 70,
          "signature": "public suspend fun upsert(entry: VectorEntry)\n\n/**\n* Insert or update multiple entries in a batch.\n*\n* @param entries The entries to upsert.\n*/\npublic suspend fun upsertMany(entries: List<VectorEntry>)\n\n/**\n* Retrieve an entry by its ID.\n*\n* @param id The entry ID.\n* @return The entry, or `null` if not found.\n*/\npublic suspend fun get(id: String): VectorEntry?\n\n/**\n* Delete an entry by its ID.\n*\n* @param id The entry ID.\n* @return `true` if the entry was deleted, `false` if not found.\n*/\npublic suspend fun delete(id: String): Boolean\n\n/**",
          "documentation": ""
        },
        {
          "name": "public suspend fun upsertMany(entries: List<VectorEntry>)",
          "line": 77,
          "signature": "public suspend fun upsertMany(entries: List<VectorEntry>)\n\n/**\n* Retrieve an entry by its ID.\n*\n* @param id The entry ID.\n* @return The entry, or `null` if not found.\n*/\npublic suspend fun get(id: String): VectorEntry?\n\n/**\n* Delete an entry by its ID.\n*\n* @param id The entry ID.\n* @return `true` if the entry was deleted, `false` if not found.\n*/\npublic suspend fun delete(id: String): Boolean\n\n/**\n* Search for entries similar to the given query vector.\n*\n* @param query The query embedding vector.\n* @param options Search options (top-K, min score, filters).\n* @return The list of search results, ordered by similarity (highest first).\n*/\npublic suspend fun search(query: List<Float>, options: SearchOptions;",
          "documentation": ""
        },
        {
          "name": "public suspend fun get(id: String): VectorEntry?",
          "line": 85,
          "signature": "public suspend fun get(id: String): VectorEntry?\n\n/**\n* Delete an entry by its ID.\n*\n* @param id The entry ID.\n* @return `true` if the entry was deleted, `false` if not found.\n*/\npublic suspend fun delete(id: String): Boolean\n\n/**\n* Search for entries similar to the given query vector.\n*\n* @param query The query embedding vector.\n* @param options Search options (top-K, min score, filters).\n* @return The list of search results, ordered by similarity (highest first).\n*/\npublic suspend fun search(query: List<Float>, options: SearchOptions;",
          "documentation": ""
        },
        {
          "name": "public suspend fun delete(id: String): Boolean",
          "line": 93,
          "signature": "public suspend fun delete(id: String): Boolean\n\n/**\n* Search for entries similar to the given query vector.\n*\n* @param query The query embedding vector.\n* @param options Search options (top-K, min score, filters).\n* @return The list of search results, ordered by similarity (highest first).\n*/\npublic suspend fun search(query: List<Float>, options: SearchOptions;",
          "documentation": ""
        },
        {
          "name": "public suspend fun search(query: List<Float>, options: SearchOptions;",
          "line": 102,
          "signature": "public suspend fun search(query: List<Float>, options: SearchOptions;",
          "documentation": ""
        },
        {
          "name": "public suspend fun size(): Int",
          "line": 107,
          "signature": "public suspend fun size(): Int\n}\n\n/**\n* An in-memory vector store using cosine similarity.\n*\n* Thread-safe. Suitable for development, testing, and small datasets.\n* Production workloads should use a dedicated vector database.\n*\n* ANVIL Spec Section 9.4\n*/\npublic class InMemoryVectorStore : VectorStore",
          "documentation": ""
        },
        {
          "name": "public class InMemoryVectorStore : VectorStore",
          "line": 118,
          "signature": "public class InMemoryVectorStore : VectorStore",
          "documentation": ""
        },
        {
          "name": "public fun clear()",
          "line": 164,
          "signature": "public fun clear()",
          "documentation": ""
        }
      ]
    }
  ]
}
