Skip to content

🧠 Knowledge and Memory System in ConnectSoft

Overview

The Knowledge and Memory System is a foundational pillar of the ConnectSoft AI Software Factory. It provides the architecture, storage models, metadata conventions, and retrieval flows that allow intelligent agents to act with continuity, context, and autonomy across projects, blueprints, modules, and orchestrated lifecycles.

β€œIn ConnectSoft, knowledge is infrastructure β€” not documentation. And memory is not an optimization β€” it’s the execution context.”


🎯 Why Knowledge and Memory Matter

The ConnectSoft platform is designed to autonomously generate, evolve, and operate thousands of SaaS components: microservices, APIs, libraries, templates, orchestrators, and entire domain platforms. To do this at scale, every agent in the system must:

  • Understand the current project and its historical context.
  • Reuse previously generated solutions, code patterns, and architectural decisions.
  • Reason about decisions and outcomes from earlier flows.
  • Adapt output based on prior errors, feedback, or refinement signals.

This is only possible when all artifacts, blueprints, outputs, and coordination plans are captured, structured, and retrievable through an intelligent memory model.


🧩 What Is Stored in Memory?

The knowledge and memory system is responsible for storing and making accessible:

Category Examples
πŸ“¦ Code & Templates Generated .cs, .bicep, .feature, .json, .md, .yaml files
πŸ“š Documentation README.md, design docs, prompt inputs, blueprint summaries
🧠 Agent Outputs Generated artifacts from each skill and execution trace
🧰 Templates & Libraries Metadata, usage stats, README, DI configurations, options, test coverage
πŸ“„ Contracts & APIs OpenAPI specs, gRPC contracts, event schemas, domain models
πŸ“Š Observability Metadata execution-metadata.json, traceId, agentId, sprintId, durations
πŸ“œ Events & Orchestration Blueprint events, milestone states, FSM transitions
πŸ” Prompt Interactions User-defined prompts, planner context, injected blueprint memory
πŸ§ͺ Tests & Results Generated test cases, results, failure diagnostics

πŸ”„ Memory as Infrastructure

Unlike traditional documentation systems, ConnectSoft treats memory as:

Concept Role in the Platform
Knowledge Graph Connects artifacts across blueprints, agents, services, and tenants
Execution History Traceable timeline of all agent actions, failures, outputs
Retrieval Layer Semantic embeddings + structured filtering based on agent type and skill domain
Reusable Intelligence Enabling agents to reason from prior outputs instead of starting fresh
Governed Asset Store Versioned, auditable memory with agentId, traceId, and storage class

🧠 How Memory Powers Agent Behavior

Every agent in the system relies on memory for:

Need Memory Capability Used
Understanding project history Per-project memory scope linked to traceId and projectId
Generating similar outputs Vector search by embedding of similar prior blueprints
Avoiding redundant generation Retrieval of existing modules and validations
Learning from past mistakes Recall of AgentFailed, TestFailed, PromptCorrected
Explaining prior decisions Linked memory entries with metadata and rationale
Working across multiple modules Memory scoping by moduleId, tenantId, blueprintType

This system connects directly to key ConnectSoft principles:

Principle Memory Alignment Example
πŸ” Event-Driven Knowledge is updated on events like BlueprintCreated, PromptRefined
🧱 Modular Architecture Memory is scoped per module, template, and domain context
🧠 AI-First Development Memory fuels autonomous behavior and intelligent orchestration
☁️ Cloud-Native Memory is served and versioned from scalable, observable infrastructure
πŸ“Š Observability-First All memory access is observable, queryable, and auditable
πŸ” Security-First Per-tenant, per-agent scoped access control

βœ… Summary

The Knowledge and Memory System in ConnectSoft transforms how agents operate by providing:

  • Persistent context across flows and executions
  • Reusable design intelligence and artifacts
  • Traceability and governance of every output
  • Semantically indexed, event-driven knowledge graphs
  • Per-project memory isolation with structured access

This foundation ensures that the platform can scale intelligently, operate autonomously, and learn continuously across thousands of generated services and blueprints.


Types of Knowledge

In the ConnectSoft AI Software Factory, knowledge is modular, composable, and versioned. It spans far beyond traditional documentation and includes all traceable, reusable, and semantically meaningful artifacts produced or consumed by agents during blueprint execution, microservice generation, or orchestration flows.

This section categorizes all the types of knowledge modules that are captured, stored, indexed, and retrieved across the platform’s memory system.


🧠 Categories of Knowledge Modules

Type Description Examples
πŸ“„ Blueprint Documents Human- and agent-authored structured inputs to drive generation flows VisionDocument.md, ServiceBlueprint.yaml, ContextMap.json
πŸ”§ Generated Code Agent-produced files representing logic, adapters, APIs, and configuration .cs, .feature, .json, .bicep, .yaml, .proto
πŸ“š Documentation Markdown files and structured outputs from the Documentation Writer Agent or curated by humans README.md, ModuleOverview.md, HowItWorks.md
πŸ§ͺ Tests and Results Generated BDDs, unit tests, scenario validations, execution results BookAppointment.feature, TestsPassed, test-log.json
πŸ“¦ Template Definitions Reusable dotnet new templates or YAML-based bootstrapping skeletons ConnectSoft.MicroserviceTemplate, ApiGatewayTemplate
πŸ“š Libraries and APIs Shared NuGet packages, abstractions, adapters, and extension modules ConnectSoft.Extensions.*, ConnectSoft.Abstractions.*
πŸ“„ Contracts and Specs OpenAPI, domain events, interface definitions booking.openapi.yaml, AppointmentBooked.event.json
πŸ“ Project Metadata Sprint trace matrix, execution metadata, planning records sprint-trace-matrix.json, execution-metadata.json
πŸ“ˆ Observability Records Structured traces, spans, metrics, and logs traceId, agentId, status, OpenTelemetry export
πŸ’¬ Prompts and Dialogue Input prompts, modified context injections, structured planner instructions initialPrompt.md, promptRefined.md, planner-context.json

🧩 Modular Knowledge Units

In ConnectSoft, every artifact is a module, and every module has a corresponding knowledge memory footprint.

Artifact Type Memory Shape
BookingService Knowledge module scoped to microserviceId and boundedContext
BookAppointmentHandler.cs Code memory chunk tagged with skill:GenerateHandler and agentId
tests/booking.feature Test memory chunk with traceId, featureId, testId
vision-blueprint.md Prompt-driven knowledge artifact with origin=vision-architect
Microservice Template Template module with README, config files, metadata, and skills used

🧾 Memory Artifact File Formats

All memory modules must conform to structured file formats to ensure traceability, observability, and agent reusability:

Format Used For Enforced By
.md Vision docs, README, onboarding manuals Documentation Writer Agent
.yaml Blueprints, configs, CI/CD pipelines Solution Architect Agent, DevOps Agent
.json Contracts, test matrices, execution logs Test Generator, Coordinators
.cs Handlers, commands, adapters Backend Developer Agent, Adapter Generator Agent
.feature BDD test cases Test Generator Agent, QA Agent
.bicep Infrastructure definitions Cloud Provisioner Agent

All files are embedded into memory using a metadata schema (defined in later cycles), and indexed semantically and structurally.


πŸ”— Cross-Cutting Tags and Indexes

Every memory module is indexed and grouped by:

  • traceId, projectId, sprintId
  • agentId, skillId
  • moduleId, featureId, blueprintId
  • type (e.g., test, code, plan, doc, event)
  • tenantId, edition, environment
  • source (e.g., generated, curated, imported, retrieved)
  • version, status, validated

These tags allow multi-dimensional search, filtering, and reuse by agents and Studio components.


πŸ“˜ Example: Memory Snapshot for a Module

{
  "moduleId": "booking-service",
  "traceId": "trace-2025-05-123",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "filePath": "src/Application/Handlers/BookAppointmentHandler.cs",
  "tags": ["handler", "domain", "appointment", "create"],
  "status": "Success",
  "version": "1.0.3",
  "semanticHash": "4e67bbff",
  "embedding": [0.02, 0.73, -0.11, ...],
  "createdAt": "2025-05-12T10:34:00Z"
}

βœ… Summary

ConnectSoft’s memory model captures every meaningful artifact as a structured knowledge module, including:

  • Code, templates, and generated output
  • Agent plans, decisions, prompts, and metadata
  • Documentation, contracts, and tests
  • Execution results, logs, metrics, and tags

All memory types are indexed, semantically embedded, and traceable β€” ensuring that agents can learn, reason, reuse, and regenerate software with context-aware intelligence.


Knowledge Storage Overview

The ConnectSoft AI Software Factory is built on the premise that knowledge is modular, retrievable, and distributed across multiple types of persistent storage. These storage systems are optimized for search, versioning, traceability, and AI agent access patterns.

This section explains where memory lives, how it’s organized, and how different storage types interoperate to deliver a unified knowledge experience.


🧠 Knowledge Storage Architecture

The platform’s memory system consists of four primary storage backends, each serving a different purpose:

Storage Type Purpose Examples
Vector Database Fast semantic similarity search over text/code/document embeddings Azure AI Search, Qdrant, Pinecone
Structured Metadata DB Index and tag knowledge modules with metadata and traceability Azure Cosmos DB, PostgreSQL
Blob/Object Storage Store large and versioned artifacts (e.g., .cs, .bicep, .md, .json) Azure Blob Storage, S3
Source Control (Git) Long-term versioning and code-based traceability of emitted modules Azure DevOps Git, GitHub Repos

🧭 Storage Role by Memory Layer

Layer Primary Storage(s) Notes
🧠 Semantic Memory Vector DB + Metadata DB Used by agents during planning and blueprint reuse
πŸ“¦ Structured Artifacts Blob + Metadata DB + Git Code files, README, blueprint YAML, execution JSON
πŸ“ˆ Observability Metadata DB + Logs Execution trace logs, performance metrics
πŸ” Prompt History Metadata DB + Blob + Vector DB Stored as structured text + embeddings
πŸ“š Documentation Blob + Git + Metadata Markdown docs, API specs, Diagrams

πŸ“¦ Blob/Object Storage

Used to store full versions of large knowledge assets:

  • Generated files: .cs, .feature, .bicep, .yaml
  • README.md, ServiceBlueprint.yaml, execution-metadata.json
  • API definitions and event schemas
  • Markdown summaries and diagrams

Stored in paths like:

/tenants/{tenantId}/projects/{projectId}/modules/{moduleId}/memory/

βœ… Versioned and traceable. Used for Studio preview, raw download, and historical access.


πŸ”Ž Vector DB: Semantic Memory Engine

All textual knowledge β€” such as blueprints, prompts, comments, doc summaries, or tests β€” is embedded using an AI model (e.g., text-embedding-ada-002), and stored in a vector database with attached metadata.

  • Agents retrieve the top-K closest results by cosine similarity
  • Embedding vectors are associated with:

  • agentId, traceId, skillId

  • type, tags, tenantId, version
{
  "embedding": [0.13, -0.42, 0.91, ...],
  "text": "Generate handler for BookAppointment use case",
  "metadata": {
    "agentId": "backend-developer",
    "traceId": "trace-xyz",
    "tags": ["handler", "appointment", "microservice"]
  }
}

βœ… Enables agents to retrieve similar prior implementations or blueprints.


πŸ“š Structured Metadata Database

Every memory module (file, doc, blueprint, test, contract, etc.) has a corresponding metadata record in a structured knowledge index.

Stored fields include:

  • memoryId, moduleId, traceId, agentId, skillId, version
  • createdAt, source, status, type, projectId, tenantId
  • tags, semanticHash, filePath
  • Pointer to blob path or Git repo reference

This index supports:

  • Fast queries by filters (e.g., β€œall test files for booking-service”)
  • Graph traversal across related modules and agent outputs
  • Prompt-to-output trace reconstruction

βœ… Stored in Azure Cosmos DB (JSON) or PostgreSQL (relational).


πŸ“ Git Repositories in Azure DevOps

Each generated project, library, or microservice is committed to a dedicated Git repository with:

  • README.md, *.csproj, *.sln
  • Layered folders (Domain, Application, API, Tests, etc.)
  • Auto-committed by Code Committer Agent
  • PRs created by orchestrators and agents

Git metadata is cross-linked to memory entries via:

  • repoId, branch, commitHash
  • agentId, executionId, timestamp
  • execution-metadata.json β†’ points to memory used and emitted

βœ… Enables reproducibility, review, rollback, and memory audit via Studio or DevOps dashboard.


πŸ“Š Execution Metadata Example

Each agent’s output is coupled with an execution-metadata.json file:

{
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "traceId": "trace-abc123",
  "projectId": "proj-001",
  "moduleId": "booking-service",
  "filesEmitted": ["BookAppointmentHandler.cs", "CommandValidator.cs"],
  "durationMs": 1104,
  "status": "Success",
  "linkedMemoryIds": ["mem-456", "mem-789"]
}

βœ… Captured, indexed, and embedded into both structured memory and semantic search.


🧠 Unified Memory View

Agents and Studio users experience a merged view of all these sources:

  • Browse by module, blueprint, traceId, or type
  • Search by tags, keywords, or semantic similarity
  • View rendered outputs (docs, APIs, code) directly
  • Inspect execution logs, feedback, related events

βœ… Powered by Studio’s Knowledge Browser, API-backed metadata search, and semantic query layer.


βœ… Summary

ConnectSoft uses a multi-storage memory architecture that enables:

  • Efficient semantic retrieval (Vector DB)
  • Precise filtering and traceability (Metadata DB)
  • Durable and versioned artifact storage (Blob + Git)
  • Reproducible system generation (agent-to-output linkage)

This system enables agents to act with context, reusability, and traceable intelligence across every generated project, feature, and service.


Vector DB for Semantic Memory

In ConnectSoft, one of the most powerful aspects of the Knowledge and Memory System is the semantic memory layer, built on top of a vector database. This layer enables agents to retrieve prior knowledge not just by keywords or metadata, but by meaning and similarity.

Instead of re-generating blueprints, tests, handlers, or prompts from scratch, agents can search the vector memory for similar artifacts, instructions, or designs β€” and reuse or adapt them intelligently.


