π§ 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 |
π Link to Platform Principles¶
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,sprintIdagentId,skillIdmoduleId,featureId,blueprintIdtype(e.g., test, code, plan, doc, event)tenantId,edition,environmentsource(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:
β 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,versioncreatedAt,source,status,type,projectId,tenantIdtags,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,commitHashagentId,executionId,timestampexecution-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, ore5-mistralfor 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_TRACEmoduleId = "booking-service"tags includes ["appointment", "handler"]
This allows for context-aware reuse, avoiding incorrect or cross-tenant leakage.
β‘ Embedding Lifecycle¶
- β Normalize input: Remove comments, truncate long code blocks
- β Chunk if needed: For large docs, split into sections
- β Generate embeddings
- β Store in Vector DB with metadata
- β
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:
- Looks up prior
.featurefiles withtags: ["appointment", "cancel"] - Finds 5 relevant tests with high semantic match
- Reuses structure and validations
- Generates new test suite
- Stores new
.featurefile 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, andtenantId
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:
- Issues a unique
projectIdandtraceId - Initializes a structured directory in:
- Blob storage:
/tenants/{tenantId}/projects/{projectId}/ - Metadata DB:
project_memorytable
- Blob storage:
- Emits
ProjectInitializedevent - 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 itskillId: Which skill or plugin was usedtraceId: Which orchestration flow it belonged tomoduleId: Which feature or service it supportsversion: Incremental version of the artifactstatus: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:
tenantIdprojectIdmoduleId(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.jsonorartifact.meta.json - πΉ Git Commits: can include metadata in commit message footer or
.meta.jsonin 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, andtraceIdare mandatoryversionmust conform to semantic versioning (e.g.,1.0.0,2.1.3)-
typemust be selected from controlled vocabulary: -
code,test,doc,blueprint,infra,contract,event,prompt,metadata statusis validated against execution results or failure eventssemanticHashmust be generated from artifact content using SHA-256 or similarembeddingIdmust exist if memory is in vector DB
π Security and Isolation Fields¶
To support multi-tenant memory safety:
tenantIdensures 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,moduleIdskillId,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.mdwith 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.yamlandContextMap.json - π§ Reuses aggregate patterns from project memory
4. Backend Developer Agent¶
- π₯ Retrieves similar handler code or DTO classes
- π€ Stores
.csfiles with metadata per layer and aggregate - π§ Avoids regenerating duplicate services
5. Test Generator Agent¶
- π₯ Pulls
.featurefiles 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
infratype - π§ 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,moduleIdtype(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:
Solution Architect Agentretrieves similarServiceBlueprint.yamlfrom project memoryBackend Developer Agentqueries handlers related tocanceloperationsTest Generator Agentfinds existing.featurefiles from cancellation tests- All new outputs are persisted with links to retrieved memory
Knowledge Management Agentclusters 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
β This pattern applies to every artifact-producing agent or orchestrator.
π§© Examples of Event-Powered Ingestion¶
π§ From Agent Execution¶
Backend Developer AgentemitsAgentOutputGenerated- Memory ingestor captures
.csfiles - Stores in:
- Blob:
/src/Application/Handlers/*.cs - Metadata DB: with
traceId,skillId,agentId - Vector DB: if summary or docstring is extracted
- Blob:
π From Blueprint Creation¶
Solution Architect AgentemitsServiceBlueprintCreatedServiceBlueprint.yamlis ingested as:- Structured memory (type: blueprint)
- Embedded document for semantic recall
- Tagged with
boundedContext,aggregates,eventTypes
π§ͺ From Test Failure¶
TestRunneremitsTestFailedevent- Memory record created with:
- Linked
.featurefile - Failure logs
- Feedback flag
- Status:
failed
- Linked
π 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:
MemoryStoredMemoryLinkedEmbeddingCreatedMemoryIngestFailed
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
MemoryStoredevents 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,agentIdscope- 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:
- π§Ύ 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¶
- Agent generates artifacts for
booking-service - Emits
AgentOutputGeneratedwithmoduleId - Memory ingestor:
- Stores files in
/modules/booking-service/ - Embeds textual files to vector DB
- Indexes metadata tagged with
moduleId
- Stores files in
- Future agents use this
moduleIdto 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)ModuleMemoryUpdatedExecutionMetadataCreated
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:
AgentFailedorAgentFeedbackSubmittedevent is emitted- Memory is updated with:
- Failure context
- Prompt, output, logs
- Correction or regenerated version
- 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
agentIdmemory 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:
tenantIdprojectId- 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.jsonmilestone-checklist.jsonexecution-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 shapeMINOR: 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: trueversion - Fetch all historical versions for reasoning
- Query by
version >= 1.2.0 AND < 2.0.0 - Detect and diff between
v1.0.0andv2.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.jsonin 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"]
β 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¶
ProductManagerAgentinitiates blueprint forPetInsuranceClaimsVisionArchitectAgentqueries similar vision documents- Finds memory entries from another project:
HealthInsuranceClaimsServiceClaimApproved.event.json
- Planner proposes reusing
ClaimsBlueprint.yamlas a base - 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
- Same
- 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: doctags: ["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:
- Identify modules with matching
VisionDocument.md - Pull
README.mdandHowItWorks.mdto explain internals - Inject these into prompt context for blueprint generation
- 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
.mdfile 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-readyfeature/*β generated in coordination flowsdev/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.jsonin/metadata/foldersprint-trace-matrix.jsonfor 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,.dllwith 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
traceIdintrace.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:
- Agent queries vector DB:
"Compose test for cancelling booking"
- Top 3 similar prompts are retrieved:
mem-prompt-918,mem-prompt-202,mem-prompt-541
- Agent uses top promptβs structure:
- Injects key steps and variations
- New
.featuretest 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:
- π§ͺ Agents receive outcomes (pass/fail, success/error)
- π€ Users or other agents provide qualitative feedback
- π The system stores feedback as a memory object
- π€ 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¶
TestFailedβ triggers regeneration fromPromptRefinedAgentFailedβMemoryMarkedUnusable+ agent replacementManualCorrectionβ new artifact version stored + linked to originalFeedbackSubmittedβ 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
β 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:
traceIdagentsInvolvedoutputsGeneratedpromptsUseddurationinputBlueprintslinkedArtifacts
β 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:
- Select
traceId = trace-xyz789 - Load:
- Original prompt
- Blueprint YAML
- Handlers generated
- Tests linked
- Execution logs + metrics
- 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
linkedMemoryIdsto:- 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¶
- Semantic Similarity
- Based on vector embeddings
- Match prompt, blueprint, doc, or test
- Structural Compatibility
- Same
boundedContext,moduleType,eventShape - Same interface or API pattern
- Same
- Metadata Tags
- Filter by
agentId,skillId,type,domain,status
- Filter by
π 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¶
- Agent (e.g.
Blueprint Aggregator) receives a task - Queries memory with:
- Semantic embedding of intent
- Structured filters
- Receives top reusable candidates:
- Blueprint A (match: 93.2%)
- Test Suite B (match: 91.0%)
- Prompt C (match: 88.9%)
- Agent adapts or clones outputs
- 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
β 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:
- Tenant Boundary
- All memory is tagged with
tenantId - Cannot be queried or reused outside the tenant without explicit permission
- All memory is tagged with
- Project Boundary
- Scoped access to
projectId - Memory is grouped and versioned per project
- Scoped access to
- Module Boundary
- Memory is filtered by
moduleIdwhen required (e.g., when generating withinbooking-service)
- Memory is filtered by
- Agent/Role Boundary
- Agents can only access memory related to their role/skill unless granted cross-role access
- 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:
tenantIdprojectIdagentIdoruserIdrolescope(read, write, reuse)
- All API requests validate token scope before allowing memory access
π« Redaction & Private Memory¶
Certain memory entries may be flagged:
accessScope: privateredacted: truesensitive: 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
- Marked
- Only agents with
allowCrossTenantReuse: truemay 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
- Memory metadata:
- Agentβs token:
β Result: Access denied (projectId mismatch + private scope)
π§± Isolation by Edition and Module¶
For multi-edition SaaS platforms:
- Memory can be segmented by:
editionIdfeatureFlagenvironment(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
GC logic:
- Keep
v3as active - Archive
v2(low reuse) - Expire and delete
v1(marked failed + redundant)
π GC Process Flow¶
- Run GC job (daily or weekly)
- Evaluate memory metadata:
lastAccessed,version,status,feedback,reuseCount
- Emit GC events:
MemoryMarkedStaleMemoryArchivedMemoryMarkedForExpiry
- Move blob files, delete vector entries, update metadata
- 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:
memoryIdagentIdactionTypetimestampRange
β 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, metadatamemory.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.
Related Documentation¶
Runtime & State¶
- State & Memory β How run state and AI memory are integrated in the Factory runtime
- Runtime & Control Plane Overview β Operational view of Factory runtime
- Execution Engine β How runs and jobs use state during execution
Architecture & Design¶
- Overall Platform Architecture β High-level Factory architecture
- Orchestration Layer β How orchestration uses knowledge and memory
- Knowledge Indices β Vector search and semantic retrieval
- Knowledge Graph β Graph-based knowledge representation