FsColbert 0.9.3.16
See the version list below for details.
dotnet add package FsColbert --version 0.9.3.16
NuGet\Install-Package FsColbert -Version 0.9.3.16
<PackageReference Include="FsColbert" Version="0.9.3.16" />
<PackageVersion Include="FsColbert" Version="0.9.3.16" />
<PackageReference Include="FsColbert" />
paket add FsColbert --version 0.9.3.16
#r "nuget: FsColbert, 0.9.3.16"
#:package FsColbert@0.9.3.16
#addin nuget:?package=FsColbert&version=0.9.3.16
#tool nuget:?package=FsColbert&version=0.9.3.16
FsColbert
FsColbert is a small F#/.NET library for mobile-friendly ColBERT-style retrieval. It is built for later use from a .NET MAUI app such as FsKame.
The first implementation uses:
lightonai/mxbai-edge-colbert-v0-32m-onnxINT8 ONNX model- Hugging Face byte-level BPE tokenization via
Microsoft.ML.Tokenizers - ONNX Runtime inference via
Microsoft.ML.OnnxRuntime - ColBERT late-interaction MaxSim scoring
- FsKame-like text chunking defaults: 1800 characters with 250 overlap
- TF-IDF inverted-index candidate prefiltering before dense scoring
- binary persistence for local on-device indexes
Basic Flow
open System.Net.Http
open FsColbert
async {
use http = new HttpClient()
let! files =
ModelCatalog.ensureDownloadedAsync
http
"/path/to/appdata/FsColbert/Models/mxbai-edge-colbert"
ModelCatalog.mxbaiEdgeColbertInt8
use encoder = OnnxColbertEncoder.Load files
let source =
SourceDocuments.fromFsKamePdf
"pdf-id"
"Handbook.pdf"
"/path/to/Handbook.pdf"
"PDF text extracted by FsKame/PdfPig"
true
let! index =
IndexBuilder.createWithDefaults
encoder
[ source ]
(Some(fun progress -> printfn "%A" progress))
let! hits =
Search.queryWithDefaults
encoder
index
"What does the handbook say about local indexing?"
let context = SearchHits.renderContext 900 hits
return context
}
FsKame Integration Notes
FsKame already has the right lifecycle:
PdfLibrarycopies PDFs into app data.KnowledgeSources.readPdfTextextracts text with PdfPig.SourceAgentloads chunks and ranks them for each final transcript.
The clean integration path is to keep FsKame's PDF extraction, then replace KnowledgeSources.loadChunks / KnowledgeSources.rank with an FsColbert-backed state:
- Map each selected
PdfDocumentSourcetoSourceDocument. - Build or load a persisted
ColbertIndexwhen sources change. - On transcript finalization, call
Search.queryWithDefaults. - Map
SearchHit.referenceback into FsKame's existingSourceChunkrecord forOracleAgent.
The library intentionally does not reference FsKame, MAUI UI types, or PdfPig. That keeps it portable across Android, iOS, Mac Catalyst, and test projects.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- F23.StringSimilarity (>= 7.0.1)
- FSharp.Control.AsyncSeq (>= 4.15.0)
- FSharp.Core (>= 10.1.203)
- FSharp.DI (>= 1.0.0)
- Microsoft.ML.OnnxRuntime (>= 1.25.1)
- Microsoft.ML.Tokenizers (>= 2.0.0)
- PdfPig (>= 0.1.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.