πŸ€– What Is Semantic Memory?

Semantic memory is a layer of embedded knowledge indexed in a vector space, where each knowledge item (e.g., blueprint, doc, test, prompt, README) is converted into a numeric vector using an embedding model.

These vectors are stored in a vector database, such as:

  • πŸ”Ή Azure AI Search with vector support
  • πŸ”Ή Qdrant
  • πŸ”Ή Pinecone
  • πŸ”Ή Weaviate
  • πŸ”Ή FAISS (local dev)

🧬 Embedding Models Used

The platform currently uses:

  • text-embedding-ada-002 (OpenAI) β€” default for short-to-medium text
  • Optional: instructor-xl, bge-large, or e5-mistral for fine-tuned internal use
  • Embeddings are 1536-2048 dimension float arrays

Each knowledge item is transformed into a vector once and stored alongside metadata.


🧠 What Gets Embedded?

All textual or code-based artifacts that are meaningful in natural language or structure:

Type Embedded? Notes
VisionDocument.md βœ… Yes Embeds strategic intent and goals
ServiceBlueprint.yaml βœ… Yes Flattened, cleaned, and embedded
README.md βœ… Yes Titles, summaries, usage examples
.feature BDD files βœ… Yes Intent-rich for test generation reuse
Prompt inputs βœ… Yes Stored as embeddings for later regeneration
Test case summaries βœ… Yes Clustered to detect redundant cases
Code files ⚠️ Partial Only embedded if human-labeled or auto-summarized
.bicep, .json infra ❌ No Stored in structured memory, not vectorized

🧠 Example Embedded Document

{
  "id": "mem-456",
  "text": "Create a service for managing appointments. It should allow booking, canceling, and rescheduling.",
  "embedding": [0.142, -0.031, 0.894, ...],
  "metadata": {
    "type": "vision",
    "agentId": "vision-architect",
    "projectId": "proj-001",
    "traceId": "trace-abc",
    "tags": ["booking", "appointment", "scheduling"],
    "tenantId": "vetclinic",
    "version": "1.0.0"
  }
}

πŸ” How Agents Use Vector Memory

Agents use a unified SDK method such as:

SemanticMemory.FindSimilarAsync(
  query: "generate handler for appointment booking",
  filter: new { type = "code", agentId = "backend-developer" },
  topK: 5
)

This retrieves a ranked list of similar documents with similarityScore, memoryId, and content.

Use cases include:

Agent Semantic Use Case
Test Generator Agent Find similar test specs to a given feature
Backend Developer Agent Retrieve past handler implementations
Blueprint Aggregator Suggest prior microservices with the same context
Vision Architect Agent Retrieve similar vision documents or domain patterns
Knowledge Management Agent Tag memory based on similarity clusters

πŸ“Š Semantic Query Result Example

[
  {
    "memoryId": "mem-789",
    "similarityScore": 0.9372,
    "type": "code",
    "filePath": "src/Application/Handlers/BookAppointmentHandler.cs",
    "tags": ["handler", "booking"],
    "source": "backend-developer"
  },
  {
    "memoryId": "mem-456",
    "similarityScore": 0.9110,
    "type": "blueprint",
    "filePath": "ServiceBlueprint.yaml",
    "source": "solution-architect"
  }
]

🧠 Filtering and Metadata Querying

Agents often use hybrid filtering (vector similarity + structured filter) such as:

  • type = "blueprint"
  • agentId = "solution-architect"
  • traceId = CURRENT_TRACE
  • moduleId = "booking-service"
  • tags includes ["appointment", "handler"]

This allows for context-aware reuse, avoiding incorrect or cross-tenant leakage.


⚑ Embedding Lifecycle

  1. βœ… Normalize input: Remove comments, truncate long code blocks
  2. βœ… Chunk if needed: For large docs, split into sections
  3. βœ… Generate embeddings
  4. βœ… Store in Vector DB with metadata
  5. βœ… Link to Blob/Git/Metadata DB with memoryId

β†’ Re-embedding is triggered automatically when:

  • The file changes substantially
  • New versions are published
  • Feedback loop suggests incorrect similarity

πŸ”„ Example: Test Generation via Memory

Prompt: β€œGenerate test cases for canceling an appointment”

Agent flow:

  1. Looks up prior .feature files with tags: ["appointment", "cancel"]
  2. Finds 5 relevant tests with high semantic match
  3. Reuses structure and validations
  4. Generates new test suite
  5. Stores new .feature file and embeds it

β†’ The agent didn’t start from scratch. It reasoned from experience.


🧠 Advanced Use Cases

Feature Description
Similarity-Based Prompt Generation Planner agent generates a new prompt using closest 3 prompts
Vector-Based Blueprint Deduplication Prevent generation of near-duplicate microservices
Multi-Vector Comparison Blend code+test+doc vectors to find related modules
Agent Retry Reasoning Use memory to avoid same failure cause in retry

βœ… Summary

The semantic memory layer in ConnectSoft is a powerful accelerator and enabler of intelligence:

  • Uses vector databases to store and retrieve embeddings of prior knowledge
  • Powers similarity search across prompts, blueprints, docs, tests, and code
  • Enables agents to reason by analogy, reuse past outputs, and act with continuity
  • Indexed, filtered, and scoped by traceId, agentId, skillId, moduleId, projectId, and tenantId

This memory layer bridges the gap between static storage and dynamic, AI-first agent behavior.


Structured Project Memory Model

In ConnectSoft, every project has its own isolated, composable memory graph, which evolves as the project progresses from vision to release. This scoped memory enables agents to reason locally β€” with full context of the domain, blueprint, prompts, decisions, failures, and generated artifacts β€” without leaking across unrelated modules or tenants.

This section defines the project memory model, how it's structured, when it's created, and how it grows during the software lifecycle.


🧠 What Is a Project Memory?

A Project Memory is the collection of all knowledge modules and execution records tied to a single project:

  • Scoped by projectId
  • Anchored with a unique traceId
  • Tagged by sprint, module, blueprint, agent, and skill
  • Accessed by agents via memory SDKs
  • Visualized in Studio and orchestrators

Think of it as a self-contained knowledge universe for a SaaS product, service, or blueprint scope.


🧬 Project Memory Initialization

When a new project is created (via ProjectBootstrapOrchestrator or Studio), the system:

  1. Issues a unique projectId and traceId
  2. Initializes a structured directory in:
    • Blob storage: /tenants/{tenantId}/projects/{projectId}/
    • Metadata DB: project_memory table
  3. Emits ProjectInitialized event
  4. Bootstraps metadata entry:
{
  "projectId": "proj-2025-0012",
  "tenantId": "vetclinic",
  "name": "BookingService",
  "status": "initialized",
  "traceId": "trace-123",
  "createdBy": "Studio",
  "modules": [],
  "sprints": []
}

πŸ“¦ What a Project Memory Contains

Category Contents
🧠 Prompts Initial user prompt, orchestrator intent, refined instructions
πŸ“„ Blueprints Vision doc, service blueprint, domain models, API specs
πŸ“š Documentation Generated summaries, readmes, integration notes
πŸ§ͺ Test Artifacts Generated .feature, .cs, test results, retries, logs
πŸ”§ Generated Code Domain, application, adapter, gateway, and infrastructure files
πŸ“œ Events & Contracts Event contracts, OpenAPI specs, pub/sub configs
πŸ“Š Execution Metadata All execution-metadata.json for every agent that contributed
πŸ’¬ Feedback Records Corrections, annotations, prompt overrides
πŸ“ˆ Telemetry Span traces, errors, performance metrics, retry loops

πŸ—‚οΈ Project Folder Structure (Blob + Git)

/projects/
  proj-2025-0012/
    trace-123/
      blueprint/
        VisionDocument.md
        ServiceBlueprint.yaml
        DomainModel.json
      src/
        Application/
        Infrastructure/
      tests/
        Booking.feature
        TestResults.xml
      docs/
        README.md
        Architecture.md
      contracts/
        booking.openapi.yaml
        AppointmentBooked.event.json
      metadata/
        execution-metadata.json
        sprint-trace-matrix.json

βœ… This layout is consistent across all services and agents.


πŸ”„ Project Memory Lifecycle Phases

Phase Events Triggered Memory Artifacts Added
Initialization ProjectInitialized project metadata scaffolded
Vision & Planning VisionDocumentCreated VisionDocument.md, initial prompt
Architecture & Modeling BlueprintCreated, DomainModelEmitted service blueprint, context map, domain aggregates
Code Generation MicroserviceScaffolded, ApiContractGenerated source code, contracts, OpenAPI
Testing TestSuiteGenerated, TestPassed/Failed .feature files, logs, results
Documentation DocumentationGenerated markdown files, diagrams, architecture summaries
Deployment ReleaseTriggered, InfraPlanCreated YAMLs, Bicep, container metadata, deployment logs
Feedback Loop AgentFailed, PromptRefined new prompt versions, regeneration trace

πŸ” Traceability Across Project Memory

Every artifact in the project memory is linked to:

  • agentId: Who generated it
  • skillId: Which skill or plugin was used
  • traceId: Which orchestration flow it belonged to
  • moduleId: Which feature or service it supports
  • version: Incremental version of the artifact
  • status: success, failed, regenerated

βœ… Enables full history reconstruction and replay for CI/CD, debugging, audits, or retraining.


πŸ” Project-Level Memory Query

Agents can scope memory queries like:

{
  "projectId": "proj-2025-0012",
  "moduleId": "booking-service",
  "type": "blueprint",
  "agentId": "solution-architect"
}

β†’ This returns all structured and embedded blueprints created during the planning phase.


πŸ“Š Studio & Orchestrator Access

The Studio and coordinator agents use project memory for:

  • Snapshot visualizations
  • Prompt regeneration with embedded feedback
  • PR trace visualization (CodeCommitterAgent)
  • Prompt diffing, history tracking, and feedback inspection
  • Memory replay for new editions or module variants

πŸ” Tenant-Scoped Isolation

Project memory is always scoped by:

  • tenantId
  • projectId
  • moduleId (when applicable)

This guarantees:

  • No memory leakage across tenants
  • Safe reuse within context
  • Strict RBAC for agent memory access

βœ… Summary

Every project in ConnectSoft has its own scoped memory universe:

  • Begins at project creation and evolves over time
  • Records every prompt, blueprint, artifact, test, and document
  • Enables traceability, feedback-driven refinement, and intelligent reuse
  • Powers the event-driven, AI-first lifecycle through memory hooks

This structured memory enables agents to generate entire products with contextual awareness, continuity, and correctness.


Knowledge Schema and Metadata

Every piece of knowledge stored in ConnectSoft’s memory system β€” whether it's a .cs file, .md document, OpenAPI spec, or .feature test β€” is paired with a rich metadata schema. This metadata ensures traceability, retrievability, observability, and reuse.

This section defines the structure and usage of the Knowledge Metadata Model used across all memory modules.


🧠 Why Metadata Matters

Metadata is the index and signature of every memory artifact. It allows agents and humans to:

  • Filter, query, and retrieve relevant knowledge
  • Reconstruct execution context and origin
  • Link outputs to prompts, skills, and agent decisions
  • Determine reuse opportunities based on similarity and history
  • Enforce lifecycle, retention, and governance policies

Without metadata, memory is unstructured data. With metadata, it becomes a living intelligence map.


πŸ“¦ Core Knowledge Metadata Fields

Each memory module β€” regardless of its format β€” includes the following required fields in its metadata:

Field Type Description
memoryId string Unique ID for this memory entry
projectId string Which project this memory belongs to
moduleId string Which microservice/module it is associated with
traceId string Which execution flow it was generated from
agentId string Agent that emitted this knowledge
skillId string Skill or plugin used to generate the artifact
type enum One of: code, test, doc, blueprint, contract, etc.
filePath string Path in blob or Git where the file resides
version string Semantic version of the artifact (e.g., 1.0.3)
createdAt datetime UTC timestamp of creation
tags string[] Array of tags for filtering and retrieval
source enum generated, imported, curated, retrieved
status enum success, failed, partial, deprecated, etc.
tenantId string Tenant associated with the memory
semanticHash string Hash of the original content (used for similarity and diffing)
embeddingId string Link to vector DB embedding (if available)
linkedTo string[] List of related memory IDs (e.g., test linked to blueprint)

πŸ“˜ Example Metadata JSON

{
  "memoryId": "mem-1234abcd",
  "projectId": "proj-2025-0012",
  "moduleId": "booking-service",
  "traceId": "trace-abc-2025",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "type": "code",
  "filePath": "src/Application/Handlers/BookAppointmentHandler.cs",
  "version": "1.0.3",
  "createdAt": "2025-05-12T14:32:17Z",
  "tags": ["handler", "booking", "command"],
  "source": "generated",
  "status": "success",
  "tenantId": "vetclinic",
  "semanticHash": "1fe6be...",
  "embeddingId": "embed-98f22e",
  "linkedTo": ["mem-9876fff", "mem-3322abc"]
}

πŸ”– Metadata Extension Fields (Optional)

Agents and curators can enrich metadata with additional properties:

Field Description
usageCount Number of times this memory was retrieved
feedbackRating Curated score (1–5) from human review
curatedBy User who approved or enhanced the artifact
regenerationCount Number of regeneration attempts for this output
blueprintId The blueprint document that defined this need
milestoneId Sprint or milestone that included this memory
auditTrail Chain of agent decisions or skill lineage

🧩 Metadata Storage Locations

  • πŸ”Ή Structured Metadata DB (CosmosDB / PostgreSQL): primary source of indexed records
  • πŸ”Ή Blob Metadata Layer: stored as sidecar execution-metadata.json or artifact.meta.json
  • πŸ”Ή Git Commits: can include metadata in commit message footer or .meta.json in repo
  • πŸ”Ή Vector DB: stores a subset of metadata used during retrieval (e.g., type, tags, agentId)

πŸ” Querying Knowledge by Metadata

Agents, Studio, and orchestrators can filter memory using metadata fields:

