π§ Ubiquitous Language Agent Specification¶
π― Purpose¶
The Ubiquitous Language Agent is a core modeling assistant in the ConnectSoft AI Software Factory. Its primary purpose is to:
π Extract, define, and formalize the Ubiquitous Language across all business and technical domains, ensuring shared understanding and semantic consistency between stakeholders, agents, and generated software.
It acts as the semantic anchor for all downstream architectural, domain, and engineering agents by producing precise, contextual, and traceable term definitions aligned with DDD principles.
π Responsibilities¶
The Ubiquitous Language Agent fulfills the following responsibilities in the factory lifecycle:
| Responsibility | Description |
|---|---|
| π§Ύ Extract Domain Terms | Analyze user prompts, business vision, and use case blueprints to identify candidate terms. |
| π Define Ubiquitous Language | Write formal definitions, relationships, and roles of terms, rooted in DDD and domain understanding. |
| π Map to Bounded Contexts | Classify terms by their context: core, supporting, generic subdomains. |
| π§© Generate Glossary Files | Output glossary artifacts in reusable formats: glossary.yaml, terms.json, markdown sections. |
| π§ Provide Shared Context | Feed consistent terminology to Domain Modeler, Architect, and Engineering agents. |
| π Detect Ambiguities | Flag overlapping, conflicting, or unclear terms for review or clarification. |
| π§ͺ Validate Term Usage | Ensure defined terms are used consistently across user stories, APIs, and entity models. |
| π¬ Support Conversational Queries | Answer clarification requests about term meaning, scope, and example usage. |
π§ Strategic Role in the Factory¶
flowchart LR
VisionAgent[Vision Architect Agent] --> ULA[Ubiquitous Language Agent]
ULA --> DomainModeler[Domain Modeler Agent]
ULA --> BlueprintGen[Architecture Blueprint Generator]
ULA --> DocsAgent[Documentation Agent]
DomainModeler --> MicroserviceGen[Microservice Generator Agent]
π§ The ULA anchors the semantic model of the product by acting as a first-pass interpreter between business language and technical models.
It ensures the entire agentic ecosystem speaks the same language, reducing misalignment and improving generative output quality across every phase.
π Example Use Cases¶
| Scenario | ULA Action |
|---|---|
| β New Product Vision | Extracts glossary from business narrative |
| π Updated Domain Blueprint | Re-analyzes and adds missing or evolved terms |
| π‘ Developer Query | Explains term meaning and how it maps to aggregates or ports |
| π QA Verification | Ensures all entity properties and messages use correct terms |
| π¦ Glossary Sync | Pushes terms to Engineering Agents and Documentation layers |
π₯ Inputs¶
The Ubiquitous Language Agent consumes structured and unstructured sources across multiple stages of the ConnectSoft AI Software Factory. These inputs form the semantic context from which domain terms are discovered and formalized.
| Input Source | Format | Description |
|---|---|---|
| π Product Vision Prompt | Natural language (Markdown, plain text) | High-level product descriptions, goals, and business context. |
| π¦ Feature Blueprints | JSON, YAML | Functional and non-functional feature specifications with user stories. |
| π DomainModel.yaml | YAML | Predefined aggregates, entities, and domain event structures. |
| π§ Term Feedback Records | JSON | Previously rejected, refined, or overridden term definitions from human reviewers. |
| π Industry Lexicon Plugins (optional) | SK plugins, JSON | Injected domain-specific terminology (e.g., Healthcare, Insurance, Education). |
| π¬ Conversation Logs | Structured message history | Captured Q\&A or clarification threads with users or agents. |
π All inputs are tagged with
trace_id,source, andcontext_stageto ensure alignment and traceability throughout the lifecycle.
π€ Outputs¶
The ULA generates semantically structured and machine-consumable artifacts that feed the entire agent pipeline.
| Output Artifact | Format | Purpose |
|---|---|---|
π glossary.yaml |
YAML | Canonical glossary of terms, definitions, synonyms, contexts. |
π terms.json |
JSON | Normalized and structured term catalog with metadata (origin, confidence, usage count). |
π§ SharedMemory.TermMap |
In-memory structure | Shared semantic memory injected into DomainModeler, Blueprint Agents, and API Designers. |
π Glossary.md |
Markdown | Human-readable glossary for documentation and onboarding. |
π¬ TermEvents |
Event stream (SK, MCP, EventBus) | TermCreated, TermUpdated, TermDeprecated events for downstream updates. |
π UbiquitousLanguageContext |
Object | Injected context for prompt chaining into other agents (Architect, QA, Engineer). |
π Output Example: glossary.yaml¶
- term: Order
definition: A customer request that includes one or more line items to be fulfilled by the system.
type: AggregateRoot
synonyms: [PurchaseRequest]
boundedContext: Sales
usageFrequency: High
lastValidated: 2025-05-01
- term: LineItem
definition: A single unit of order representing a specific product and quantity.
type: Entity
boundedContext: Sales
π Data Flow Context¶
graph TD
FeatureSpec[π¦ Feature Blueprint] --> ULA[π§ Ubiquitous Language Agent]
VisionPrompt[π Product Vision] --> ULA
DomainModel[π DomainModel.yaml] --> ULA
ULA --> GlossaryYAML[π glossary.yaml]
ULA --> TermsJSON[π terms.json]
ULA --> UbiquitousMemory[π§ Shared Memory]
ULA --> DomainModeler
ULA --> DocsAgent
π¦ Output Consumers¶
| Agent / Component | Consumes Output |
|---|---|
| Domain Modeler Agent | glossary.yaml, SharedMemory.TermMap |
| Architecture Blueprint Generator | terms.json, UbiquitousLanguageContext |
| Engineering Agents | For naming ports, adapters, and DTOs |
| QA/Test Agents | To verify term alignment in test plans |
| Documentation Agent | Glossary.md for human documentation sites |
π Knowledge Base¶
The ULA is initialized with a multi-source knowledge base to ensure precise extraction and consistent usage of terms across contexts. This includes:
π§± Built-In Semantic Models¶
| Source | Description |
|---|---|
| π DDD Semantic Ontology | Pre-trained mapping of Domain-Driven Design concepts (Aggregate, Entity, Bounded Context, etc.). |
| π§© Software Factory Term Atlas | A curated map of 5,000+ common terms used across SaaS domains, stored in vector DB. |
| π·οΈ Contextual Pattern Rules | NLP patterns and heuristics to identify meaningful nouns, verbs, value objects. |
| π Industry Lexicons (optional) | Domain-specific extensions (e.g., Medical, Insurance, Finance) loaded via SK Plugins or API. |
These static resources form the ULAβs foundational reasoning layer and are used during both training and real-time generation.
𧬠Memory Architecture¶
ULA utilizes both short-term and long-term memory to ensure traceability, correction, and continuity across multi-cycle factory flows.
π§ Short-Term Memory¶
| Layer | Purpose |
|---|---|
| π Prompt Context | Holds input prompt(s), current glossary state, and last few validation rounds. |
| π§ͺ Session Trace | Stores trace_id, feature ID, and upstream agent references. |
| π Token-Scoped Term Cache | Keeps terms extracted in current execution window for deduplication. |
Short-term memory is volatile and optimized for fast token-limited processing via Semantic Kernel.
π§ Long-Term Memory (Persistent)¶
| Store | Description |
|---|---|
| ποΈ Vector DB (e.g., Azure Cognitive Search / Pinecone) | Embedding-based semantic memory for glossary definitions, synonyms, and usage context. |
| π¦ File Storage (glossary.yaml, terms.json) | Versioned outputs stored in Git-backed content repo or blob storage. |
| π MCP Memory Server (optional) | External agent-accessible memory node for term sharing and lookup across agents. |
| π Telemetry Store | Historical metrics about term creation, frequency, validation events. |
π§ Memory Retrieval Strategy¶
flowchart LR
PromptInput[π Prompt Inputs] --> ContextCache[π Term Cache]
VectorDB[ποΈ Vector DB] --> TermRecall[Term Retrieval Engine]
TermRecall --> ContextCache
ContextCache --> TermValidator
TermValidator --> OutputArtifacts
π Example Term Recall Logic¶
Given the user prompt: βCustomers can create quotes and convert them into ordersβ
- Extracts candidate terms:
Customer,Quote,Order - Vector DB is queried:
- Finds existing
Orderterm β reuses with confidence boost Quotenot found β triggers definition generation
- Finds existing
- Term definitions are assembled and cross-validated via rules
π Versioned Glossary Memory¶
The ULA assigns version_id and source_stage metadata to every term.
| Field | Example |
|---|---|
term |
Quote |
version_id |
glossary.v2.3.1 |
source_stage |
VisionPrompt + FeatureBlueprint |
trace_id |
fea-9842-term-quote |
π§ This supports full-term traceability and enables glossary diffing, rollback, and auditing.
π Summary¶
The ULAβs memory design ensures:
- π§ Recall of known terms and prevention of duplicates
- πͺ’ Semantic linking across aggregate roots, entities, and bounded contexts
- π Continuity of definitions over multi-agent, multi-cycle flows
- π Auditability and governance of glossary evolution
𧬠Process Flow¶
The ULA follows a deterministic, multi-stage pipeline to transform raw business prompts and specifications into a canonical, context-aware Ubiquitous Language Glossary.
This flow ensures repeatability, traceability, and semantic accuracy, integrating both LLM-based inference and rule-based postprocessing.
π§ Agent Flow Diagram¶
flowchart TD
A[π₯ Inputs: Prompts, Blueprints, DomainModel.yaml] --> B[π§ Term Extraction Stage]
B --> C[π Semantic Categorization]
C --> D[π Glossary Generation]
D --> E[π§ͺ Validation & Deduplication]
E --> F[π€ Output Emission - YAML, JSON, Memory]
F --> G[π¬ Event Dispatch - TermCreated/Updated]
π§© Step-by-Step Process¶
| Step | Description |
|---|---|
| 1. Input Parsing | Normalize raw prompts and structured inputs (feature blueprints, vision, models). |
| 2. Term Extraction | Apply NLP and SK skills to identify candidate terms and relationships. |
| 3. Semantic Categorization | Assign term roles: Aggregate, Entity, ValueObject, Process, Policy, Actor, ExternalSystem. |
| 4. Contextual Enrichment | Enrich terms using vector memory, domain patterns, and bounded context classification. |
| 5. Glossary Synthesis | Generate term entries in structured format (YAML + JSON + Markdown view). |
| 6. Deduplication & Conflict Detection | Detect existing definitions or similar terms, apply merge rules or escalate. |
| 7. Validation Loop | Check definition format, naming conventions, and referential integrity (e.g., used in DomainModel). |
| 8. Output Emission | Write glossary.yaml, terms.json, and update semantic kernel memory. |
| 9. Event Dispatching | Emit TermCreated, TermUpdated, TermRejected for reactive consumption by other agents. |
π§ Term Extraction Logic¶
Sample prompt: βA Customer can submit an Application containing multiple Animals to register at a Clinic.β
- Identifies:
Customer,Application,Animal,Clinic - Categorizes:
Customerβ ActorApplicationβ Aggregate RootAnimalβ EntityClinicβ ExternalSystem
- Stores definitions, roles, synonyms, and relationships
π§ͺ Example Output Snippet¶
- term: Application
definition: A registration request initiated by a Customer, containing one or more Animals, sent to a Clinic.
role: AggregateRoot
context: Registration
synonyms: [PetApplication, RegistrationForm]
trace_id: app-2025-05-04-001
π Looping Behavior¶
If the output does not pass validation or receives correction signals:
- β Triggers Term Re-generation
- π Applies correction rules (e.g., clarify overlapping term, split compound)
- π Re-runs from Glossary Synthesis β Validation
π§βπ€βπ§ Human Feedback Loop (Preview)¶
- Manual reviewers (or Reviewer Agent) can:
- Accept / reject terms
- Suggest better phrasing
- Force rename or redefine
π§ This step integrates into Human Intervention Hooks
π§ Observability Built-In¶
Each step emits:
- β± Duration
- π Token cost
- π§Ύ Term count extracted
- π Invalid definitions
- π¬ Events emitted (by type)
β Summary¶
The ULAβs process flow is:
- π Repeatable
- π§ Memory-integrated
- π§ͺ Validation-rich
- π€ Multi-format aware
- π¬ Event-emitting and composable
π§© Semantic Kernel Skills & Functions¶
The ULA is built as a Semantic Kernel-based orchestration agent, with modular skills enabling term extraction, validation, glossary generation, and event-driven communication.
It uses a combination of custom C# skills, prompt-based semantic functions, and pluggable tools (via SK plugins or MCP servers).
π§ Core Semantic Kernel Skills¶
| Skill Name | Type | Description |
|---|---|---|
ExtractDomainTerms |
Prompt Function | Uses prompt engineering to extract candidate domain terms from raw input. |
ClassifyTermRole |
Semantic / Native | Assigns roles like Aggregate, Entity, ValueObject, Actor, etc. |
GenerateTermDefinition |
Semantic | Creates structured definition with context, synonyms, and relationships. |
SuggestBoundedContext |
Semantic | Infers bounded context from term usage or feature alignment. |
CheckTermConflicts |
Native (C#) | Looks for naming collisions, duplicates, and similar definitions. |
FormatGlossaryYaml |
Native | Assembles YAML-compliant glossary artifact. |
EmitTermEvents |
Native / EventBus | Publishes lifecycle events (TermCreated, TermUpdated, TermRejected). |
RetrieveSimilarTerms |
Vector Memory | Queries term vector DB for existing definitions or overlap. |
InjectGlossaryMemory |
SK Planner | Feeds memory context to downstream agents (e.g., Domain Modeler). |
𧬠Orchestration Flow (Internal Skill Chain)¶
flowchart TD
A[ExtractDomainTerms] --> B[ClassifyTermRole]
B --> C[GenerateTermDefinition]
C --> D[RetrieveSimilarTerms]
D --> E[CheckTermConflicts]
E --> F[SuggestBoundedContext]
F --> G[FormatGlossaryYaml]
G --> H[EmitTermEvents]
π§± Modular SK Planner Functions¶
The ULA optionally supports planner-based chaining to adapt behavior based on:
- Term complexity
- Industry-specific lexicons
- Conflict detection
- Feedback loop status
β Enables dynamic pipeline variation without code change.
π Plugin Integrations (Optional)¶
| Plugin | Use |
|---|---|
| OpenAPI Plugin | Can call 3rd-party glossaries or ontology APIs for industry-specific terms. |
| Web Plugin | Searches domain-specific sources or Wikipedia for enrichment. |
| Document Plugin | Parses PDFs or text files for term candidates. |
| Memory Plugin | Loads and stores glossary memory from Azure Cognitive Search / Pinecone. |
| Graph Plugin | (Future) To build term relationship graphs between aggregates and subdomains. |
π§ Function Configuration¶
Each skill has:
- Retry strategy (max attempts, fallback mode)
- Observability tags (trace_id, term_id, confidence score)
- Toolchain signature (
agent_id,skill_name,version,model_id)
π§ͺ Example Semantic Function: GenerateTermDefinition¶
Prompt Template:
"Given the domain term: {{term}}, write a one-sentence definition suitable for inclusion in a DDD glossary.
Include synonyms and the termβs bounded context if available."
Input: term = "Quote"
Output:
- definition: "A preliminary pricing request made by a customer before placing an order."
- synonyms: ["Estimate", "Pre-Order"]
- boundedContext: Sales
β Summary¶
The ULAβs SK skillset ensures:
- π§ Composability across pipelines
- π Chained reasoning with planners
- π§ Integration with memory & validation tools
- π¦ Output in production-ready artifacts
π§ Core Technologies¶
The ULA is implemented using a modular, AI-native, cloud-ready architecture, combining ConnectSoft platform standards with modern LLM orchestration tools.
| Technology | Role |
|---|---|
| π§ Semantic Kernel (C#) | Primary orchestration engine for skill chaining, memory access, and prompt templates |
| π€ OpenAI / Azure OpenAI | Foundation model provider for term extraction, definition synthesis, and categorization |
| π Azure Cognitive Search / Pinecone | Vector memory backend for semantic glossary lookup and retrieval |
| 𧬠LangChain Plugins / SK Connectors | Access external ontologies, domain glossaries, and document stores |
| π§βπ» .NET Core 8 | Hosting environment for runtime agents and skill logic |
| π Azure Blob Storage / GitHub Repo | Persistent artifact storage (glossary.yaml, terms.json, Markdown views) |
| π‘ Event Bus (Azure Service Bus / Kafka) | Emit TermCreated, TermUpdated, and sync events to downstream agents |
| π MCP Servers (Model Context Protocol) | Enable shared glossary memory and cross-agent glossary injection |
| π MkDocs (Material) | Documentation generator for human-readable glossary views |
π Integration with ConnectSoft Stack¶
| Component | Integration Point |
|---|---|
| β Vision Architect Agent | Receives extracted terms from prompt analysis stage |
| β Domain Modeler Agent | Consumes canonical term list for building aggregates and entities |
| β Blueprint Generator Agent | Aligns DDD constructs and ports to glossary definitions |
| β Microservice Generator Agent | Uses terms for naming classes, folders, and services |
| β Documentation Agent | Renders Markdown glossary from glossary.yaml |
| β QA/Testing Agents | Validate semantic alignment between terms and test specs |
π Security & Identity¶
| Area | Practice |
|---|---|
| API Access | Token-based access to Azure OpenAI or OpenAI APIs |
| Artifact Access | RBAC over Blob Storage or Git repositories |
| Event Publishing | Authenticated publishing to secured queues or service bus topics |
| Plugin Wrappers | SK plugins executed in sandboxed container context if needed |
π Deployment Context¶
The ULA runs as:
- π§± A microservice generated via
ConnectSoft.MicroserviceTemplatewith--UseSemanticKerneland--UseOpenAIenabled - π Exposes a REST API for external glossary queries (
GET /glossary,POST /term) - π Acts as a headless agent when orchestrated by Vision or DomainModeler agents
β Fully agent-compatible, versioned, traceable, and deployable with CI/CD pipelines
πΆ Optional Extensions¶
| Extension | Description |
|---|---|
| π Ontology Plugin | Access standardized vocabularies like FIBO, SNOMED, HL7, OWL-based taxonomies |
| π Document Parser | Load PDFs, Excel sheets, or HTML pages as prompt input |
| π Web Search Plugin | Fetch term definitions or synonyms dynamically from domain-specific sources |
| π§ Graph Plugin | (Upcoming) Builds term relationship graphs for visualization in architecture docs |
π Summary¶
The ULA is designed to operate as a cloud-native, AI-augmented, multi-agent service, tightly integrated with:
- The ConnectSoft Agent Framework
- SK/OpenAI capabilities
- Cloud storage, memory, and event systems
- Documentation and delivery pipelines
π§ System Prompt (Bootstrap Instruction)¶
This is the foundational instruction injected during agent initialization. It defines the ULA's identity, expected behavior, and alignment to ConnectSoftβs Clean Architecture and DDD-first practices.
You are the Ubiquitous Language Agent (ULA) in the ConnectSoft AI Software Factory.
Your goal is to extract, define, and validate domain-specific terms from product descriptions, user stories, and domain models. These terms should reflect the Ubiquitous Language as defined in Domain-Driven Design (DDD) and must be contextually aligned with bounded contexts and aggregates.
For each term you extract, classify it as one of: Aggregate, Entity, ValueObject, DomainEvent, Actor, Policy, Process, ExternalSystem, or Concept.
Your definitions must be:
- Clear and concise (1β2 sentences)
- Use the same terminology as used in upstream prompts
- Provide synonyms if available
- Include the relevant bounded context
- Use markdown-safe formatting and YAML-serializable structure
Avoid generating overlapping terms, generic technical words, or vague labels. Ensure consistency across existing domain models and feature blueprints.
All outputs should be structured, testable, and traceable.
π§Ύ Input Prompt Template¶
This is the reusable semantic function prompt format used during skill execution (e.g., ExtractDomainTerms, GenerateTermDefinition, ClassifyTermRole).
π Template: Term Extraction¶
Given the following product or feature description:
{{input}}
Extract the list of domain terms that appear meaningful from a Domain-Driven Design (DDD) perspective.
For each term, return:
- Term name
- Type (Aggregate, Entity, etc.)
- The sentence or context it appeared in
Output in YAML list format.
π Template: Term Definition¶
Given the term "{{term}}" and its context: "{{context}}",
Write a one-sentence definition that is domain-relevant, specific, and aligned with Clean Architecture.
Also return:
- Synonyms (if any)
- Suggested bounded context
- Classification type
Output in this YAML format:
- term: {{term}}
definition: "... "
type: Aggregate | Entity | ...
synonyms: [ ... ]
boundedContext: ...
π Template: Glossary Generation (Full)¶
Using the following list of extracted terms:
{{terms}}
Generate a complete glossary in YAML format, where each term includes:
- definition
- type
- bounded context
- synonyms
- trace_id (you generate it as traceable UID)
π₯ Example Input¶
π€ Expected Output (Excerpt)¶
- term: Quote
definition: A pricing proposal generated by a customer that outlines intended products or services.
type: Aggregate
boundedContext: Sales
synonyms: [Estimate, Pre-Order]
trace_id: term-20250504-01
β Summary¶
ULAβs prompts are designed to:
- Guide large language models with precision
- Maintain YAML-safe, schema-aligned outputs
- Embed DDD understanding and bounded context awareness
- Support multi-cycle reuse and chaining across agents
π€ Output Expectations¶
ULA outputs are designed to be:
- π§± Structurally consistent for machine agents
- π§ Human-readable for business and product stakeholders
- π Traceable across factory execution flows
- β»οΈ Reusable across multiple agents and factory runs
Each output includes semantic data, classification metadata, and contextual traceability.
π Primary Artifacts Produced¶
| Artifact | Format | Description |
|---|---|---|
glossary.yaml |
YAML | Canonical DDD glossary file containing all discovered terms and their properties |
terms.json |
JSON | Normalized term records for use in web UIs, planners, and downstream APIs |
Glossary.md |
Markdown | Human-friendly glossary view, used by the Documentation Agent |
UbiquitousLanguageContext |
Object | In-memory structure injected into downstream agent executions |
TermEvents |
Event Stream | Used to notify Domain Modeler, Engineering, and Blueprint agents of glossary changes |
π Output Format: glossary.yaml¶
- term: Quote
definition: A pricing proposal generated by a customer for a set of goods or services.
type: Aggregate
synonyms: [Estimate, Proposal]
boundedContext: Sales
trace_id: term-2025-05-04-Q001
source: FeatureBlueprint:Registration
confidenceScore: 0.96
lastUpdated: 2025-05-04T14:33:00Z
- term: LineItem
definition: An individual product entry within a Quote, specifying quantity and product.
type: Entity
boundedContext: Sales
synonyms: []
trace_id: term-2025-05-04-LI01
confidenceScore: 0.91
π§© Output Fields¶
| Field | Required | Description |
|---|---|---|
term |
β | The domain-specific label (e.g., Quote, Application, LineItem) |
definition |
β | One-sentence description |
type |
β | DDD role (Aggregate, Entity, ValueObject, Actor, etc.) |
boundedContext |
β | Logical grouping of the term |
synonyms |
β¬ οΈ Optional | Alternative labels |
trace_id |
β | Unique traceable identifier for linking outputs to factory flows |
confidenceScore |
β | LLM-determined confidence (0β1) |
source |
β¬ οΈ Optional | Originating blueprint, prompt, or agent stage |
lastUpdated |
β | UTC timestamp for version tracking |
π terms.json Sample¶
[
{
"term": "Order",
"definition": "A finalized customer request for fulfillment.",
"type": "Aggregate",
"boundedContext": "Sales",
"trace_id": "term-2025-05-04-O001",
"confidenceScore": 0.95
}
]
π Markdown Rendering (Glossary.md)¶
### π§Ύ Quote
- **Definition**: A pricing proposal generated by a customer for a set of goods or services.
- **Type**: Aggregate
- **Bounded Context**: Sales
- **Synonyms**: Estimate, Proposal
---
### π LineItem
- **Definition**: An individual product entry within a Quote, specifying quantity and product.
- **Type**: Entity
- **Bounded Context**: Sales
Generated automatically by the Documentation Agent from
glossary.yaml.
π Event Emission: TermCreated, TermUpdated¶
Each term lifecycle emits an event (via Service Bus or Event Grid):
{
"eventType": "TermCreated",
"term": "Order",
"boundedContext": "Sales",
"source": "VisionAgent",
"trace_id": "term-2025-05-04-O001",
"timestamp": "2025-05-04T14:33:00Z"
}
Enables reactive term propagation to Domain Modeler and Engineering agents.
π¦ Output Consumers¶
| Agent | Usage |
|---|---|
| Domain Modeler Agent | Builds aggregates/entities from terms |
| Blueprint Generator Agent | Aligns ports and contexts |
| Engineering Agents | Names DTOs, adapters, and handlers |
| Testing Agents | Enforces term-aligned test coverage |
| Documentation Agent | Renders glossary section for onboarding and product docs |
β Summary¶
ULAβs output is:
- π Structured (YAML, JSON, Markdown)
- π Traceable (
trace_id,source,confidenceScore) - β»οΈ Reusable across agents and documentation layers
- π Emittable via events for pipeline continuity
β Validation Process¶
To guarantee that the generated Ubiquitous Language:
- π§ Aligns with Domain-Driven Design (DDD) principles
- β Avoids ambiguity, duplication, or inconsistency
- π Connects accurately to upstream input and downstream usage
- π¦ Produces output that is consumable by other agents
π§ͺ Multi-Layer Validation Pipeline¶
Validation is applied at three levels:
| Layer | What It Validates |
|---|---|
| 1οΈβ£ Syntactic | YAML/JSON formatting, required fields, naming conventions |
| 2οΈβ£ Semantic | DDD role correctness, context alignment, clarity of definitions |
| 3οΈβ£ Contextual | Reuse consistency, cross-term references, duplication across stages |
π Step-by-Step Validation Flow¶
flowchart TD
A[β¬οΈ Glossary Generation] --> B[π Format Validator]
B --> C[π§ Semantic Consistency Validator]
C --> D[π Term Deduplicator]
D --> E[π Cross-Agent Alignment Check]
E --> F{β
All Pass?}
F -- Yes --> G[π€ Output Emission]
F -- No --> H[π¨ Correction Path Triggered]
π Validators Defined¶
1. π Format Validator¶
- Ensures:
- YAML or JSON is parseable
- Fields are not missing (
term,definition,type,trace_id) typeis one of:Aggregate,Entity,ValueObject,DomainEvent, etc.
2. π§ Semantic Validator¶
- Runs checks on:
- Definitions being concise and domain-specific
- Correct use of DDD concepts (e.g., don't assign
AggregatetoEmail) - Avoids circular definitions or tautologies
3. π Deduplication Engine¶
- Checks against:
- Existing glossary memory (vector similarity > 0.85)
- Same term names in different contexts
- Misspellings or case-sensitive variants
4. π Alignment Validator¶
- Confirms term presence in:
- Feature blueprints
- DomainModel.yaml
- Past glossary versions
π Example Invalid Entries¶
| Issue | Sample |
|---|---|
| β Missing definition | - term: Customer |
| β Ambiguous type | type: Object |
| β Duplicate with small variation | LineItem vs Line Item |
| β Overly generic term | Data or Info as a root-level term |
| β Undefined context | boundedContext: "" |
π€ Validation Metadata¶
Each term includes a validation status block:
validation:
passed: false
issues:
- "Missing boundedContext"
- "Definition is too generic"
validatedAt: 2025-05-04T14:40:00Z
Only
passed: trueterms are emitted to final artifacts or injected into other agents.
π§ Integration with Other Agents¶
| Agent | Validation Usage |
|---|---|
| Domain Modeler Agent | Refuses to build aggregates from invalid terms |
| Docs Agent | Skips glossary rendering of rejected entries |
| Reviewer Agent | Highlights flagged terms for human approval |
β Summary¶
ULAβs validation ensures:
- β οΈ Bad terms are caught early
- π Inconsistent or vague definitions are filtered
- π Outputs meet Clean Architecture expectations
- π Terms integrate safely with DomainModeler, Engineering, QA
π Retry & Correction Flow¶
The retry and correction flow ensures:
- β¨ Glossary completeness and clarity
- π§ Semantic precision after validation failures
- π Autonomous recovery without human dependency (unless escalated)
- π High-quality inputs for downstream agents (DomainModeler, Engineering, QA)
π Retry Flow Overview¶
flowchart TD
A[β¬οΈ Validation Fails] --> B[π§ Retry Triggered]
B --> C[π₯ Input Context Review]
C --> D[π§ Regenerate Term or Definition]
D --> E[π Revalidate Glossary Block]
E --> F{β
Passes Now?}
F -- Yes --> G[π€ Emit Updated Artifact]
F -- No --> H[π§ Human Escalation (optional)]
π¦ Triggers for Retry¶
| Scenario | Triggered Action |
|---|---|
| β Missing fields | Auto-fill defaults or re-query LLM |
| β Conflict with similar term | Re-define or merge candidate |
| β Weak/confusing definition | Add prompt context and re-run generation |
| β Invalid type classification | Reroute through ClassifyTermRole function |
| β Out-of-context term | Reject or propose alias in more relevant context |
π Retry Strategy¶
| Component | Strategy |
|---|---|
| π LLM Re-prompting | Retry with enriched prompt (adds context, examples, constraints) |
| π Context Refinement | Pull in surrounding blueprint text or historical glossary memory |
| π§ Fallback Rules | Use prebuilt rules (e.g., default to Entity if uncertain) |
| π§ Term Merge Handler | Combine near-duplicates with confidence weighting |
| π§ Reviewer Path (optional) | Escalate to human-in-the-loop for final decision |
π Enriched Retry Prompt Example¶
Retrying definition for the term: "Submission"
Previous output was vague or too generic. Here's more context:
- Appears in: "A clinic staff member can initiate a submission for review"
- Possible meaning: A formal request sent to an external system
Try again. Define clearly and classify it within a DDD bounded context.
π Correction Metadata (Versioned Term Block)¶
- term: Submission
definition: A formalized set of documents or forms submitted to an external agency for processing.
type: DomainEvent
boundedContext: Compliance
trace_id: term-2025-05-04-SUB001
corrections:
- "Initial definition was too vague"
- "Added context from blueprint: 'clinic staff review flow'"
retries: 2
validated: true
π§ Intelligent Retry Control¶
The retry loop:
- Caps attempts (
maxAttempts: 3) - Logs
retryReasonandcorrectionStrategy - Emits telemetry for retry count, fail reason, and correction outcome
- Escalates only when retry confidence is below threshold (e.g., < 0.7)
π Human Escalation Path (If All Fails)¶
| Action | Tool |
|---|---|
π Add to term_review_queue.yaml |
Reviewer Agent or human approves |
π¦ Flag via TermRejected event |
Consumed by monitoring dashboards |
| π¬ Alert via Teams/Slack plugin | Optional integration for term moderators |
β Summary¶
ULA's retry/correction loop:
- π Recovers gracefully from glossary failures
- π§ Enhances definitions using semantic and contextual reasoning
- π§ Allows human curation only when needed
- π Emits correction metadata for audit, observability, and QA use
π€ Collaboration Interfaces¶
To enable semantic continuity and factory-wide interoperability, the ULA exposes clean, contract-based collaboration interfaces to all upstream and downstream agents that depend on consistent domain terminology.
These interfaces are:
- π§ Memory-aware
- π Event-driven
- π API-compatible
- β»οΈ Retryable and traceable
π Primary Collaboration Targets¶
| Target Agent | Interaction Role |
|---|---|
| π§ Vision Architect Agent | Receives raw product vision β provides initial prompt inputs |
| π§© Domain Modeler Agent | Consumes canonical glossary β builds aggregates, entities, events |
| π Architecture Blueprint Agent | Aligns glossary to ports, transport rules, and DDD contexts |
| π§° Engineering Agents (Code Generators) | Use glossary for naming conventions, DTOs, adapter interfaces |
| π Documentation Agent | Renders glossary sections in Markdown and Docs UI |
| β QA/Testing Agents | Ensure usage of defined terms in test cases and acceptance criteria |
𧬠Interface Types¶
| Type | Method | Description |
|---|---|---|
| π§ Shared Memory Injection | SK Kernel Context | Injects UbiquitousLanguageContext object into other agents' reasoning scope |
| π‘ Event Bus Signals | Service Bus / Kafka | Emits term lifecycle events (TermCreated, TermUpdated, TermRejected) |
| π HTTP API | REST / JSON | Exposes glossary endpoints: GET /terms, GET /term/{name}, POST /feedback |
| π Prompt Context Injection | Prompt Block | Adds ## Known Terms section to other agents' prompt templates |
| π MCP Server Memory API (optional) | Plugin Adapter | Shared semantic glossary node accessible by multiple agents in distributed setups |
π§ UbiquitousLanguageContext Format (Injected Memory Object)¶
{
"glossary": [
{
"term": "Quote",
"definition": "A pricing proposal generated by a customer.",
"type": "Aggregate",
"boundedContext": "Sales"
}
],
"sourceAgent": "ULA",
"traceId": "glossary-2025-05-04"
}
Used by:
- π§© Domain Modeler β builds aggregates/entities
- π Architecture Blueprint Agent β maps ports
- π§° Engineering Agents β names adapters/DTOs
π‘ Event Format (TermCreated)¶
{
"eventType": "TermCreated",
"term": "Quote",
"trace_id": "term-2025-05-04-Q001",
"agent": "ULA",
"boundedContext": "Sales",
"timestamp": "2025-05-04T15:02:00Z"
}
Emitted to
glossary.events.topicfor real-time term sync.
π REST API Endpoints¶
| Endpoint | Purpose |
|---|---|
GET /glossary |
Retrieve full glossary as JSON |
GET /term/{name} |
Lookup specific term |
POST /term-feedback |
Accept feedback or correction for a term |
GET /terms/context/{boundedContext} |
Query terms by bounded context |
π€ Cross-Agent Prompt Injection Example¶
Injected into Domain Modeler:
## Known Terms
- Quote (Aggregate): A pricing proposal by a customer.
- LineItem (Entity): An individual product line in a Quote.
Use the above as canonical definitions when generating domain models.
π§ Sample Collaboration Sequence¶
sequenceDiagram
participant Vision as Vision Agent
participant ULA as Ubiquitous Language Agent
participant DomainModeler as Domain Modeler
participant Blueprint as Blueprint Agent
participant Docs as Documentation Agent
Vision->>ULA: Submit product vision
ULA->>DomainModeler: Inject UbiquitousLanguageContext
ULA->>Blueprint: Emit glossary.yaml
ULA->>Docs: Send Glossary.md
β Summary¶
ULA's collaboration interfaces:
- π Enable agent-to-agent glossary continuity
- π§ Allow semantic memory reuse
- π‘ Power event-driven architecture
- π Expose REST APIs for observability, debugging, and sync
- π¦ Feed agent prompts and reasoning layers
π Observability Hooks¶
To ensure the ULA operates reliably and transparently at scale, all core behaviors are instrumented with:
- π Metrics
- π§΅ Tracing
- πͺ΅ Logging
- π§ͺ Validation Reporting
These observability features enable:
- π¦ Agent health and uptime monitoring
- π Prompt-output traceability
- π§ Glossary quality reporting
- π§βπ§ Debugging of generation or validation failures
- π Semantic glossary usage analytics
π Key Metrics (Prometheus / Azure Monitor)¶
| Metric Name | Type | Description |
|---|---|---|
ula_terms_generated_total |
Counter | Number of terms created by ULA |
ula_terms_validated_total |
Counter | Number of terms that passed all validation |
ula_retry_count |
Counter | Total retries triggered for invalid terms |
ula_invalid_term_ratio |
Gauge | % of terms rejected per batch |
ula_avg_glossary_size |
Gauge | Average number of terms per output cycle |
ula_vector_hits_total |
Counter | Times vector memory retrieved an existing term |
ula_trace_errors_total |
Counter | Prompt/response chain failures |
π§΅ Distributed Tracing (OpenTelemetry)¶
Each ULA invocation is traceable via:
- π
trace_idattached to:- Inputs (prompt, blueprint, upstream agent)
- Output (term blocks, events)
- π Spans for:
- Term extraction
- Definition generation
- Validation steps
- Output rendering
- π‘ Trace propagation across:
- Vision Agent β ULA β DomainModeler
- ULA β Event Bus β Engineering Agents
Traces are compatible with Azure Application Insights, Jaeger, and Grafana Tempo.
πͺ΅ Structured Logging (Serilog / OpenTelemetry Logs)¶
| Log Type | Fields |
|---|---|
TermGeneration |
term, confidenceScore, modelId, source |
ValidationFailure |
term, issues[], retryCount, trace_id |
MemoryHit |
term, similarTerm, similarityScore |
EventDispatch |
eventType, term, boundedContext, recipientAgent |
CorrectionAction |
term, correctionType, retries, fallbackStrategy |
All logs are emitted in JSON format and support ElasticSearch, Azure Log Analytics, or Seq backends.
π¬ Event Stream Monitoring¶
Each emitted event includes:
eventId,traceId,eventType,timestamp,agent,term- Can be tracked in:
- Azure Event Grid Dashboard
- Kafka Topics + Lag Monitoring
- Grafana Alerting (failed terms, high retry count)
π Glossary Quality Dashboard¶
Recommended dashboard views:
- π¦ Glossary Size per Product
- β Validation Pass/Fail Ratio
- π Retry Frequencies
- β± Generation Time per Batch
- π Top Bounded Contexts by Term Count
- π§ Most Frequent Terms (memory hits)
These can be visualized via Grafana, Power BI, or custom dashboards.
π οΈ Debug Mode (Developer Hook)¶
If triggered via header or API param:
Returns:
- Prompt inputs
- Intermediate reasoning (term selection, classification logs)
- Validation report
- Trace metadata
- Retry/correction history
Useful for developers, reviewers, or auditor agents.
β Summary¶
ULA is deeply observable, with:
- π Real-time glossary generation and quality metrics
- π§΅ Full traceability across promptβtermβoutputβevent
- πͺ΅ Actionable structured logs and validation feedback
- π‘ Event observability across agent network
- π Dashboards for glossary health, retries, term counts
π§βπΌ Human Intervention Hooks¶
While ULA is designed for full autonomy, some situations require human guidance, especially when:
- π€ Ambiguity exceeds model confidence
- β Definitions conflict with domain reality
- π§ Terminology carries strategic implications
- π§ Product Owners, Architects, or Domain Experts request oversight
ULA supports both proactive reviews (triggered by rules) and on-demand overrides (triggered by users).
π Trigger Conditions for Human Review¶
| Condition | Description |
|---|---|
| β Validation Failure After Max Retries | Term fails all retry/correction attempts |
| π Low Confidence Score | Model outputs score < threshold (default: 0.75) |
| β οΈ Semantic Ambiguity | Conflicting synonyms, unclear role or bounded context |
| π§© Human-Tagged Terms | Terms marked requiresReview: true in upstream inputs |
| π Regulatory/Industry Keywords | Sensitive domains (e.g., βclaimβ, βtreatmentβ, βsubmissionβ) trigger review |
| π§ Feedback Loop Input | Term received negative or unclear feedback from previous agent or user |
ποΈ Review Queue Artifact¶
Invalid or pending terms are written to a structured queue:
reviewQueue:
- term: Claim
reason: "Low model confidence + industry-regulated term"
lastAttemptedDefinition: "A document submitted to request payment"
trace_id: term-2025-05-04-CL001
retries: 3
requiresAttention: true
suggestedAction: "Human confirmation or reword"
This can be:
- π Written to
term_review_queue.yaml - π¨ Sent as a message to a Reviewer Agent
- π¬ Posted to Microsoft Teams / Slack (via integration plugin)
π§βπ» Manual Review Actions¶
| Action | Result |
|---|---|
| β Approve | Term marked valid and emitted as usual |
| βοΈ Edit | Reviewer updates definition, synonyms, or type |
| π« Reject | Term is excluded from glossary and event stream |
| π Resubmit | Retriggers generation with human-supplied hint/context |
| π File for Later | Term deferred to another iteration or team |
All manual actions are versioned and stored.
π§ Reviewer UX Channels¶
| Channel | Description |
|---|---|
| π Review Queue UI | Embedded in Docs UI or ConnectSoft Ops Portal |
| π¬ Email/Teams Plugin | Term review digests or alerts sent to stakeholders |
| π§ Reviewer Agent | (Optional) AI-assisted review agent that summarizes, suggests, and applies changes |
| π§Ύ Markdown Summary | Generated GlossaryReview.md section for manual inspection |
π Trace & Override Metadata¶
Every human-impacted term is annotated:
- term: Coverage
definition: The extent of financial protection under a policy.
correctedBy: human
reviewer: a.romero@connectsoft.io
reviewReason: "Ambiguous across BoundedContexts"
validated: true
trace_id: term-2025-05-04-COV01
version: 3
π§ Human Feedback Injection into SK Memory¶
All human corrections or confirmations are embedded into memory:
{
"term": "Coverage",
"approvedBy": "Alex Romero",
"confidenceOverride": 1.0,
"reviewNotes": "Clarified for Insurance context only"
}
This feedback improves future glossary generations and reduces recurrence of errors.
β Summary¶
ULA supports a structured human-in-the-loop flow with:
- π¦ Review triggers based on validation, ambiguity, and model scores
- π Structured queue artifact for consistent review
- π§ UI and agent channels for human moderation
- π§ Memory updates based on human feedback
- π Audit trail and traceability for every overridden term
ποΈ Placement in End-to-End Factory Flow¶
π― Strategic Role¶
The Ubiquitous Language Agent is a foundational pillar in the factory lifecycle. It acts as:
- π§ The semantic translator from product vision to formal domain terms
- π§© The linguistic source of truth for all downstream agents
- π The glue that binds business language to technical architecture
No aggregate, entity, port, or documentation should be named without ULAβs semantic validation.
π§ High-Level Factory Flow with ULA¶
flowchart TD
A[π Vision Architect Agent] --> B[π§ Ubiquitous Language Agent]
B --> C[ποΈ Domain Modeler Agent]
B --> D[π Architecture Blueprint Agent]
B --> E[π Documentation Agent]
C --> F[π§° Engineering Agent]
D --> F
F --> G[π Deployment / Ops Agent]
π Flow Description¶
| Stage | ULA Role |
|---|---|
| 1. Vision Ingestion | Receives high-level business prompts and feature specs |
| 2. Glossary Generation | Extracts DDD terms, definitions, bounded contexts |
| 3. Glossary Injection | Injects glossary into SK memory for DomainModeler and Blueprint agents |
| 4. Event Emission | Emits TermCreated, TermUpdated events to trigger downstream responses |
| 5. Prompt Augmentation | Adds ## Known Terms block into other agentsβ prompts to ensure aligned vocabulary |
| 6. Documentation Feed | Sends glossary.yaml and Glossary.md to Docs Agent |
| 7. Feedback Loop | Accepts feedback, corrections, or redefinitions from humans or agents for refinement |
𧬠Downstream Agent Impact¶
| Agent | How ULA Feeds It |
|---|---|
| ποΈ Domain Modeler Agent | Receives terms with roles (e.g., Aggregate, Entity) to construct DDD models |
| π Blueprint Generator | Uses bounded contexts and term names for clean architecture layer naming |
| π§° Engineering Agent | Applies term names in DTOs, port contracts, folders, handlers |
| β QA Agent | Aligns acceptance criteria and test inputs with glossary-defined terms |
| π Documentation Agent | Auto-generates glossary sections in documentation UI or MkDocs |
π§ Semantic Chain Enforcement¶
ULA enforces terminological traceability across:
- π Feature blueprints β
- π Glossary terms β
- π§± Domain model elements β
- π§° Code artifacts β
- π§ͺ Tests and validation β
- π Documentation and user guides
π§ Shared Memory Injection¶
Each collaborating agent receives:
{
"glossary": [
{
"term": "Quote",
"definition": "A pricing proposal by a customer.",
"type": "Aggregate",
"boundedContext": "Sales"
}
],
"trace_id": "glossary-2025-05-04",
"sourceAgent": "ULA"
}
π Reactive Agent Flows (via Events)¶
- A
TermCreatedβ TriggersDomainModelerAgent.RegenerateModel() - A
TermUpdatedβ TriggersDocsAgent.RefreshGlossarySection() - A
TermRejectedβ Blocks glossary injection into prompt context
π§ Factory Flow Timeline (Simplified)¶
gantt
title ULA Timeline Across Factory
section Vision
Vision Architect Agent :done, va1, 2025-05-04, 30m
section Glossary Generation
ULA Extraction & Definition :done, ula1, after va1, 20m
ULA Validation + Retry :done, ula2, after ula1, 15m
section Downstream Injection
Inject into DomainModeler :done, ula3, after ula2, 2m
Emit Term Events :done, ula4, after ula3, 1m
β Summary¶
ULA is embedded in the semantic core of the factory:
- π§± No term, model, or component exists without passing through it
- π§ Guarantees alignment from vision β code β documentation
- π οΈ Enables consistent, event-driven, memory-shared collaboration
- π§© Propagates shared vocabulary to every domain-specific agent
π Mermaid Diagrams & Architecture Embedding¶
π High-Level Agent Interaction Diagram¶
flowchart TD
VISION[π Vision Architect Agent] -->|Product Prompt| ULA[π§ Ubiquitous Language Agent]
ULA -->|Glossary YAML| DOMAIN[ποΈ Domain Modeler Agent]
ULA -->|Known Terms Memory| BLUEPRINT[π Blueprint Generator Agent]
ULA -->|Glossary Markdown| DOCS[π Documentation Agent]
ULA -->|Semantic Memory| ENG[π§° Engineering Agent]
ULA -->|Events| QA[β
QA/Testing Agent]
ULA serves as a semantic nexus, distributing precise domain vocabulary to all factory components.
𧬠Internal Agent Skill Pipeline¶
graph TD
Input[π Prompt Input] --> Extract[π ExtractDomainTerms]
Extract --> Classify[π·οΈ ClassifyTermRole]
Classify --> Define[π§ GenerateTermDefinition]
Define --> Validate[π§ͺ RunValidators]
Validate --> Format[π FormatGlossaryYaml]
Format --> Emit[π€ EmitTermEvents]
Emit --> Memory[π§ InjectIntoSKMemory]
π§© Data Flow Diagram¶
flowchart LR
Prompt[π₯ Product Vision / Blueprint]
MemoryDB[π§ Vector DB / Cognitive Search]
EventBus[π‘ Term Events Bus]
GlossaryFile[π glossary.yaml]
DomainAgent[ποΈ Domain Modeler]
Prompt --> ULA
MemoryDB --> ULA
ULA --> GlossaryFile
ULA --> EventBus
ULA --> DomainAgent
π§ Glossary Validation Flow¶
flowchart TD
A[π Raw Term Block] --> B[π Format Validator]
B --> C[π§ Semantic Validator]
C --> D[π Deduplication]
D --> E{β
Passed All?}
E -- Yes --> F[π€ Emit Term]
E -- No --> G[π Retry or βΈ Human Review]
π Glossary Lifecycle Diagram¶
sequenceDiagram
participant V as Vision Agent
participant U as ULA
participant D as Domain Modeler
participant H as Human Reviewer
participant Q as QA Agent
V->>U: Submit product vision prompt
U->>U: Extract + Define terms
U->>U: Validate + Deduplicate
alt Valid output
U->>D: Inject glossary
U->>Q: Emit TermCreated event
else Needs review
U->>H: Push to review queue
H->>U: Submit correction
U->>D: Reinject corrected glossary
end
π¦ ULA as Microservice¶
flowchart TD
ULAAPI[π ULA REST API]
Events[π‘ Azure Service Bus]
Blob[π Azure Blob Storage]
SK[π§ Semantic Kernel Host]
Vector[π Pinecone / Cognitive Search]
ULAAPI --> SK
SK --> Events
SK --> Blob
SK --> Vector
ULA is deployable as a fully autonomous, SK-powered, event-emitting, memory-integrated microservice.
β Summary¶
These diagrams:
- π Embed ULA into the ConnectSoft architecture landscape
- π Show lifecycle from prompt to glossary emission
- π§± Visualize core flows, memory injection, retries, and API interfaces
- π‘ Clarify ULAβs place in cross-agent workflows and microservice architecture