Production-Grade Telemetry for Domain-Aware Agent Systems in .NET (Aspire + OpenTelemetry)

Modern agent-based systems tend to fail in subtle ways.

Not with crashes — but with drift:

  • the “right” document slowly stops being selected,
  • a heuristic fires twice,
  • a preference rule silently stops applying,
  • a language fallback kicks in without anyone noticing.

When this happens in production, logs alone are not enough.
You need structured, stable telemetry that tells you what decision was made, why, and whether it actually mattered.

In this post, I’ll walk through how we hardened telemetry for a domain-aware agent pipeline in .NET using OpenTelemetry + Aspire, focusing on:

  • Deterministic tracing contracts
  • Low-cardinality metrics
  • Drift detection without log spam
  • Developer-friendly local visibility (F5 / dotnet run)

All examples are domain-agnostic and apply to any policy-driven RAG or agent system.


The Problem: “Invisible” Correctness Bugs

In agent systems, many critical behaviors are intentional and non-fatal:

  • a domain preference boosts one document over another,
  • a language fallback is applied,
  • a keyword search is skipped to avoid cross-language drift,
  • a rule matches but is evidence-gated and does nothing.

From the outside, the answer may still look “reasonable”.

Without telemetry, you can’t tell:

  • whether a rule fired,
  • whether it mutated ranking,
  • whether it was blocked by missing evidence,
  • whether it ran once or twice.

So we defined a rule early on:

Every deterministic decision must be observable, cheaply, and in a stable shape.

Continue reading “Production-Grade Telemetry for Domain-Aware Agent Systems in .NET (Aspire + OpenTelemetry)”

Designing Language-Safe AI Systems: Deterministic Guardrails for Multilingual Enterprise AI

Large Language Models are exceptionally good at producing fluent text.
They are not inherently good at knowing when not to answer.

In regulated or compliance-sensitive environments, this distinction is critical.
A linguistically plausible answer that is not grounded in official documentation is often worse than no answer at all.

This article describes a practical architecture for handling language detection, translation intent, and multilingual retrieval in an enterprise AI system — with a strong emphasis on determinism, evidence-first behavior, and hallucination prevention.

The examples are intentionally domain-neutral, but the patterns apply to legal, regulatory, financial, and policy-driven systems.


The Core Problem

Consider these seemingly simple user questions:

"What is E104?"
"Slovenski prevod za E104?"
"Hrvatski prevod za E104?"
"Kaj je E104 v slovaščini?"
"Slovenski prevod za Curcumin?"

At first glance, these look like:

  • definitions
  • translations
  • or simple multilingual queries

A naïve LLM-only approach will happily generate answers for all of them.

But in a regulated environment, each of these questions carries a different risk profile:

  • Some require retrieval
  • Some require translation
  • Some require terminology resolution
  • Some should result in a deterministic refusal

The challenge is not generating text —
it is deciding which answers are allowed to exist.


Key Design Principle: Evidence Before Language

The system described here follows one non-negotiable rule:

Language is applied after evidence is proven, never before.

This means:

  • Language preference never expands the answer space
  • Translation never invents facts
  • Missing official wording is explicitly acknowledged

Continue reading “Designing Language-Safe AI Systems: Deterministic Guardrails for Multilingual Enterprise AI”

Custom SharePoint Survey Template with Multi-Language Support

Today I want to show you how you could create Custom SharePoint Survey Template from default SharePoint Survey Template with TemplateType=”102″.

Let’s imagine that we want to create custom SharePoint Survery Template for Quick Poll. We want to allow just one question with one type of answers – Radio Buttons. And we want to have multi-language UI where Survey Admin could define question and answers in two language (English – EN and Slovenian – SI) as you can see in featured image above. Continue reading “Custom SharePoint Survey Template with Multi-Language Support”

MS Graph and SPFx [Global Office 365 Dev Bootcamp Session]

Today I want to share with you my presentation and demo examples from my session at Global Office 365 Developer Bootcamp @ Ljubljana, Slovenia last Saturday.

I talked about Microsoft Graph globally and how to connect to MS Graph from SPFx deeply. At the end I showed how could we connect to MS Graph from other platforms like Microsoft Flow or C# code as Outlook Add-In.

In six demo examples you could see how to retrieve User informations from Microsoft Graph, how to use Microsoft Graph TypeScript Types, how to retrieve Mail and Calendar informations, how to Send Email via Graph, how to read user Tasks from Planner and how to read specific Site and Content Types informations from SharePoint or how to Upload File to SharePoint from SPFx Web Part via Graph API.

Continue reading “MS Graph and SPFx [Global Office 365 Dev Bootcamp Session]”

SPFx – Office UI Fabric React – TagPicker – Item Limit

Inside Office UI Fabric React you could find TagPicker. For example, you could use it for country picker. In this scenario you would like to allow single selection mode on it.

In a correlation with office-ui-fabric-react fix #1304 they added property itemLimit on the basePicker and logic to not render the autofill “input” if the itemLimit is defined and equal to internal item count.

But inside last SPFx Yeoman Web Part template there is not yet this fix included in sp-office-ui-fabric-core, so you have to implement it by yourself. In example below I want to share with you my solution for this problem. Continue reading “SPFx – Office UI Fabric React – TagPicker – Item Limit”

Better Trainer

From the middle of November I was a bit more busy with projects @ work so in that time I simply have no time to write any new post, but I have learned a lot, so now I have a lot more material in my head for my blog 🙂

In that months me and my coworker and MVP for any kind of tables – Gašper Kamenšek @ExcelUnplugged – prepared something special for Thrive conference #ThriveConf @ Rimske Terme in November.

Topic of our session talks about how to become better trainer. The idea was to use face detection with emotional scores to see how visitors react and feel in session time. Because feeling is in a correlation with spoken words we use speach recognition. We can connect emotions from faces and words from speach within specific time interval -> so we need to add timestamp to both information. We use Bing Speech API for English language recognition and Google Speech API for Slovenian language recognition.

Because we get from speech recognition API complete sentence, we want to remove some unnecessary words like is, an, the, you etc from it. I use Standford Parser for that purpose – natural language parser that works out the grammatical structure of sentence.

In the end all go to Gašper Kamenšek’s part of project -> to Power BI for visualization and Azure Machine Learning (AML) for powerful analytics of correlation between women and man responses in hapiness for specific words. But that post include just my part of project which is coding (WPF application). Continue reading “Better Trainer”

Console.Clear();

Vsak konec je začetek nečesa novega.

Moj zadnji blog post je iz davnega pričetka leta 2012, od takrat naprej pa je vse potihnilo, zamrlo. Splet je poln bedarij in dobrih stvari, zakaj ne bi košček tega nastajal tudi tukaj. Seveda tema odloča o temu, kam posameznik uvršča moj blog, tako ali drugače pa bo spletu dodal svoj košček.

Rdeča nit je enaka kot pred petimi leti – development na dolgo in široko. Področja pa vse od moje začetne “dev” ljubezni SharePoint, pa vse do Office 365, Azure, Mobile, IoT in vsega ostalega, kar pride na pamet.

Najprej bom za nazaj zapolnil blog s članki, ki sem jih že spisal za revijo Pika, potem pa štartam od tu naprej 🙂

Lep pozdrav!
Gašper Rupnik

{End.}

 

Website Powered by WordPress.com.

Up ↑