{
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "projectId": "proj-2025-0012",
  "moduleId": "booking-service",
  "type": "code",
  "tags": ["appointment", "handler"]
}

β†’ Returns all code memory entries created by the Backend Developer Agent during the handler generation for this project/module.


⚠️ Metadata Validation Rules

  • memoryId, projectId, agentId, and traceId are mandatory
  • version must conform to semantic versioning (e.g., 1.0.0, 2.1.3)
  • type must be selected from controlled vocabulary:

  • code, test, doc, blueprint, infra, contract, event, prompt, metadata

  • status is validated against execution results or failure events
  • semanticHash must be generated from artifact content using SHA-256 or similar
  • embeddingId must exist if memory is in vector DB

πŸ”’ Security and Isolation Fields

To support multi-tenant memory safety:

  • tenantId ensures data is isolated per customer
  • RBAC policies filter memory by projectId + agentId + type
  • Access tokens in Studio and Orchestrator API are scoped accordingly

🧠 Metadata Inheritance & Propagation

Some fields are inherited automatically when generating derived artifacts:

Parent Memory Inherited by
ServiceBlueprint.yaml All generated handlers, DTOs, validators
VisionDocument.md Contextual metadata for product spec
AppointmentBooked.event.json Linked test cases and message consumers

This supports lineage tracking and blueprint-to-output auditability.


βœ… Summary

The Knowledge Metadata Schema defines how ConnectSoft:

  • Indexes, queries, and traces every knowledge artifact
  • Ensures tenant isolation, artifact governance, and data versioning
  • Links memory across agents, traces, modules, and generations
  • Supports semantic + structured memory fusion across all storage layers

This schema enables the platform to understand not just what was created β€” but why, when, by whom, and how it can be reused.


Memory-Oriented Agent Behaviors

In ConnectSoft, every agent is more than a code generator or prompt executor β€” it is a memory-aware cognitive entity. Agents leverage memory to enhance autonomy, avoid redundant work, reuse prior solutions, and continuously improve through feedback.

This section describes how different types of agents interact with the knowledge and memory system, including how they query, write, refine, and react to memory during execution.


🧠 Memory as a First-Class Input

Before performing a skill or task, every agent queries the memory system to retrieve relevant knowledge based on:

  • projectId, traceId, moduleId
  • skillId, type, agentId
  • Prompt history
  • Related artifacts (via embedding similarity)

Agents never operate in isolation β€” they act within a semantic and historical context retrieved from memory.


🧩 Agent Memory Behaviors: Modes

Behavior Description
Memory Query Find similar blueprints, code, tests, docs, or prior prompts
Memory Write Persist generated artifacts with full metadata + trace context
Memory Feedback Emit Mark artifacts as failed, outdated, or needing regeneration
Memory Enrichment Suggest better tags, references, or annotations
Memory Diffing Compare current output with prior memory for reuse or improvement

πŸ€– Agent Examples and Their Memory Usage

1. Vision Architect Agent

  • πŸ“₯ Retrieves similar vision documents
  • πŸ“€ Stores VisionDocument.md with strategic goals
  • 🧠 Learns which language patterns yield best blueprints

2. Product Manager Agent

  • πŸ“₯ Reuses product requirement prompts from similar domains
  • πŸ“€ Persists feature list and backlog artifacts
  • 🧠 Annotates modules with tags: feature, requirement, edition

3. Solution Architect Agent

  • πŸ“₯ Queries prior service blueprints for similar business contexts
  • πŸ“€ Stores ServiceBlueprint.yaml and ContextMap.json
  • 🧠 Reuses aggregate patterns from project memory

4. Backend Developer Agent

  • πŸ“₯ Retrieves similar handler code or DTO classes
  • πŸ“€ Stores .cs files with metadata per layer and aggregate
  • 🧠 Avoids regenerating duplicate services

5. Test Generator Agent

  • πŸ“₯ Pulls .feature files for similar use cases
  • πŸ“€ Persists new tests with structured BDD metadata
  • 🧠 Avoids generating overlapping tests via semantic match

6. QA Engineer Agent

  • πŸ“₯ Queries test memory and failure logs
  • πŸ“€ Emits result logs, annotated failure summaries
  • 🧠 Marks unstable flows for review or regression coverage

7. Cloud Provisioner Agent

  • πŸ“₯ Finds matching Bicep or YAML configs for similar blueprints
  • πŸ“€ Stores infrastructure as code artifacts under infra type
  • 🧠 Reuses deployment patterns across tenants and projects

8. Knowledge Management Agent

  • πŸ“₯ Clusters related knowledge chunks
  • πŸ“€ Enhances memory with tags, summaries, linked references
  • 🧠 Tracks gaps and emits MemoryImprovementSuggestion

πŸ”„ Memory Lifecycle Hooks in Agent Execution

Each agent interacts with memory across these phases:

Phase Action
Pre-Execution Semantic + structured memory query (SK + filters)
Execution Uses memory to shape output (e.g., β€œcopy this pattern”)
Post-Execution Stores results with full metadata
Post-Failure Emits AgentFailed with diagnostic memory reference
Review/Feedback Accepts suggestions from other agents or Studio

βœ… These hooks are automatically managed by orchestrators and agent scaffolding libraries.


🧬 Skill-Aware Memory Scoping

Each skill (function or plugin) has access to scoped memory entries based on:

  • agentId, skillId, projectId, moduleId
  • type (e.g., test, blueprint, doc)
  • Optional filters like tags or semantic similarity
{
  "skillId": "GenerateOpenApi",
  "filters": {
    "type": "contract",
    "tags": ["booking", "appointment"]
  }
}

🧠 How Agents Use Memory to Adapt

Scenario Agent Behavior
Similar use case found Agent reuses code/test/doc with slight adaptation
No prior memory found Agent generates from scratch
Failure occurred on prior attempt Agent adjusts prompt or strategy based on AgentFailed memory
Blueprint changes upstream Agent invalidates cached outputs, regenerates from updated input
Memory was flagged by user or feedback Agent uses feedback to retrain or suggest replacement

πŸ“˜ Real-World Interaction Example

Prompt: "Generate a service for appointment cancellations."

Flow:

  1. Solution Architect Agent retrieves similar ServiceBlueprint.yaml from project memory
  2. Backend Developer Agent queries handlers related to cancel operations
  3. Test Generator Agent finds existing .feature files from cancellation tests
  4. All new outputs are persisted with links to retrieved memory
  5. Knowledge Management Agent clusters the cancellation-related modules for reuse

πŸ” Security, Scoping, and Isolation

Agents can only access memory within their authorized boundary:

  • Scoped by tenantId, projectId, moduleId, agentRole
  • Cannot retrieve or overwrite memory outside scope
  • Sensitive prompts or results may be flagged as private

Agents operate under strict memory governance enforced by metadata filters and orchestrator policies.


βœ… Summary

Memory-aware agents are at the heart of ConnectSoft’s automation strategy. Each agent:

  • Reads memory before acting
  • Writes memory after generating outputs
  • Links outputs to inputs, context, and trace
  • Learns from memory via feedback and failure signals
  • Collaborates via memory graphs and shared execution state

This architecture ensures that the factory behaves like an intelligent, evolving system, not just a template engine.


Event-Driven Ingestion

In ConnectSoft, the creation and population of memory is not a manual step β€” it is an automated consequence of event-driven execution. Every meaningful state transition in the software factory β€” whether a prompt is submitted, a handler is generated, or a test fails β€” is captured through an event, which in turn triggers memory ingestion.

This section explains how the event-driven architecture (EDA) powers the memory system, ensuring that all knowledge is emitted, recorded, and enriched without human intervention.


⚑ Memory Is Triggered by Events

β€œIf it matters, it emits an event. If it emits an event, it creates memory.”

The memory ingestion pipeline listens to lifecycle, domain, and agent events, such as:

Event Triggers Memory Creation For
ProjectInitialized Project metadata scaffold
VisionDocumentCreated Vision document .md
ServiceBlueprintCreated Blueprint YAML + inferred domain model
MicroserviceScaffolded Code files + tests + infra
AgentOutputGenerated Any .cs, .feature, .yaml, .json file
PromptRefined Revised prompt β†’ memory snapshot
AgentFailed Execution trace + logs + failure diagnostic memory
TestSuiteGenerated .feature files with BDD structure
DocumentationGenerated README.md, Architecture.md, generated doc pages
ExecutionCompleted execution-metadata.json with links to all outputs

🧠 Event-Driven Memory Flow

sequenceDiagram
    participant Agent
    participant EventBus
    participant MemoryIngestor
    participant VectorDB
    participant MetadataDB
    participant BlobStorage

    Agent->>EventBus: Emit AgentOutputGenerated
    EventBus->>MemoryIngestor: Deliver event with payload
    MemoryIngestor->>BlobStorage: Store raw files
    MemoryIngestor->>VectorDB: Embed and store vector (if textual)
    MemoryIngestor->>MetadataDB: Index metadata record
    MemoryIngestor->>EventBus: Emit MemoryStored
Hold "Alt" / "Option" to enable pan & zoom

β†’ This pattern applies to every artifact-producing agent or orchestrator.


🧩 Examples of Event-Powered Ingestion

