Important
R&D Concept & Research Prototype. Instancium Lens is published as an open-source reference architecture and working prototype demonstrating local-first document indexing and citation-grounded verification on Instancium.Vectra and InstantAIGate. It is not packaged for general production use. Production hardening, enterprise document pipelines (PDF, DOCX), corporate IAM/RBAC integration, and domain-specific accuracy tuning are scoped exclusively through enterprise design partnerships.
Local-first AI workspace for document understanding, built on Instancium.Vectra
and the official InstantAIGate.Client SDK.
Lens indexes documents on-device and answers natural-language questions with numbered citations back to the exact source chunk. No mandatory cloud dependency: retrieval runs in-process (Vectra), inference runs on your machine (InstantAIGate).
For the full reference architecture (Local vs. Corporate topology, access boundaries, and continuity model), see the Instancium Lens Architecture Overview.
- Understand large document collections instead of paging through them.
- Ask questions in natural language and get grounded answers.
- Verify every claim against the original source: traceability is a contract, not a promise.
- Keep confidential data local: documents, index and models never leave the device.
┌─────────────────────────────────────────────────────────────┐
│ Instancium.Lens.App (MAUI + Blazor UI, composition root) │
│ GatewayEmbeddingProvider: Vectra seam <-> gateway SDK │
└──────────────────────────┬──────────────────────────────────┘
│ IndexFolderAsync / AskStreamingAsync
┌─────────┴─────────┐
▼ ▼
┌──────────────────┐ ┌───────────────┐
│ Lens.Ingestion │ │ Lens.Chat │
│ parse→chunk→ │ │ retrieve→ │
│ embed→store │ │ prompt→stream │
└────────┬─────────┘ └──────┬────────┘
▼ ▼
┌───────────────────┐ ┌────────────────────────────────┐
│ Instancium.Vectra │ │ InstantAIGate.Client │
│ local vector │ │ SignalR: embeddings + LLM │
│ store, cosine │ │ streaming, KV-cache policies, │
│ search │ │ checkpointed Map-Reduce │
└───────────────────┘ └────────────────────────────────┘
- Retrieval:
IVectraCollection.SearchTextAsyncover a per-profile collection (Cosine metric). - Inference: the
InstantAIGate.ClientNuGet SDK owns the SignalR transport and gates every operation on gatewayReadystatus.InstantAIGate.Corearrives transitively through the SDK; the solution holds no direct Core reference. - Embeddings: the SDK returns
EmbeddingResponseand stays free of vector-store dependencies. The composition root adapts it to the VectraIEmbeddingProviderseam (Services/GatewayEmbeddingProvider), the only place that knows both contracts. - Sessions:
Gateway:ContextPolicyselectsStateless(default; the session is destroyed after each turn, returning the VRAM slot immediately) orConversational(KV-cache retained until the client is disposed). - Streaming:
IChatService.AskStreamingAsyncreports pipeline stages (Retrieving → Generating) and answer tokens; the UI never sits in an opaque "Thinking…" state. - Citations: every answer carries
[n]markers bound toCitation(Number, Source, ChunkIndex, Text); the UI renders them as collapsible sources.
| Capability | Status |
|---|---|
Recursive indexing of .txt / .md folders |
Implemented (Prototype) |
| Live indexing progress and result summary (files, chunks) | Implemented (Prototype) |
| Per-folder index storage with restart-safe profile binding | Implemented (Prototype) |
| Grounded Q&A with stage visibility and token streaming | Implemented (Prototype) |
| Numbered citations with source path and chunk index | Implemented (Prototype) |
| PDF and Office formats (DOCX, tables, OCR) | Pilot / Extension Seam: via custom IFileParser implementations (not included in the research prototype) |
| Rerank, query rewriting, multi-turn context | Research Scope: the SDK already exposes IChatMapReduceClient and CheckpointedChatContextStrategy as extension seams |
AI Output Verification (Verify Mode) |
Target Research: atomic claim decomposition and closed-world verification of external AI outputs against local Vectra collections |
| Domain-adapted LoRA verifiers | Target Research / Enterprise Pilot: fine-tuning and attaching task- or domain-specific LoRA adapters directly in InstantAIGate |
While large external models excel at broad synthesis and drafting, organizations operating in regulated or high-stakes domains require an independent mechanism to audit AI-generated conclusions against their own ground-truth documentation.
Lens targets this gap by evolving from a document Q&A workspace into a local-first AI Verification Layer:
- Claim Decomposition: An external AI response or draft report is broken down
into atomic, self-contained factual claims using
IChatMapReduceClient. - Closed-World Evidence Retrieval: Each claim is queried independently against
the local
Instancium.Vectracollection under theStatelesscontext policy, preventing cross-turn contamination. - Strict Ground-Truth Auditing: A compact or LoRA-adapted local model via
InstantAIGateevaluates each claim exclusively against the retrieved passages and assigns a verdict (SUPPORTED,CONTRADICTED,PARTIAL,UNVERIFIED) bound to exactCitation(Number, Source, ChunkIndex, Text)records.
Research focus: evaluating verification precision and hallucination-detection
rates of compact fine-tuned local models (2B–8B quantized with domain- or
task-specific LoRA adapters attached via InstantAIGate) when auditing outputs
from frontier models across corporate policies, technical specifications, and
contracts.
The index lives next to the documents: <selected root>/.instancium
(configurable via Vectra:IndexFolderName).
Profiles never bound to a folder fall back to the default root
<AppData>/lens-vectra (configurable via Vectra:BaseDirectory).
The profile id is the Vectra collection name; the profile → root binding persists across restarts, so chat resolves the same index after relaunch.
Enterprise mode (remote Vectra) is a configuration-driven switch of IVectraEngine;
business logic (IngestionService, ChatService) stays unchanged.
Prerequisites:
- Windows 10 1809+ (build 17763); the app targets
net10.0-windows10.0.19041.0. - .NET 10 SDK with the MAUI workload:
dotnet workload install maui. - A running InstantAIGate instance with
qwen3-embedding-0.6b(1024 dimensions) and a chat model loaded; gateway status must beReady.
Run:
- Provide the gateway key via the environment variable
Gateway__ApiKey(the bundledappsettings.jsoncarries a placeholder; real keys never enter the repository). dotnet build InstanciumLens.slnx, then run theInstancium.Lens.Appproject.- In the app: pick a folder → Index → switch to Chat → ask a question.
Test:
dotnet test InstanciumLens.slnx runs the xUnit v3 suites for Core and Chat.
Bundled Resources/Raw/appsettings.json, overridable by environment variables:
| Key | Default | Meaning |
|---|---|---|
Gateway:BaseUrl |
http://localhost:5000 |
InstantAIGate base URL |
Gateway:HubPath |
/hub/gateway |
SignalR hub path |
Gateway:ApiKey |
placeholder | Auth key; override via Gateway__ApiKey |
Gateway:ClientId |
lens (bundled; SDK default client) |
Session ID prefix for server-side telemetry correlation |
Gateway:EmbeddingRepoId |
qwen3-embedding-0.6b |
Embedding model id; empty lets the gateway auto-resolve, but the Vectra bridge requires an explicit value |
Gateway:LlmRepoId |
empty → primary model | Chat model repository override |
Gateway:ExpectedEmbeddingDimension |
1024 |
Required by the Vectra bridge (synchronous Dimension); validated against the gateway on first embed and on every response |
Gateway:ContextPolicy |
Stateless |
Session retention: Stateless or Conversational |
Gateway:ReconnectDelays |
0/2/5/10/30 s |
SignalR automatic reconnect backoff |
Vectra:BaseDirectory |
empty → AppData | Default index root for unbound profiles |
Vectra:IndexFolderName |
.instancium |
Index subfolder inside the scanned root |
Chat:TopK |
5 |
Context chunks retrieved per question |
Chunking:ChunkSize / Chunking:Overlap |
512 / 50 |
Chunker parameters |
Instancium Lens is maintained as an R&D showcase and a candidate for dedicated corporate deployments. Organizations interested in perimeter integration, custom document ingestion (PDF/DOCX), or domain-adapted LoRA verifiers can review the Lens Architecture Page and Enterprise Design Partnerships.
Copyright (c) 2026 Instancium™ (https://instancium.com). All rights reserved.
Source code: Apache License 2.0 — see LICENSE. Third-party components, models and licenses: THIRD-PARTY-NOTICES.md.
Branding: the Instancium and Instancium Lens names, logos and icon assets
(Resources/AppIcon, Resources/Splash, wwwroot/imgs) are the exclusive property
of Instancium, licensed under CC BY-NC-ND 4.0;
reference use only, no modification, no commercial implication.