🧠 From Agent Execution

  1. Backend Developer Agent emits AgentOutputGenerated
  2. Memory ingestor captures .cs files
  3. Stores in:
    • Blob: /src/Application/Handlers/*.cs
    • Metadata DB: with traceId, skillId, agentId
    • Vector DB: if summary or docstring is extracted

πŸ“„ From Blueprint Creation

  1. Solution Architect Agent emits ServiceBlueprintCreated
  2. ServiceBlueprint.yaml is ingested as:
    • Structured memory (type: blueprint)
    • Embedded document for semantic recall
    • Tagged with boundedContext, aggregates, eventTypes

πŸ§ͺ From Test Failure

  1. TestRunner emits TestFailed event
  2. Memory record created with:
    • Linked .feature file
    • Failure logs
    • Feedback flag
    • Status: failed

πŸ” Memory Indexing from Events

Every event includes metadata for indexing:

{
  "event": "AgentOutputGenerated",
  "agentId": "backend-developer",
  "traceId": "trace-abc",
  "skillId": "GenerateHandler",
  "projectId": "proj-001",
  "moduleId": "booking-service",
  "outputs": [
    "BookAppointmentHandler.cs",
    "CommandValidator.cs"
  ]
}

The Memory Ingestor service:

  • Parses outputs
  • Generates metadata records
  • Embeds documents if textual
  • Stores blob pointer
  • Links to execution metadata

πŸ” Idempotent Ingestion via Event Replay

All ingestion steps are idempotent and event-replayable:

  • Events are stored durably in an event log
  • Memory ingestion can be replayed or backfilled
  • Coordinators can issue ReplayMemoryFor(traceId) to restore memory for a failed or expired flow

βœ… Enables full rebuild of memory state from history.


πŸ“Š Observability of Ingestion Events

Every ingestion emits:

  • MemoryStored
  • MemoryLinked
  • EmbeddingCreated
  • MemoryIngestFailed

These are shown in:

  • Studio trace explorer
  • Observability dashboards
  • Audit logs (per tenant, project, artifact)

🧱 Orchestrator Integration

All orchestrators β€” e.g., MicroserviceAssemblyCoordinator, MilestoneLifecycleCoordinator β€” are memory-ingestion-aware:

  • They wait for MemoryStored events before advancing FSMs
  • They link FSM state to ingested memory (fsm-metadata.json)
  • They annotate decisions with memory references

πŸ” Governance & Security

Event-driven ingestion respects:

  • tenantId, projectId, agentId scope
  • Memory redaction policies (e.g., redact prompt if sensitive = true)
  • RBAC enforcement at ingestion time

Memory is never ingested globally β€” always scoped and access-controlled.


βœ… Summary

In ConnectSoft:

  • Memory is created automatically through the event system
  • Every output-producing action emits an event
  • Events trigger ingestion into blob, vector DB, and metadata stores
  • Memory stays traceable, observable, and replayable

This event-driven approach ensures that every blueprint, handler, test, and document becomes memory without extra effort β€” enabling full-context reuse and intelligent agent behavior at scale.


Per-Module Memory

In ConnectSoft, every generated module β€” whether it's a microservice, gateway, library, adapter, test suite, or infrastructure definition β€” has its own scoped memory zone. This enables agents to reason about, retrieve, regenerate, or improve a module in isolation, while preserving traceability across the broader project lifecycle.

This section describes how per-module memory is defined, structured, retrieved, and used in orchestration.


🧱 What Is a Module in ConnectSoft?

Modules are independent, versionable, observable, and reusable units that represent logical or technical boundaries. Examples include:

Module Type Examples
🧱 Microservice BookingService, InvoiceService
🌐 API Gateway Gateway.Api.v1.yaml
πŸ“š Library ConnectSoft.Extensions.Http.OAuth2
πŸ“¦ Adapter TwilioSmsAdapter, S3UploaderAdapter
πŸ“Š Test Suite BookingService.Tests
πŸ›  Infra Module booking-db.bicep, queue.bicep
πŸ”§ Domain Contract AppointmentBooked.event.json

βœ… All of these are first-class memory scopes.


πŸ“¦ Memory Structure per Module

Each module has:

  • πŸ“ A physical folder in blob storage and/or Git:
    /projects/{projectId}/modules/{moduleId}/
    
  • 🧾 A logical index of all memory artifacts tied to moduleId
  • πŸ“„ Individual files (e.g., code, tests, configs, contracts)
  • 🧠 Semantic memory embeddings (if textual)
  • πŸ”— Links to execution metadata (traceId, agentId, skillId)

πŸ“˜ Example Module Memory Structure

/modules/
booking-service/
  blueprint/
    ServiceBlueprint.yaml
  src/
    Application/
      Handlers/
        BookAppointmentHandler.cs
        CancelAppointmentHandler.cs
  tests/
    CancelAppointment.feature
    test-log.json
  docs/
    README.md
    Architecture.md
  infra/
    booking-db.bicep
  metadata/
    execution-metadata.json
    memory-index.json

This folder is scoped to moduleId: booking-service.


πŸ”– Metadata Anchoring by Module

All memory entries include:

{
  "moduleId": "booking-service",
  "projectId": "proj-2025-0012",
  "traceId": "trace-xyz",
  "type": "code",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler"
}

This allows:

  • Full-text + vector + structured queries scoped to module
  • Trace reconstruction of who/what/when generated the module
  • Triggering regeneration flows at the module boundary

πŸ”„ Why Per-Module Memory Matters

Capability Benefit
πŸ” Selective regeneration Rebuild only the NotificationService, not the whole system
πŸ” Targeted memory search Agents don’t get overwhelmed by unrelated data
⚠️ Failure isolation Failures tied to a specific moduleId can be retried safely
πŸ§ͺ Modular testing and validation QA agents can scope to tests/ of a specific module
πŸ“¦ Reuse and versioning Modules can be reused across projects and tenants
🧠 Semantic context precision Embeddings stored per module = better relevance

🧠 Agent Use Case: Module Memory Query

{
  "moduleId": "booking-service",
  "type": "blueprint",
  "tags": ["appointment", "handler", "cancel"]
}

Returns all relevant memory for cancellation logic inside the booking module β€” including handler code, test cases, and prior failure diagnostics.


🧩 Studio Use Case: Module Memory Dashboard

In Studio, each module displays:

  • βœ… Memory size (file count, MB)
  • βœ… Agent contributors (who generated what)
  • βœ… Version history of code and blueprints
  • βœ… Test pass/fail rates
  • βœ… Links to Git commits, blob storage, and execution events
  • βœ… Option to regenerate module memory or clear stale entries

πŸ” Ingestion and Retrieval Flow

  1. Agent generates artifacts for booking-service
  2. Emits AgentOutputGenerated with moduleId
  3. Memory ingestor:
    • Stores files in /modules/booking-service/
    • Embeds textual files to vector DB
    • Indexes metadata tagged with moduleId
  4. Future agents use this moduleId to retrieve memory context

πŸ” Access Control and Isolation

Each module’s memory is governed by:

  • tenantId (multi-tenant isolation)
  • projectId (cross-project protection)
  • moduleId (agent-scoped boundary)
  • agentId/skillId (role-based filtering)

Agents can’t access modules they didn’t help generate unless permissions allow (e.g., Test Generator may see all modules).


πŸ“Š Observability and Traceability

Each module emits:

  • MemoryStored (per artifact)
  • ModuleMemoryUpdated
  • ExecutionMetadataCreated

These link to:

  • Execution trace graphs
  • Sprint milestone dashboards
  • Studio’s module memory view

βœ… Summary

Per-module memory is a critical capability that enables:

  • Isolated generation, regeneration, and reuse
  • Scoped and secure memory access
  • Agent specialization per module
  • Traceability, modular testing, and performance analysis
  • Evolution of each SaaS component as an autonomous unit

Per-Agent Memory

In ConnectSoft, each AI agent is not a stateless function β€” it’s a cognitive persona with its own memory of past actions, outputs, prompts, decisions, and context-specific knowledge. This memory enables agents to act intelligently, consistently, and adaptively across tasks, modules, and projects.

This section defines how agents maintain personal memory scopes β€” to reason from history, avoid redundant work, reuse successful outputs, and learn from feedback.


🧠 What Is Per-Agent Memory?

Per-agent memory is the subset of the memory system scoped to an individual agent, including:

  • All outputs generated by that agent
  • Artifacts created via specific skills or responsibilities
  • Prompts used and refined
  • Failures, retries, and corrections
  • Skill-specific examples, code snippets, templates, and usage patterns

Think of it as the agent’s personal journal β€” structured, semantic, and versioned.


πŸ€– What It Enables

Capability Description
βœ… Output reuse Reuse previously generated handlers, prompts, test cases
βœ… Prompt refinement Reuse or improve earlier prompt strategies
βœ… Skill grounding Use skill-specific examples during execution
βœ… Learning from failure Adjust generation strategy based on AgentFailed memory
βœ… Avoiding redundancy Prevent agent from regenerating what it already produced
βœ… Personalized behavior Remember preferences, conventions, patterns per agent-role-skill

πŸ“¦ What Per-Agent Memory Includes

Memory Type Description
promptHistory Prompt/response pairs used by the agent
artifactHistory Files and outputs generated by the agent
execution-metadata Metadata files (duration, status, traceId)
skillMemory Templates, examples, reusable logic per skill
feedbackLoop Past failures, feedback, and correction attempts
usageStats Frequency, reuse count, similarity metrics

🧾 Per-Agent Memory Key Fields

Field Description
agentId Unique agent identity (e.g., qa-engineer, test-generator)
skillId Skill/function used (e.g., GenerateHandler, ComposeTest)
projectId Optional scope (if tied to a specific project)
traceId Which execution trace produced this output
version Version of the agent or skill logic
status success, failed, retried, feedbackAccepted
memoryId ID of stored memory entries linked to this agent

🧩 Agent Skill Memory Example

Let’s take the Test Generator Agent.

It stores memory such as:

{
  "agentId": "test-generator",
  "skillId": "ComposeFeatureTest",
  "type": "test",
  "filePath": "tests/CancelAppointment.feature",
  "tags": ["appointment", "cancel", "edge-case"],
  "prompt": "Write a test for canceling appointments under 1 hour notice",
  "responseExcerpt": "Scenario: Cancel within one hour",
  "feedback": "Generated invalid step syntax. Regenerated successfully.",
  "status": "success"
}

βœ… This allows future generations to adapt, reuse, or avoid past mistakes.


πŸ”„ Per-Agent Feedback Loop

When an agent fails or is corrected:

  1. AgentFailed or AgentFeedbackSubmitted event is emitted
  2. Memory is updated with:
    • Failure context
    • Prompt, output, logs
    • Correction or regenerated version
  3. Agent learns to:
    • Retry with a different skill
    • Use a new prompt template
    • Avoid the failed approach on similar inputs

πŸ” Agent Memory Retrieval Example

When a planner invokes api-designer, the orchestrator injects memory:

{
  "agentId": "api-designer",
  "skillId": "GenerateOpenApi",
  "filters": {
    "type": "contract",
    "tags": ["booking", "appointment"]
  },
  "topK": 3
}

βœ… The agent receives the 3 most similar OpenAPI specs it previously created, to influence the new one.


πŸ“š Studio Support for Agent Memory

In the Studio dashboard:

  • πŸ“Š View all memory entries generated by an agent
  • 🧠 Browse past prompt-response pairs
  • ⚠️ See failures and retry decisions
  • πŸ” Trigger manual feedback or regeneration
  • 🧱 Visualize which skills contribute the most memory

πŸ›  Agent Templates Using Personal Memory

Agents use memory in:

  • πŸ’‘ Planning: choosing blueprint strategy
  • πŸ§ͺ Generation: grounding outputs with successful past results
  • πŸ” Retry: switching strategy after failure
  • πŸ“€ Documentation: composing based on examples
  • πŸ”— Test Creation: adapting reusable test templates

πŸ” Agent-Specific Isolation Rules

  • Each agent can read and write only to its own agentId memory zone
  • Orchestrators may inject memory across agents if permitted (e.g., reuse test memory in blueprint planning)
  • Memory is tenant-scoped and project-aware

βœ… Summary

Every ConnectSoft agent maintains a rich personal memory scope that includes:

  • Prior prompts, outputs, and feedback
  • Generated files and test cases
  • Semantic embeddings and trace metadata
  • Skill-specific artifacts and usage patterns

This enables agents to be:

  • Smarter with every run
  • Less redundant over time
  • More reusable across blueprints, features, and services

Per-Project Memory

In ConnectSoft, every SaaS product, module collection, or customer-specific solution is anchored to a Project, and each project maintains a complete, unified memory scope that reflects everything that was planned, generated, tested, failed, refined, or reused across its lifecycle.

This section focuses on how per-project memory enables end-to-end traceability, context-rich orchestration, reuse across modules, and studio-level navigation for intelligent agent collaboration.


🧠 What Is Per-Project Memory?

A Project Memory is a container for all knowledge and memory modules tied to a single projectId, including:

Memory Type Contents
πŸ’¬ Prompts Vision prompt, blueprint instructions, refined queries
πŸ“„ Blueprints Vision docs, service definitions, context maps, event topologies
πŸ”§ Code & Artifacts Handlers, DTOs, APIs, infra, adapters, libraries
πŸ“š Documentation Markdown docs, README.md, HowItWorks.md, API summaries
πŸ§ͺ Test Suites .feature files, test results, logs, validations
πŸ“œ Contracts & Specs OpenAPI, domain events, queue and pub/sub interfaces
πŸ“Š Execution Metadata All execution-metadata.json, sprint-trace-matrix.json, fsm-state
🧠 Agent Reasoning Data Skill decisions, retries, feedback chains

βœ… This memory scope evolves from ProjectInitialized through every milestone and release.


🧩 Project Memory Hierarchy

Memory is structured hierarchically per project:

/tenants/
  vetclinic/
    projects/
      booking-platform/
        projectId: proj-2025-0009
        traceId: trace-xyz
        modules/
          booking-service/
          notification-service/
          identity-gateway/
        tests/
          Booking.feature
        blueprints/
          VisionDocument.md
          ServiceBlueprint.yaml
        metadata/
          execution-metadata.json
          sprint-trace-matrix.json

πŸ”– Metadata Fields Anchored to Project

Every memory entry (code, doc, test, contract) is indexed by:

Field Role
projectId Defines project memory scope
traceId Ties execution flows to the project
tenantId Ensures multi-tenant isolation
moduleId Scoped child memory under the project
agentId Who generated the memory inside the project

πŸ” Agent Memory Filtering by Project

Agents can query memory with:

{
  "projectId": "proj-2025-0009",
  "moduleId": "booking-service",
  "type": "test",
  "tags": ["cancel", "appointment"]
}

β†’ Retrieves test cases for cancellation flows inside the current project.


🧠 How Project Memory Enables Smart Agents

Scenario How Project Memory Helps
Generate new module Provides blueprint context, naming, domain boundaries
Regenerate failed artifact Retrieves prompt, context, and prior version
Test case creation Suggests tests from sibling modules in the same project
Retry agent failures Pulls prior inputs, outputs, logs, and enriched corrections
Edition versioning Applies memory snapshots from previous edition

πŸ”„ Studio Features Using Project Memory

Feature Description
πŸ“š Memory Browser Browse all artifacts in a project
🧠 Prompt Replay Rerun or refine original prompt with new skills
πŸ“Š Execution History Viewer View all agent actions across modules
πŸ§ͺ Test Coverage Map See which modules are tested, which are failing
πŸ“¦ Knowledge Export Export project memory as reproducible package
πŸ” Memory Replay Replay trace to regenerate artifacts on new stack

πŸ”„ Lifecycle Evolution of Project Memory

Phase Events Triggered Memory Modules Created
πŸ”Ή Init ProjectInitialized project metadata scaffold
🧠 Planning VisionDocumentCreated, BlueprintCreated vision/blueprint documents
βš™οΈ Generation MicroserviceScaffolded, AdapterGenerated code files, APIs, tests
πŸ§ͺ Testing TestSuiteGenerated, TestFailed .feature, logs, retry metadata
πŸ“„ Documentation DocumentationGenerated README.md, integration notes
πŸš€ Deployment ReleaseTriggered, InfraPlanCreated bicep, container config, deployment summary

πŸ” Security and Multi-Tenant Memory Partitioning

Each project memory is isolated via:

  • tenantId
  • projectId
  • RBAC per agent or user
  • Studio-scoped access tokens

No agent may access another tenant’s project memory unless explicitly permitted.


🧭 Orchestration + Project Memory

Orchestrators store per-project:

  • fsm-state.json
  • milestone-checklist.json
  • execution-metadata.json

They retrieve memory scoped to the project at each milestone:

{
  "projectId": "proj-2025-0009",
  "milestoneId": "M4-Generate-Infra",
  "type": "infra",
  "moduleId": "booking-service"
}

βœ… Summary

Per-project memory enables:

  • Unified traceable history for every artifact and decision
  • Intelligent reuse across modules within the same blueprint
  • Full lifecycle replay, test coverage, and refinement tracking
  • Modular orchestration and milestone-based retrieval
  • Studio-powered visibility and human-AI collaboration

Project memory turns your blueprint into a living, growing knowledge graph β€” not just a one-time generation.


Versioning of Knowledge Artifacts

In ConnectSoft, memory is not static. As projects evolve, agents regenerate modules, refine prompts, fix bugs, replan blueprints, or adapt infrastructure β€” all of which produce new versions of artifacts. Every meaningful knowledge module is versioned, ensuring auditability, rollback, reuse, and continuous improvement.

This section describes how memory artifacts are versioned, how versions are tracked, diffed, compared, and how agents and orchestrators handle version-aware memory.


πŸ”’ Why Versioning Matters

Versioning enables:

  • πŸ” Safe regeneration of memory without overwriting past outputs
  • πŸ” Tracking the evolution of modules, prompts, and decisions
  • πŸ“Š Comparing results between blueprint versions or AI skills
  • πŸ’¬ Explaining β€œwhat changed” and β€œwhy it was changed”
  • βœ… Reverting failed generations or experiments to a stable state

πŸ“¦ Versionable Knowledge Artifacts

All of the following memory items are versioned:

Artifact Type Versioned? Notes
ServiceBlueprint.yaml βœ… Yes Versioned per blueprint evolution
.cs source files βœ… Yes New handler = new semantic version
.feature tests βœ… Yes Each regenerated test creates a new test version
.bicep, .yaml βœ… Yes Infra-as-code tracked with version bumps
README.md βœ… Yes Auto-documented outputs are versioned too
execution-metadata.json βœ… Yes Stored per run with version trace context

🧠 Version Fields in Metadata

Each memory module includes:

{
  "memoryId": "mem-xyz",
  "version": "1.3.0",
  "source": "generated",
  "status": "success",
  "isLatest": true,
  "previousVersionId": "mem-abc",
  "changeType": "refactor",
  "changeReason": "Prompt refined after test failure"
}

βœ… These fields form the version chain for every artifact and enable safe navigation.


πŸ“˜ Semantic Versioning Model

ConnectSoft uses SemVer style versioning for memory:

  • MAJOR: Breaking change in contract, signature, or input/output shape
  • MINOR: Additive or refinable content (e.g., more test cases)
  • PATCH: Cosmetic or internal improvement without contract change

Example:

Version Description
1.0.0 Initial agent-generated blueprint
1.1.0 Added fallback route, more events
1.1.1 Removed unused handler, fixed typo
2.0.0 Entire new contract schema

πŸ” Version Resolution for Agents

When agents fetch memory, they may:

  • Use only the isLatest: true version
  • Fetch all historical versions for reasoning
  • Query by version >= 1.2.0 AND < 2.0.0
  • Detect and diff between v1.0.0 and v2.0.0

β†’ This allows flexible retrieval strategies based on context, risk tolerance, and trace history.


🧩 Examples of Versioned Artifacts

Service Blueprint

version: 1.2.0
projectId: proj-abc
traceId: trace-123
moduleId: invoice-service
generatedBy: solution-architect
changes:
  - Added LateFeePolicy aggregate
  - Refactored PaymentProcessing handler

Test File

tests/Booking.feature
v1.0.0 - initial case: cancel appointment
v1.1.0 - added edge case: cancel within 1 hour
v1.1.1 - fixed scenario title casing

πŸ”„ Diffing Between Versions

When a new version is generated:

  • The Memory Ingestor computes a semanticHash
  • Diffs are calculated at the:

  • File level (textual diff)

  • Semantic level (e.g., contract shape, behavior change)
  • Stored as diff.json in the memory folder
  • Studio renders it as a changelog preview

πŸ” Versioning in Studio

Users and agents in Studio can:

  • πŸ•ΉοΈ Select a specific memory version
  • πŸ” View changelog and diff preview
  • πŸ”„ Revert to a prior version
  • πŸ§ͺ Run regression tests between versions
  • πŸ“¦ Snapshot all modules at version X for backup or edition packaging

🧠 Agents Can Trigger Version Bumps

Agents emit versioned artifacts when:

  • A prompt was changed
  • A failure required regeneration
  • A blueprint was updated
  • A new skill version was used

Coordinators enforce bumpVersion = true if major change detected.


🧾 Versioned Memory Paths

Stored per module:

/modules/booking-service/src/v1.0.0/BookAppointmentHandler.cs
/modules/booking-service/src/v1.1.0/BookAppointmentHandler.cs
/modules/booking-service/tests/v1.0.0/Cancel.feature

Each path is linked to its memoryId, version, and trace.


βœ… Summary

In ConnectSoft, every knowledge artifact is:

  • Versioned and traceable
  • Linked to events, prompts, agents, and changes
  • Retrievable and diffable
  • Revertible and reusable across projects and editions

This ensures that memory evolves intelligently, safely, and observably β€” empowering agents to generate software like an iterative, memory-aware development team.


Multi-Project Knowledge Graph

ConnectSoft is designed to operate at massive scale β€” building and evolving thousands of SaaS services, libraries, and templates across industries, domains, and tenants. To support this scale while maximizing reusability and intelligence, the platform constructs a multi-project knowledge graph β€” a cross-project memory index that connects blueprints, tests, prompts, services, and contracts by meaning, lineage, and modular structure.

This section defines how ConnectSoft builds and queries a global memory graph that spans all projects without breaking tenant boundaries or module traceability.


🌐 What Is the Multi-Project Knowledge Graph?

A multi-project knowledge graph is a semantic, structural, and traceable web of memory nodes representing:

  • πŸ’‘ Prompts and input intent
  • πŸ“„ Blueprints and context maps
  • βš™οΈ Microservice modules and adapters
  • πŸ“š Libraries and templates
  • πŸ§ͺ Tests and validations
  • πŸ“œ Contracts and API interfaces
  • πŸ“Š Feedback and failure diagnostics

Each node is versioned, typed, and scoped β€” and linked to related nodes via:

  • πŸ”— Similarity (vector-based)
  • πŸ”— Reuse (shared template, event, code pattern)
  • πŸ”— Causality (agent generated from blueprint)
  • πŸ”— Correction (version B fixed version A)
  • πŸ”— Composition (module A depends on module B)

πŸ“˜ Graph Structure Example

graph TD
  Vision1["Vision: Booking"]
  Blueprint1["Blueprint: BookingService v1.1"]
  Handler1["Handler: BookAppointmentHandler.cs"]
  Test1["Test: Booking.feature"]
  Prompt1["Prompt: Generate service for booking"]

  Vision1 --> Blueprint1
  Blueprint1 --> Handler1
  Handler1 --> Test1
  Prompt1 --> Blueprint1
  Test1 -->|Similar to| Test2["Test: ReserveTable.feature"]
Hold "Alt" / "Option" to enable pan & zoom

β†’ These nodes span multiple projects but share a semantic relationship.


🧠 What the Graph Enables

Use Case Benefit
🧬 Reuse Discovery Find prior handlers/tests with same domain or structure
πŸ” Similar Blueprint Reuse Suggest blueprints from other projects to avoid duplication
πŸ§ͺ Test Case Transfer Apply validated tests from one context to another
πŸ’‘ Prompt Completion Aid Use prompt fragments from similar modules
πŸ“Š Cross-Project Analytics Find most reused templates, agents, or failure patterns
πŸ“¦ Modular Knowledge Transfer Recommend design patterns used in similar SaaS modules

πŸ”Ž Graph Construction Inputs

The knowledge graph is built by:

  • πŸ“₯ Collecting metadata from every memory entry
  • πŸ” Linking based on:
    • type, tags, agentId, moduleId, skillId
    • Semantic embedding similarity
    • Manual curation or Studio feedback
  • πŸ” Detecting references:
    • Blueprint β†’ module
    • Test β†’ contract
    • Skill β†’ output

βœ… Stored in a graph database or semantic memory index with relationships (e.g., Azure Cosmos DB Gremlin API, Neo4j, or custom graph index on top of vector DB + metadata DB).


🧩 Cross-Project Knowledge Reuse Example

  1. ProductManagerAgent initiates blueprint for PetInsuranceClaims
  2. VisionArchitectAgent queries similar vision documents
  3. Finds memory entries from another project:
    • HealthInsuranceClaimsService
    • ClaimApproved.event.json
  4. Planner proposes reusing ClaimsBlueprint.yaml as a base
  5. Agents adjust and generate domain-aligned variant

πŸ” Isolation and Boundaries

Despite its global scope, the graph is tenant-aware and project-isolated by default:

  • Memory links are readable across projects only if:
    • Same tenantId
    • OR marked as publicReusable = true
  • Sensitive prompts and artifacts are flagged as private
  • Cross-project agent access is governed by RBAC policies

βœ… Safe reuse without leakage across customer contexts.


🧠 Graph-Aware Agent Behavior

Agents can be configured with:

{
  "allowCrossProjectMemory": true,
  "reuseThreshold": 0.92,
  "filters": {
    "type": "test",
    "domain": "appointments"
  }
}

β†’ This enables semantic retrieval across projects with confidence scoring.


πŸ“š Graph-Based Studio Features

Feature Description
πŸ” Memory Similarity Search Search across projects for semantically similar items
πŸ“¦ Module Reuse Suggestion Recommend modules used in similar use cases
πŸ“„ Blueprint Comparison Viewer Compare current vs historical blueprints graphically
πŸ§ͺ Cross-Project Test Discovery Suggest test cases used by similar services
🧠 Memory Graph Visualizer Show how current artifact fits into global knowledge

πŸ“Š Knowledge Graph Metrics

  • πŸ”’ Memory node count (by type, agent, module)
  • πŸ”— Average links per artifact (reuse density)
  • πŸ” Most reused blueprints, templates, test cases
  • 🧠 Common failure-to-fix patterns
  • πŸ“ˆ Diff evolution over project versions

These metrics help agents adapt, orchestrators optimize, and curators refine the overall memory ecosystem.


βœ… Summary

The Multi-Project Knowledge Graph is a key enabler for:

  • Cross-project discovery and reuse
  • Agent intelligence evolution
  • Blueprint consistency and memory-driven planning
  • Studio-driven knowledge visibility and feedback loops

It turns memory into an interconnected knowledge fabric, powering autonomous orchestration at platform scale.


Documentation as Memory

In ConnectSoft, documentation is not external β€” it is a first-class memory artifact. Every .md file, design explanation, usage note, or auto-generated summary is treated as a versioned, retrievable, and queryable memory unit.

This section defines how all documentation β€” whether generated by agents or curated by humans β€” is ingested, tagged, linked, and reused as part of the platform’s knowledge fabric.


πŸ“˜ What Qualifies as Documentation?

All of the following are considered documentation memory:

File Type Purpose
README.md Explains module usage, features, deployment
VisionDocument.md Describes product goals, constraints, and actors
Architecture.md Diagrams, components, layering, security notes
ModuleOverview.md Summary of logic, skills, scope, responsibilities
TestSummary.md BDD explanation, edge cases, coverage notes
HowItWorks.md Internal behaviors, workflows, non-obvious flows
IntegrationGuide.md API usage, contract structure, example flows

βœ… All .md, .rst, and .txt files generated or stored per project/module.


🧠 Documentation = Knowledge Memory

Each doc file is:

  • Assigned a memoryId
  • Indexed by projectId, moduleId, agentId, skillId, traceId
  • Embedded into the vector database
  • Tracked in metadata DB with:
    • type: doc
    • tags: ["api", "architecture", "usage", "readme"]
    • semanticHash, version, createdBy

β†’ It becomes queryable just like a code file or prompt.


πŸ“¦ Documentation Memory Example

{
  "memoryId": "mem-doc-987",
  "type": "doc",
  "agentId": "documentation-writer",
  "filePath": "modules/booking-service/docs/README.md",
  "tags": ["booking", "handler", "architecture"],
  "version": "1.0.1",
  "traceId": "trace-booking-0123",
  "embeddingId": "embed-9f33",
  "status": "success"
}

✍️ Sources of Documentation in Memory

Source Description
Documentation Writer Agent Generates README.md, summaries, visual annotations
Test Generator Agent Produces TestSummary.md, scenario notes
Blueprint Generator Agent Outputs VisionDocument.md, ContextMap.md
DevOps Coordinator Agent May emit DeploymentSummary.md, rollback instructions
✍️ Human Contributors Studio users or engineers writing .md or .txt files

βœ… All are ingested equally with version tracking.


πŸ”„ Documentation Retrieval by Agents

Agents (or planners) may retrieve documentation memory using:

{
  "type": "doc",
  "projectId": "proj-001",
  "moduleId": "notification-service",
  "tags": ["architecture", "infrastructure"]
}

β†’ Fetches README.md and Architecture.md that describe the target module’s behavior.


πŸ’‘ Use Cases for Documentation as Memory

Use Case Behavior
πŸ“¦ Bootstrap from prior README Use README.md from similar module as a starting point
🧠 Prompt grounding Inject description from VisionDocument.md into skill context
πŸ“„ Doc diff preview Show changes in architecture across versions
πŸ” Test coverage justification Use TestSummary.md to explain what’s covered and what isn’t
✨ API explanation Reuse IntegrationGuide.md to auto-document gateway mappings
πŸ“š Studio search Find documentation by keyword, tag, or related module/project

πŸ§ͺ Markdown Embedding Strategy

When .md files are ingested:

  • Headers and sections are parsed (e.g., ## Purpose, ## Usage)
  • Cleaned, deduplicated, and truncated if too long
  • Embedded as semantic chunks (e.g., 512-token sliding windows)
  • Stored with:
    • Embedding vector
    • Link to blob/Git file path
    • Reference to traceId, agentId, projectId

β†’ Allows partial matching and context injection into other agents.


🧠 Intelligent Reuse in Planning & Generation

When planning a new feature, the platform may:

  1. Identify modules with matching VisionDocument.md
  2. Pull README.md and HowItWorks.md to explain internals
  3. Inject these into prompt context for blueprint generation
  4. Reuse structure, naming, and flow diagrams from past memory

βœ… Human-like planning and architectural alignment β€” autonomously.


🧾 Studio Features

Feature Description
πŸ” Semantic doc search Retrieve any doc by meaning, tag, section, agent, or module
🧠 Prompt augmentation Use relevant documentation in prompt generation context
πŸ•ΉοΈ Prompt replay with docs Inject selected .md into semantic kernel system messages
πŸ“ˆ Document evolution view Track how blueprints, designs, and APIs evolved over sprints
πŸ“€ Export doc pack Download versioned documentation set for a project/module

βœ… Summary

In ConnectSoft:

  • Documentation is a core memory component, not an afterthought
  • Every .md file is indexed, embedded, and traceable
  • Used by agents for reasoning, planning, testing, and prompting
  • Versioned and diffable just like code or tests
  • Exposed in Studio and orchestrator APIs

Documentation is how the factory thinks, communicates, and evolves β€” in markdown.


Integration with Azure DevOps

The ConnectSoft platform treats Azure DevOps not only as a CI/CD tool, but as a core memory gateway. Memory artifacts β€” such as generated code, blueprints, tests, logs, prompts, and execution traces β€” are linked to Git repositories, work items, pipelines, PRs, and artifacts managed in Azure DevOps.

This section explains how the knowledge and memory system is deeply integrated with Azure DevOps, enabling traceability, collaboration, governance, and automation across the full software lifecycle.


πŸ”— Why Azure DevOps Integration Matters

Purpose Benefit
πŸ“ Source of truth Memory is aligned to Git-tracked codebase
πŸ“¦ Artifact linking Generated code and test outputs are tied to builds and deployments
πŸ”„ Traceability & audits Memory entries are linked to execution traces and change history
πŸ” Studio DevOps sync Users can navigate from memory to Git commits, PRs, pipelines
🧠 Agent memory alignment Code, docs, and tests are grounded in versioned repositories

πŸ“‚ Git Repository Memory Anchoring

Each generated project or module is committed into a DevOps Git repository:

  • Repo name: csf/{tenant}/{project}/{module}
  • Branching strategy:
    • main β†’ production-ready
    • feature/* β†’ generated in coordination flows
    • dev/trace-{traceId} β†’ auto-linked to orchestration flows

βœ… Memory entries store Git linkage:

{
  "repoUrl": "https://dev.azure.com/csf/vetclinic/_git/booking-service",
  "commitHash": "a9c1f58",
  "filePath": "src/Application/Handlers/CancelAppointmentHandler.cs",
  "branch": "dev/trace-abc123",
  "pullRequestId": 421,
  "artifactId": "mem-xyz"
}

🧾 Execution Metadata in Git

Every orchestration creates:

  • execution-metadata.json in /metadata/ folder
  • sprint-trace-matrix.json for milestone linkage
  • Memory entries pointing to Git commit ID + trace context

This makes memory reproducible and queryable by Studio or API.


πŸ” Pull Request Automation

Orchestrators and agents open PRs after generation:

  • Title: feat: scaffold booking service (trace abc123)
  • Linked memory: handler code, blueprint YAML, README.md
  • Description includes prompt input + blueprint snapshot
  • Auto-attaches work items and build pipelines

βœ… Memory is enriched during PR creation and completion.


βš™οΈ Pipeline Memory Integration

Memory is linked to Azure Pipelines via:

  • Build steps:
    • dotnet build, dotnet test, publish, bicep build
  • Test results: pushed to TestRuns + ingested as memory
  • Logs: execution logs pushed to blob + linked to execution-metadata.json
  • Artifacts: .nupkg, .zip, .dll with traceable metadata

β†’ Every pipeline run is also a knowledge update event.


πŸ“Œ Work Item Linking

Memory entries can be associated with:

  • Features
  • User Stories
  • Tasks
  • Bugs
  • Epics

Studio and orchestrators emit events like:

{
  "event": "MemoryLinkedToWorkItem",
  "memoryId": "mem-abc123",
  "workItemId": 4512,
  "type": "test",
  "linkType": "Validates"
}

βœ… Enables true test-to-feature-to-blueprint traceability.


πŸ“¦ Artifact Indexing

Memory entries are linked to DevOps build artifacts:

Artifact Type Stored In Indexed As Memory?
.nupkg Azure Artifacts βœ… Yes (type: library)
.zip service app Azure Pipelines βœ… Yes (type: deployable)
.dll, .json Release pipelines βœ… Yes (type: binary/config)
.md, .yaml Git repo βœ… Yes (type: doc/blueprint)

πŸ“Š Studio: Azure DevOps-Linked Views

Studio memory UI includes:

  • 🧾 Git commit trace for each memory entry
  • πŸ”„ PR + memory side-by-side diff preview
  • πŸ“¦ Build + test result link from execution metadata
  • 🧠 β€œMemory used in this PR” trace graph
  • πŸ•ΉοΈ Replay orchestration with original commit + inputs

🧠 Orchestrator-Level Automation

Coordinators (e.g. MicroserviceAssemblyCoordinator) use DevOps integration to:

  • Clone template repo into feature branch
  • Track traceId in trace.json
  • Trigger memory ingestion pipeline
  • Push changes + open PR
  • Store all agent decisions + outputs in DevOps-linked memory index

β†’ Every repo = traceable memory container.


πŸ” Security and RBAC Enforcement

Memory linked to DevOps repos enforces:

  • Repository-scoped permissions (read/write)
  • Role-based memory access via DevOps groups
  • Token-scoped access via Studio agents or services
  • Redaction of sensitive content from public repos

βœ… Summary

Integration with Azure DevOps transforms ConnectSoft’s memory system into a developer-native, traceable, and governable knowledge infrastructure:

  • Memory lives alongside code, tests, pipelines, and features
  • PRs and builds are memory-aware
  • Studio and agents reason over DevOps-linked artifacts
  • Full traceability from prompt β†’ output β†’ commit β†’ release

DevOps becomes the memory backbone β€” not just a delivery channel.


Semantic Kernel & Prompt History

In ConnectSoft, agents use the Semantic Kernel (SK) as a runtime layer to execute AI-powered skills and orchestrate prompt-based reasoning. Each prompt interaction β€” whether generated, refined, retried, or reused β€” becomes part of the agent’s prompt history memory.

This section defines how prompts and responses are treated as memory artifacts, how they are embedded for reuse, and how SK-integrated agents reason from past conversations.


πŸ’¬ What Is Prompt History?

Prompt history is the collection of prompt-response exchanges:

  • Generated by any agent using SK
  • Stored with prompt, response, resultMetadata
  • Linked to traceId, skillId, agentId, and blueprint or module
  • Embedded semantically and indexed structurally

βœ… Prompts are not ephemeral β€” they are first-class memory units.


🧠 Why Prompt History Matters

Use Case Memory Benefit
🧱 Reuse of effective prompts Agents reuse high-performing prompt patterns
πŸ” Prompt refinement tracking Trace evolution of instructions after failure
πŸ’‘ Prompt-to-output traceability Connect prompt to test, code, or blueprint output
πŸ” Prompt similarity queries Retrieve similar prompts by goal or domain
πŸ§ͺ Grounded prompt replay Inject memory into replays or planning context

πŸ“¦ Prompt Memory Metadata Structure

Each prompt exchange is stored as:

{
  "memoryId": "mem-prompt-5121",
  "type": "prompt",
  "agentId": "test-generator",
  "skillId": "ComposeTest",
  "traceId": "trace-abc",
  "prompt": "Write BDD tests for cancelling appointments",
  "response": "Scenario: Cancel appointment...",
  "version": "1.0.0",
  "status": "success",
  "tags": ["test", "appointment", "cancel"],
  "embeddingId": "embed-8132",
  "semanticHash": "b1740c8e",
  "projectId": "proj-123",
  "moduleId": "booking-service"
}

πŸ”— Prompt + Output Linkage

Prompt memory entries are automatically linked to the artifacts they generated:

Link Type Stored In
outputFiles .cs, .feature, .yaml, .json
linkedMemoryIds Points to file-based memory entries
executionMetadata Stores full input-output pair + agent details

βœ… Enables reverse lookup: β€œWhich prompt created this handler?”


🧠 Embedding Prompt History

All prompts and responses are embedded using vector models (e.g. text-embedding-ada-002) and stored in the vector DB:

  • Queryable by similarity:
    • β€œFind all prompts that generated a blueprint for appointments”
  • Clustered to:
    • Detect best prompts
    • Eliminate redundancy
    • Suggest improvements

πŸ” Prompt Lifecycle Events

Event Triggered When Memory Result
PromptSubmitted Agent issues initial prompt New prompt memory created
PromptRefined Prompt is changed after failure or feedback New version + diff stored
PromptUsedAsContext Prompt reused in another flow Linked reference tracked
PromptFailed No usable response Memory flagged with status: failed
PromptCorrected Human/agent overrides failed output Corrected prompt saved + diff

🧠 Prompt Reuse Example

Planner needs to generate tests for appointment cancellation

Flow:

  1. Agent queries vector DB:
    • "Compose test for cancelling booking"
  2. Top 3 similar prompts are retrieved:
    • mem-prompt-918, mem-prompt-202, mem-prompt-541
  3. Agent uses top prompt’s structure:
    • Injects key steps and variations
  4. New .feature test is generated and linked to reused prompt

✍️ Prompt Enrichment with Metadata

Prompts are enriched with:

  • Skill name (e.g., GenerateHandler, ValidateContract)
  • Blueprint context
  • History of prior attempts
  • Linked tags: ["feature", "payments", "retry-safe"]

β†’ This allows agents to select prompts based on context and compatibility.


πŸ§ͺ Prompt Diffing

When a prompt is refined:

  • Semantic diff is calculated
  • Linked to previousPromptId
  • Studio displays:
- Write a handler for cancelling an appointment.
+ Write a handler for cancelling an appointment within 1 hour notice.

βœ… Helps in understanding β€œwhat changed” and β€œwhy.”


🧱 Prompt Storage in Memory Graph

Prompt nodes are stored in the same knowledge graph, linking to:

  • πŸ‘€ Agent and skill
  • πŸ“¦ Generated modules
  • πŸ“„ Documentation
  • πŸ§ͺ Test results
  • 🧠 Feedback ratings

β†’ Prompts become traceable assets across projects and skills.


🧩 Studio Features

Feature Description
🧠 Prompt search Query prompt history by keyword, tag, embedding
πŸ” Prompt replay Rerun or refine prompt with new agent context
πŸ“Š Prompt performance Track success rate, failure rate, average output quality
πŸ”Ž Prompt output trace See which files and tests were generated by each prompt
πŸ”§ Prompt diff + compare View versions and changes over time

βœ… Summary

In ConnectSoft:

  • Every prompt issued by an agent becomes a versioned memory object
  • Prompt history is embedded, indexed, and linked to outputs
  • Prompts are reused, refined, scored, and replayed
  • The Semantic Kernel acts as the runtime layer, but memory turns it into a learning agent

Prompt engineering is not trial-and-error β€” it’s a traceable, evolving, and sharable knowledge discipline.


Feedback Loop and Refinement

ConnectSoft is not just an autonomous factory β€” it’s a learning system. Every agent, orchestrator, and knowledge artifact participates in a feedback-driven refinement loop, ensuring continuous improvement of prompts, outputs, and agent strategies.

This section details how feedback β€” from users, other agents, or test results β€” is captured, stored, and applied to evolve memory, regenerate outputs, and guide future decisions.


πŸ” What Is the Feedback Loop?

The feedback loop is the process by which:

  1. πŸ§ͺ Agents receive outcomes (pass/fail, success/error)
  2. πŸ‘€ Users or other agents provide qualitative feedback
  3. πŸ”„ The system stores feedback as a memory object
  4. πŸ€– Agents modify their next actions based on feedback

βœ… The loop is continuous, structured, and observable.


πŸ“˜ Feedback Memory Types

Type Triggered When Stored As Memory?
AgentFailed An agent emits a result that fails validation βœ… Yes
PromptRefined Prompt is manually or programmatically adjusted βœ… Yes
OutputCorrected A generated artifact is edited or fixed βœ… Yes
TestFailed Generated test or code fails in CI or validation layer βœ… Yes
FeedbackSubmitted Human or agent explicitly rates, flags, or comments βœ… Yes

🧠 Feedback Memory Schema

{
  "memoryId": "mem-fb-901",
  "type": "feedback",
  "linkedMemoryId": "mem-456",
  "agentId": "test-generator",
  "skillId": "ComposeFeatureTest",
  "traceId": "trace-789",
  "status": "failure",
  "rating": 2,
  "comment": "Test uses incorrect Given/When/Then pattern",
  "feedbackSource": "Studio QA Engineer",
  "createdAt": "2025-05-10T12:34:00Z"
}

πŸ’‘ Agent Behaviors Triggered by Feedback

Trigger Condition Agent Reaction
AgentFailed + status: critical Skip current skill, escalate to alternate skill set
PromptRefined Store new version, regenerate with bumpVersion
OutputCorrected Archive old file, ingest corrected file, flag cause
FeedbackSubmitted.rating <= 2 Mark output as low-quality, deprioritize reuse
FeedbackSubmitted.rating >= 4 Mark output as high-quality, prioritize for reuse

πŸ” Feedback Target Types

Feedback can apply to:

  • 🎯 Prompts
  • πŸ“„ Blueprints
  • πŸ“¦ Generated code
  • πŸ“š Documentation
  • πŸ§ͺ Test cases
  • 🧠 Agent skills

All are linked to their originating memoryId, agentId, and skillId.


🧬 Feedback Loops Across Orchestration

  1. TestFailed β†’ triggers regeneration from PromptRefined
  2. AgentFailed β†’ MemoryMarkedUnusable + agent replacement
  3. ManualCorrection β†’ new artifact version stored + linked to original
  4. FeedbackSubmitted β†’ studio user flags bug or improvement

Each feedback event is stored and used in future agent prompts.


πŸ” Prompt Refinement & Replay

Agents may emit a PromptRefined event when:

  • Prompt failed to produce usable output
  • Output was correct but suboptimal
  • Feedback indicated style, structure, or clarity issues

The refined prompt becomes a new memory entry:

{
  "previousPromptId": "mem-prompt-789",
  "reason": "Original prompt failed test validation",
  "diff": "Adjusted step definitions in scenario description"
}

β†’ Supports traceable evolution of prompt strategies.


πŸ§ͺ Test-Informed Refinement

Failures in .feature tests automatically trigger:

  • Feedback memory: status: test-failed, target: handler
  • Marked memory as deprecated = true
  • Prompt + output regeneration
  • Diff between versions and reasons embedded in memory

βœ… Ensures test results inform next generation.


✍️ Human Feedback Capture

Studio users can submit:

  • ⭐ Rating (1–5)
  • πŸ“ Comments
  • 🧭 Suggest regeneration
  • πŸ“Ž Attach screenshots or logs (stored in blob + linked to memory)

All submissions are stored and shown in memory viewer.


πŸ“ˆ Feedback Metrics in Studio

Studio and orchestrators expose:

Metric Description
πŸ’¬ Feedback volume How much feedback was submitted per agent/project
πŸ“‰ Failure rate trends What skills fail the most across modules
πŸ”„ Regeneration frequency How often memory is re-generated
βœ… Success-after-retry Rate of successful second attempts after feedback
🧠 Top-rated memory chunks Highest-rated prompts, handlers, test suites

🧠 Memory Diff Chain View

Agents and users can trace memory evolution:

graph TD
  P1["Prompt v1"]
  H1["Handler v1 (Failed)"]
  FB1["Feedback: Invalid code"]
  P2["Prompt v2 (Refined)"]
  H2["Handler v2 (Passed)"]

  P1 --> H1 --> FB1 --> P2 --> H2
Hold "Alt" / "Option" to enable pan & zoom

βœ… This chain is stored and queryable for audit and learning.


βœ… Summary

The feedback and refinement loop ensures ConnectSoft:

  • Learns from failures and corrections
  • Evolves its prompts, skills, and outputs
  • Improves memory reusability over time
  • Tracks all agent behaviors and user input with traceability

Memory that doesn’t improve is just storage. Memory that learns is intelligence.


Studio Knowledge Base UI

The ConnectSoft AI Software Factory includes a powerful Studio interface where humans can interact with the knowledge system. The Studio’s Knowledge Base UI is more than a static viewer β€” it’s a dynamic, searchable, traceable, and diffable portal into the memory system.

This section explains how the Studio empowers users to navigate, search, audit, compare, replay, and refine memory β€” including prompts, documents, code, test results, diagrams, and AI agent behavior.


🧠 Key Goals of the Studio Memory Interface

Capability Purpose
πŸ” Search and filter memory Find relevant artifacts across projects, modules, types
🧱 Browse by trace or module View memory scoped to execution trace or feature module
πŸ“„ View documentation and code Render markdown, code files, and blueprints with metadata
πŸ” Prompt replay and refinement See prompts and re-execute them with new context
πŸ”Ž Compare versions and diffs See memory evolution and changelogs
πŸ§ͺ Review test status and coverage Check which artifacts are validated, failing, or untested
🧠 Feedback and rating Submit comments, scores, corrections to guide future agents

πŸ“¦ Memory Browser by Project

Every project page in Studio includes a Knowledge Browser, displaying:

  • πŸ“ Memory grouped by:
    • Type (code, doc, blueprint, test, etc.)
    • Module
    • Trace/session
  • πŸ“Œ Filter by:
    • Agent
    • Skill
    • Tags
    • Version
    • Status (failed, success, pending, outdated)
  • πŸ” Search:
    • Textual
    • Semantic (vector match)
    • Metadata-driven

πŸ“˜ Memory Detail View

Clicking on a memory entry shows:

  • πŸ“„ Rendered content (e.g., markdown or code preview)
  • πŸ“Ž Metadata (traceId, agentId, skill, type, tags, etc.)
  • πŸ” Linked memory (e.g., prompt β†’ output β†’ feedback)
  • πŸ“‰ Execution data (duration, logs, retries)
  • πŸ’¬ Comments and feedback (from users or agents)
  • πŸ”§ Actions:
    • Replay
    • Refine prompt
    • View version diff
    • Flag as outdated

🧬 Visual Studio-Like Views

For developers, the UI mimics familiar IDEs:

Panel Description
πŸ“‚ Solution Explorer Per-module memory with project-structured navigation
πŸ” Search Bar Fuzzy, tag-based, or full semantic query
🧠 Trace Graph Orchestration timeline linked to agent-generated memory
🧾 Metadata Panel All memory metadata in structured and editable form
πŸ§ͺ Test Result View Success/failure badges and rerun actions per test

πŸ“Š Prompt History Explorer

In the "Prompt Memory" tab, users can:

  • πŸ” Replay previous prompts
  • πŸ” Compare prompt versions
  • πŸ“ˆ See performance analytics (pass/fail rate)
  • 🧠 Filter by prompt type, domain, skill, and quality score
  • ✍️ Inject prompts into new planner flows

πŸ“„ Documentation Viewer

Markdown-based documents are rendered with:

  • Header navigation
  • Expand/collapse sections
  • Linked diagrams
  • Related code/tests sidebar
  • Feedback submission interface (suggest changes, highlight issues)

πŸ” Diff Viewer for Versioned Memory

When multiple versions of a memory artifact exist, users can:

  • πŸ“Š See visual diffs (code, doc, prompt)
  • πŸ” Switch between versions
  • 🧠 See reason for change (e.g., β€œTest failed β†’ Prompt refined”)
  • πŸ“Œ Pin a version as the β€œcurrent gold copy”
  • πŸ§ͺ Trigger regression test for changed memory

πŸ§ͺ Test Coverage and Status View

For each module or project:

  • 🟒 Passed test memory
  • πŸ”΄ Failed test artifacts
  • 🟑 Missing test detection (based on blueprint feature map)
  • πŸ“Ž Link to related handlers and prompts
  • πŸ” Rerun tests or regenerate from feedback

✍️ Feedback and Suggestion Panel

For every memory entry:

  • ⭐ Rate from 1 to 5
  • πŸ’¬ Add feedback comment
  • 🧠 Suggest regeneration
  • πŸ“Ž Upload reference (e.g., screenshot, bug trace)
  • πŸ”„ View impact of feedback (e.g., prompt refined, memory diffed)

πŸ” Role-Based Access

Studio memory UI respects permissions:

Role Memory Access
Architect Full read/write, regeneration, feedback
QA Engineer Read-only code/docs, write feedback on tests
Product Manager Read-only blueprints/prompts, suggest refinements
Tenant Operator View only project memory, no prompt access
AI Agent API token-based scoped access via orchestrators

🧠 Integrations with Other Studio Features

  • πŸ”— Agent Orchestration Graph β†’ trace memory lineage per agent
  • πŸ”„ SaaS Factory Workflows Launcher β†’ start generation with memory injection
  • πŸ“Š Observability Panel β†’ show memory usage, quality, and access stats
  • πŸ” Knowledge Replay Mode β†’ step through trace and regenerate flow

βœ… Summary

The Studio Knowledge UI makes memory:

  • Searchable
  • Visualized
  • Replayable
  • Diffable
  • Auditable
  • Feedback-ready

It’s the lens through which humans and agents collaborate, learn, and evolve software together.


Memory-Aware Traceability

In ConnectSoft, every memory entry is traceable β€” to the blueprint that inspired it, the prompt that generated it, the agent that emitted it, and the project or sprint that produced it. This deep linkage enables full traceability across the autonomous software development lifecycle.

This section describes how trace IDs, milestone metadata, and execution chains are used to track, audit, and replay memory evolution from vision to release.


🧠 What Is Memory-Aware Traceability?

Traceability means that every artifact in memory can answer:

  • Who generated it?
  • Why was it generated?
  • From which input?
  • For what purpose?
  • What execution or sprint was it part of?
  • What has changed since?

βœ… These questions are answered using traceId, agentId, skillId, milestoneId, and versioned metadata.


🧾 Core Traceability Identifiers

Field Description
traceId A unique ID for each agent orchestration or blueprint flow
projectId Project-wide scope anchor
moduleId Microservice/module within the project
agentId Responsible agent that generated memory
skillId Specific skill or plugin used to generate memory
milestoneId Sprint milestone or phase when memory was produced
executionId Optional: detailed runtime execution UID

πŸ“˜ Example: Memory Entry with Traceability

{
  "memoryId": "mem-123456",
  "type": "code",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "projectId": "proj-booking",
  "moduleId": "booking-service",
  "traceId": "trace-xyz789",
  "milestoneId": "M3-GenerateHandlers",
  "status": "success",
  "createdAt": "2025-05-13T10:15:00Z"
}

πŸ” Trace Graph in Execution Metadata

Each execution-metadata.json contains:

  • traceId
  • agentsInvolved
  • outputsGenerated
  • promptsUsed
  • duration
  • inputBlueprints
  • linkedArtifacts

βœ… Enables reconstruction of how a single blueprint yielded test cases, handlers, contracts, and feedback.


🧠 Memory Usage Tracing

Memory entries are linked across flows:

Origin Memory Used By Memory
Prompt mem-p123 Code file mem-c456
Blueprint mem-b100 Tests mem-t300, mem-t301
Failed artifact mem-f001 Refined version mem-f002
Test result mem-tx99 Triggers prompt mem-pr-refined-33

β†’ These links are stored in linkedMemoryIds[].


πŸ“Š Sprint and Milestone Trace Matrix

Every project maintains:

sprint-trace-matrix.json

{
  "milestoneId": "M3-GenerateHandlers",
  "traceId": "trace-xyz789",
  "start": "2025-05-12",
  "end": "2025-05-13",
  "agents": ["backend-developer", "test-generator"],
  "memoryEmitted": ["mem-c456", "mem-t123"]
}

Studio can render sprint progress from trace-driven data.


πŸ”Ž Studio Features Based on Traceability

Feature Description
🧠 Memory by Trace View all memory created in one execution or trace
πŸ“¦ Memory by Milestone Filter outputs by sprint goal or orchestration phase
πŸ” Prompt + Output + Feedback View full chain of input, output, result, and refinement
πŸ“Š Timeline Explorer Show who generated what, when, and why
βͺ Memory Replay Mode Rebuild a flow using original prompts + skills
πŸ“Ž Trace Summary Download Export all trace-linked memory for audit or packaging

πŸ” Rebuilding Context from Memory

With full traceability:

  1. Select traceId = trace-xyz789
  2. Load:
    • Original prompt
    • Blueprint YAML
    • Handlers generated
    • Tests linked
    • Execution logs + metrics
  3. Option: replay with updated skills or regenerate using same input

βœ… Enables repeatability and confidence in generation pipelines.


πŸ” Auditable Change Chains

Each memory artifact includes:

  • Versioning history
  • linkedMemoryIds to:
    • Source prompt
    • Feedback or failures
    • Regenerated artifacts
  • Time-stamped status and origin

Auditors and architects can trace:

β€œWhy did this test exist, what created it, and how did it evolve?”


🧠 Integration with Orchestration Layer

Each Coordinator uses trace-aware checkpoints:

Coordinator Trace Behavior
ProjectBootstrapOrchestrator Emits initial traceId + project memory scaffold
SprintExecutionCoordinator Tracks memory per milestoneId
MicroserviceAssemblyCoordinator Records trace β†’ artifact links
ReleaseCoordinator Bundles memory by trace/version for packaging

βœ… Summary

Memory-aware traceability enables ConnectSoft to:

  • Reconstruct every generation event
  • Replay orchestration flows with precision
  • Audit who did what, when, and why
  • Correlate prompts, outputs, tests, and failures
  • Enable Studio users to explore and trust the AI software lifecycle

Traceability transforms memory from data into a provenance graph.


Knowledge Reuse Mechanisms

One of the most powerful capabilities of the ConnectSoft platform is automated knowledge reuse. Instead of reinventing the wheel for every project, module, or prompt, agents can identify existing memory artifacts β€” including blueprints, test cases, adapters, and prompt patterns β€” and reuse them with or without adaptation.

This section describes the strategies, metadata models, and intelligence patterns that power memory reuse across projects, modules, agents, and tenants.


🧠 Why Reuse Matters

Benefit Description
⏱ Saves Time Avoids redundant work by agents
βœ… Increases Quality Leverages validated, tested, high-performing memory chunks
πŸ“ˆ Improves Continuity Aligns new modules with existing design and documentation
πŸ”„ Enables Cross-Project IQ Reuses knowledge across related verticals (e.g. Booking β†’ Claims)
πŸ§ͺ Drives AI Learning Enables agents to prefer better-performing generations

πŸ“¦ What Can Be Reused?

Artifact Type Reuse Strategy Use Case
Prompts Reuse by similarity Generate new blueprint with same intent
Blueprints Reuse as partial or base Use service blueprint from another domain
.feature Tests Reuse by variation Copy test, adjust for new aggregate
.cs Files Reuse as template/code-similarity Clone a handler logic across modules
OpenAPI/Event Specs Reuse from past services Clone structure for new contract
README/docs Reuse for template documentation Use past documentation layout and phrasing

πŸ” Reuse Matching: Three Layers

  1. Semantic Similarity
    • Based on vector embeddings
    • Match prompt, blueprint, doc, or test
  2. Structural Compatibility
    • Same boundedContext, moduleType, eventShape
    • Same interface or API pattern
  3. Metadata Tags
    • Filter by agentId, skillId, type, domain, status

πŸ“˜ Example Reuse Query

{
  "projectId": "proj-123",
  "type": "test",
  "tags": ["appointment", "cancel"],
  "similarityThreshold": 0.92,
  "status": "success"
}

β†’ Returns .feature files for similar flows, which can be adapted and injected into a new module.


🧠 Agent-Driven Reuse Flow

  1. Agent (e.g. Blueprint Aggregator) receives a task
  2. Queries memory with:
    • Semantic embedding of intent
    • Structured filters
  3. Receives top reusable candidates:
    • Blueprint A (match: 93.2%)
    • Test Suite B (match: 91.0%)
    • Prompt C (match: 88.9%)
  4. Agent adapts or clones outputs
  5. Stores as new versioned memory with reuse lineage

πŸ”„ Reuse with Adaptation

Reused memory is not blindly copied β€” it is annotated and transformed:

  • 🧬 Semantic fields changed
  • πŸ§ͺ Prompts adjusted for new business rules
  • πŸ“Ž Linked to original memory via linkedFrom
{
  "memoryId": "mem-999",
  "type": "test",
  "linkedFrom": "mem-322",
  "reuseType": "clone+adapt",
  "adaptationNotes": "Updated cancel policy to 1-hour threshold",
  "similarityScore": 0.93
}

🧠 Reuse Scoring and Priority

The platform scores reusable memory chunks based on:

  • Similarity (vector + tag match)
  • Feedback score (human/agent ratings)
  • Test pass rate (for code/tests)
  • Generation context match (same domain or aggregate)
  • Version age (latest preferred)

Only entries above reuseThreshold (default: 0.85) are considered candidates.


πŸ”— Memory Lineage and Reuse Chain

Memory modules record their reuse ancestry:

graph TD
  mem101["Booking Blueprint"]
  mem202["Cancel Test v1"]
  mem303["Cancel Test v2 (adapted)"]
  mem404["Test Documentation"]

  mem101 --> mem202 --> mem303
  mem303 --> mem404
Hold "Alt" / "Option" to enable pan & zoom

β†’ Enables tracing the knowledge DNA of every output.


🧠 Reuse by Planners and Orchestrators

Planners and Coordinators leverage memory reuse to:

  • Clone templates and scaffold modules
  • Reuse domain events and handlers
  • Bootstrap test cases from known-safe flows
  • Copy deploy pipelines and infra patterns
  • Apply previously refined prompt strategies

βœ… All with full lineage, traceability, and adaptation logs.


πŸ“Ž Studio Reuse Features

Feature Description
🧠 Reuse Suggestions Memory browser shows β€œreuse candidates” by similarity
πŸ” Reuse with Adaptation Flow Select item β†’ edit β†’ store as adapted memory
πŸ“„ Compare Before/After See reused content and what was modified
πŸ“¦ Reuse Dashboard View most reused memory across modules, tenants, or agents

πŸ” Reuse Access Control

  • Tenants can share reusable modules across projects
  • Some memory is marked publicReusable: true
  • Private memory cannot be reused unless:
    • Shared by edition
    • Whitelisted by governance
  • Reuse access is enforced at the memory API level

βœ… Summary

Knowledge reuse in ConnectSoft enables:

  • Smarter agents with less generation overhead
  • Safer and faster time-to-delivery
  • Higher consistency across modules and products
  • Traceable lineage of all reused content

Reuse turns memory from history into active intelligence.


Security & Access Control

In ConnectSoft, the memory system contains valuable business knowledge β€” prompts, code, blueprints, contracts, tests, documentation, and infrastructure plans. To protect this intellectual property, the platform enforces multi-layered, tenant-aware, role-based access control (RBAC) over all memory.

This section defines how security boundaries are enforced across tenants, projects, agents, and memory types.


πŸ” Core Security Goals

Goal Description
πŸ”’ Tenant isolation Ensure memory is never shared across tenants by default
πŸ” Scoped reuse Allow reuse only within permitted boundaries
πŸ‘€ Role-based visibility Limit access to memory based on user/agent roles and permissions
βœ… Traceable access Log all memory reads, writes, and modifications
πŸ”„ Memory mutation audit Track who changed what, when, and why

🧱 Multi-Layered Security Model

ConnectSoft enforces security at 5 layers:

  1. Tenant Boundary
    • All memory is tagged with tenantId
    • Cannot be queried or reused outside the tenant without explicit permission
  2. Project Boundary
    • Scoped access to projectId
    • Memory is grouped and versioned per project
  3. Module Boundary
    • Memory is filtered by moduleId when required (e.g., when generating within booking-service)
  4. Agent/Role Boundary
    • Agents can only access memory related to their role/skill unless granted cross-role access
  5. Memory Type Boundary
    • Certain types (e.g., prompt history, documentation) may be flagged as private or redacted

πŸ” Memory Metadata Fields for Security

Each memory entry includes:

{
  "tenantId": "vetclinic",
  "projectId": "proj-2025-0098",
  "moduleId": "payment-service",
  "accessScope": "private",
  "allowedRoles": ["solution-architect", "documentation-writer"],
  "publicReusable": false,
  "ownerAgentId": "backend-developer",
  "createdBy": "agent",
  "readOnly": false
}

βœ… This metadata is enforced at the query and ingestion layers.


πŸ‘€ Role-Based Access Control (RBAC)

RBAC is applied across:

Role Allowed Memory Actions
VisionArchitect Read/write vision, blueprints, prompt history
BackendDeveloper Read/write code, tests, contracts
TestGenerator Read blueprints, write tests, read test coverage
DevOpsEngineer Read code, write infra memory, read deployment metadata
StudioUser (Product) Read-only docs, feedback, feature prompts
StudioUser (QA) Read tests, submit feedback, view trace
ProjectOwner Full access within their projects

RBAC is implemented via scoped Studio tokens and orchestrator agent configuration.


πŸ“¦ Access Tokens & Memory APIs

  • Agents and users interact with memory via secure APIs
  • Tokens include:
    • tenantId
    • projectId
    • agentId or userId
    • role
    • scope (read, write, reuse)
  • All API requests validate token scope before allowing memory access

🚫 Redaction & Private Memory

Certain memory entries may be flagged:

  • accessScope: private
  • redacted: true
  • sensitive: true

These entries:

  • Are excluded from global search or reuse
  • Cannot be embedded in prompts unless permitted
  • Require explicit RBAC override to view or modify

🧠 Controlled Reuse Across Tenants

Cross-tenant reuse is possible but requires governance:

  • Shared artifacts must be:
    • Marked publicReusable: true
    • Approved by governance policies
  • Only agents with allowCrossTenantReuse: true may request such memory
  • Example: a template library published to multiple customers

🧾 Memory Access Audit Logs

Every memory action is logged:

{
  "event": "MemoryAccessed",
  "memoryId": "mem-abc123",
  "accessedBy": "agent:qa-engineer",
  "timestamp": "2025-05-14T09:22:00Z",
  "operation": "read",
  "traceId": "trace-xy999",
  "tenantId": "vetclinic"
}

Studio users and platform auditors can view:

  • Access logs by memory
  • Read/write counts
  • Agent usage trends
  • Memory modification history

🧠 Example: Agent Access Rules in Practice

Scenario: Test Generator Agent attempts to access README.md from another project

  1. Memory metadata:
{
  "type": "doc",
  "accessScope": "private",
  "projectId": "proj-billing"
}
  1. Agent’s token:
{
  "agentId": "test-generator",
  "projectId": "proj-booking",
  "role": "QA",
  "scope": "read"
}

β†’ Result: Access denied (projectId mismatch + private scope)


🧱 Isolation by Edition and Module

For multi-edition SaaS platforms:

  • Memory can be segmented by:
    • editionId
    • featureFlag
    • environment (e.g., staging, production)

β†’ Allows different editions to use different memory patterns or regenerate independently.


βœ… Summary

Security in ConnectSoft’s memory system ensures:

  • πŸ’‘ Intelligent agents operate within authorized boundaries
  • 🧱 Tenants and projects remain isolated
  • πŸ‘€ Human and agent access is enforced and audited
  • πŸ” Reuse is powerful β€” but controlled and traceable

Memory is power β€” and power must be governed, scoped, and secured.


Garbage Collection & Expiry

In ConnectSoft, the memory system can grow quickly β€” storing every prompt, test, code file, blueprint, document, and trace across thousands of projects and orchestrated flows. To maintain performance, cost efficiency, and knowledge relevancy, the system enforces a structured Garbage Collection (GC), Archival, and Expiry Policy.

This section defines the lifecycle of memory objects, when they are expired or archived, and how agents and curators can intervene.


🧠 Why Memory Management Is Critical

Problem Solution Provided by GC & Expiry
πŸš€ Memory bloat Automatic cleanup of unused, low-quality, or expired artifacts
πŸ§ͺ Test result noise Expire failing test results after retry or correction
πŸ—ƒ Version sprawl Archive outdated or superseded versions
πŸ” Prompt evolution clutter Retain only meaningful prompt versions
πŸ’° Storage cost Keep memory footprint lean for vector DB and blob stores

🧾 Memory Lifecycle Phases

Phase Description
active Most recent version, used by orchestrators and agents
stale Superseded by newer version, not accessed for X days
archived Moved to cold storage (e.g., Azure Blob Archive Tier)
expired Eligible for deletion, marked by policy
deleted Hard deleted (manually or via retention policy)

πŸ”’ Expiry Criteria

Memory entries are eligible for expiry if:

Condition Expiry Action
Not accessed in last 90 days Mark as stale
Superseded by β‰₯ 2 newer versions Archive oldest version
Has status: failed and retry: success Mark failed version expired
feedback.rating ≀ 2 Mark for expiration
promptVersion > 3 with no improvement Expire unused intermediate
Manually flagged as obsolete Immediate archive or delete

πŸ“ Storage Tiering: Blob + Vector DB

Memory Type GC Action Storage Tier
.cs, .feature, .yaml Archive old versions Azure Blob Archive or Cold Tier
.md, .json, .txt Compress and store diff-only Standard Tier or zipped collection
Vectors (embeddings) Delete expired entries Purged from vector DB (e.g., Qdrant)
Metadata DB Mark with status = expired Soft-deleted for X days

🧠 Example: Prompt Expiry Chain

graph TD
  P1["Prompt v1 (Failed)"]
  P2["Prompt v2 (Low score)"]
  P3["Prompt v3 (Success)"]

  P1 --> P2 --> P3
Hold "Alt" / "Option" to enable pan & zoom

GC logic:

  • Keep v3 as active
  • Archive v2 (low reuse)
  • Expire and delete v1 (marked failed + redundant)

πŸ“Š GC Process Flow

  1. Run GC job (daily or weekly)
  2. Evaluate memory metadata:
    • lastAccessed, version, status, feedback, reuseCount
  3. Emit GC events:
    • MemoryMarkedStale
    • MemoryArchived
    • MemoryMarkedForExpiry
  4. Move blob files, delete vector entries, update metadata
  5. Log GC actions in gc-logs/ folder

πŸ” Agent & Studio Support

  • Agents are aware of expiration rules:
    • Avoid using expired memory
    • Can trigger regeneration of stale outputs
  • Studio allows:
    • Manual flagging for archive/delete
    • Viewing GC history per project/module
    • Restore from archive (if within retention window)

πŸ—ƒ Archive Retention Policies

Memory Type Retention Period Archive Action
Test results 60 days Compress logs and features
Code versions 180 days Move to cold storage
Prompt history 90 days Retain top-rated only
Execution metadata 120 days Archive to audit vault
Feedback entries 365 days Persist unless redacted

πŸ” Governance & Audit Trail

All GC actions are logged:

{
  "event": "MemoryMarkedForExpiry",
  "memoryId": "mem-test-1234",
  "reason": "Unaccessed + superseded",
  "timestamp": "2025-05-14T03:00:00Z"
}

Audit logs can be queried by:

  • memoryId
  • agentId
  • actionType
  • timestampRange

βœ… Summary

Garbage collection and expiry ensures that ConnectSoft:

  • Maintains a lean and high-quality memory base
  • Preserves only useful, traceable, relevant artifacts
  • Keeps vector databases and blob storage optimized
  • Allows safe regeneration and replay from active memory
  • Offers clear audit trail and retention policies for all memory transitions

Memory that lives forever becomes noise. Memory that ages with governance becomes wisdom.


Future Extensions & Ontologies

The ConnectSoft memory architecture is designed for scale, modularity, and evolution. As the platform matures, the memory system will incorporate advanced capabilities, including domain-specific ontologies, multi-modal memory, knowledge graph enhancements, and AI-native features like RAG (Retrieval-Augmented Generation) and fine-tuned assistants.

This final section outlines the forward-looking vision for the Knowledge & Memory System and how it will empower a next-generation autonomous SaaS factory.


πŸš€ Key Expansion Areas

Area Description
🧠 Ontology-Driven Reasoning Introduce domain ontologies for semantic alignment and cross-agent understanding
πŸŽ₯ Multi-Modal Memory Support memory entries with images, diagrams, flows, videos, audio
πŸ” Memory-Backed Assistants Fine-tuned agent workflows grounded in project or module memory
πŸ“¦ RAG for Prompt Execution Use memory chunks as dynamic context for semantic kernel executions
πŸ“Š GraphQL Memory Query API Flexible, composable memory query layer for humans and agents
🧩 Knowledge Modules DSL Define memory blueprints using a high-level DSL for portability and reuse

🧠 Domain Ontologies

  • Introduce standardized domain concepts and relationships:
    • Entities, actions, events, contracts, policies
  • Support across blueprints, prompts, event schemas, and tests
  • Example: define Appointment, BookingWindow, ReschedulePolicy
  • Used for:
    • Prompt grounding
    • Test generation
    • Event-based agent reasoning
  • Ontologies stored in memory and linked to artifacts

🧬 Multi-Modal Memory Support

Future memory types:

Type Use Case
.png Diagrams (e.g., architecture, flowcharts, UI maps)
.svg Renderable graphs, event timelines
.mp4 UI flows, agent demo recordings
.wav Voice feedback, conversation logs
.drawio Auto-generated diagrams from service blueprints

β†’ All assets are indexed and stored as retrievable, embedded memory units.


πŸ” Retrieval-Augmented Generation (RAG)

RAG will become standard for all SK-based agents:

  • Query memory for relevant context (text, blueprint, code, prompt)
  • Inject into LLM system prompt
  • Execute with context-aware precision

βœ… Enables more intelligent generations, fewer retries, and richer behavior.


🧠 Memory-Aware Assistants

ConnectSoft will offer:

  • Fine-tuned task-specific agents (e.g., Blueprint Optimizer, Test Explainer)
  • Assistants trained on ConnectSoft memory patterns
  • Capable of:
    • Explaining blueprint decisions
    • Suggesting test improvements
    • Answering β€œwhy this module looks like that”

β†’ Deep personalization per project + context.


🧾 GraphQL & Semantic Memory Query Layer

Expose a unified, expressive memory query language:

query {
  memory(
    filter: {
      type: "test"
      tags: ["reschedule"]
      projectId: "proj-vetclinic"
    }
  ) {
    memoryId
    filePath
    version
    status
    createdAt
  }
}

β†’ Enables intelligent apps, low-code memory tools, and third-party platform access.


πŸ“œ Knowledge Module DSL (Future)

A declarative DSL to define reusable knowledge modules:

module:
  name: AppointmentHandler
  type: handler
  inheritsFrom: booking-handler-base
  inputs:
    - entity: Appointment
    - event: AppointmentRequested
  outputs:
    - command: ScheduleAppointment
  blueprintRef: mem-blueprint-1234

βœ… Enables blueprint-driven memory scaffolding and CI/CD-ready validation.


πŸ§ͺ Intelligent Memory Validation Agents

Upcoming agent types will automatically:

  • Validate memory correctness against blueprint
  • Detect redundant memory
  • Detect drift between memory and Git repo
  • Suggest optimizations and doc corrections

πŸ“¦ Memory Snapshots & Packaging

New formats to export/import memory:

  • memory.bundle.zip β†’ includes docs, code, tests, metadata
  • memory.snapshot.json β†’ diffable memory representation
  • Use cases:
    • Release packaging
    • Disaster recovery
    • Edition migration
    • Offline simulation

βœ… Summary

The future of ConnectSoft’s memory system is:

  • Semantic (with ontologies)
  • Multi-modal (code, diagrams, audio, visual)
  • Interoperable (GraphQL, bundles, DSL)
  • AI-native (RAG-ready, explainable, proactive)
  • Continuous (learning through every cycle)

Memory is no longer just support for generation β€” it is the engine of platform intelligence.


Runtime & State

Architecture & Design