Skip to content

Knowledge & Memory System

This document describes the knowledge and memory system that powers the ConnectSoft AI Software Factory. It is written for architects and engineers understanding how the Factory learns, stores patterns, and improves over time.

All code, docs, blueprints, and tests are stored as knowledge modules with semantic search, metadata, and vector DB retrieval. This memory system enables the Factory to learn from every project, reuse patterns, and generate increasingly better code over time.

Important

The knowledge system is the Factory's strategic moat. Over time, accumulated patterns, solutions, and domain expertise make the Factory increasingly valuable and difficult to replicate. Every generation run adds to the knowledge base, making future generations faster and more accurate.

Types of Knowledge

The Factory stores several types of knowledge:

Configuration & Templates

What: Template definitions, configuration schemas, and parameter specifications.

Examples: - Microservice template structure - Library templates - Infrastructure templates - Configuration file templates

Usage: Agents use templates to ensure consistency and structure.

Project Histories

What: Historical records of all projects, including ADRs, BDRs, and previous generation runs.

Examples: - Architecture Decision Records (ADRs) - Business Decision Records (BDRs) - Project blueprints and designs - Generation run logs and outcomes

Usage: Agents learn from past decisions and avoid repeating mistakes.

Domain-Specific Knowledge

What: Industry-specific blueprints, patterns, and domain models.

Examples: - Insurance domain patterns (policies, claims, underwriting) - VetCare domain patterns (appointments, patients, treatments) - SaaS platform patterns (multi-tenancy, subscription management) - E-commerce patterns (catalog, cart, orders)

Usage: Agents reuse proven domain patterns for faster, more accurate generation.

Operational Metrics

What: Data about what worked, what failed, and performance characteristics.

Examples: - Code quality metrics (test coverage, complexity) - Performance metrics (generation time, success rates) - Pattern usage statistics (which templates are used most) - Error patterns and resolutions

Usage: Agents optimize generation based on historical performance data.

Code Patterns

What: Reusable code snippets, patterns, and solutions.

Examples: - Domain entity patterns - API controller patterns - Event handler patterns - Repository patterns - Test patterns

Usage: Agents reuse proven code patterns to generate consistent, high-quality code.

Storage & Retrieval

The knowledge system uses multiple storage mechanisms:

Vector Stores

Purpose: Semantic search using embeddings to find conceptually similar solutions.

Technology: Vector databases (e.g., Azure Cognitive Search with vector support, specialized vector DBs).

How It Works: - Code, docs, and blueprints are embedded into vector space - Semantic queries find similar solutions based on meaning, not just keywords - Enables finding solutions even when exact keywords don't match

Example: Query "multi-tenant user management" finds solutions for "tenant isolation" and "user context propagation" even if those exact words aren't used.

Relational/NoSQL Metadata

Purpose: Structured metadata for filtering and organization.

Technology: Relational databases or NoSQL stores for structured data.

How It Works: - Stores metadata: domain, type, tags, creation date, usage count - Enables filtering: "Find all microservices in Insurance domain" - Tracks relationships: "Which services use this pattern?"

Example: Query "Find all Audit microservices" uses metadata filtering, then semantic search finds similar patterns.

Azure DevOps Integration

Purpose: Direct access to customer repositories and work items.

How It Works: - Agents read from Azure DevOps: repositories, work items, pipelines - Agents write to Azure DevOps: commits, work items, documentation - Knowledge system indexes Azure DevOps content for search

Example: Agent queries knowledge system, finds similar solution in customer's previous project, retrieves code from Azure DevOps.

Knowledge Flow Diagram

flowchart TD
    subgraph "Agents"
        A1[Vision Agent]
        A2[Architect Agent]
        A3[Engineering Agent]
        A4[QA Agent]
    end

    subgraph "Knowledge Storage"
        VS[Vector Store<br/>Semantic Search]
        MD[Metadata DB<br/>Structured Data]
        ADO[Azure DevOps<br/>Repos & Work Items]
    end

    subgraph "Artifacts"
        CODE[Generated Code]
        DOCS[Documentation]
        BLUEPRINTS[Blueprints]
        TESTS[Tests]
    end

    A1 -->|Query| VS
    A2 -->|Query| VS
    A3 -->|Query| VS
    A4 -->|Query| VS

    VS -->|Semantic Results| A1
    VS -->|Semantic Results| A2
    VS -->|Semantic Results| A3
    VS -->|Semantic Results| A4

    MD -->|Filtered Results| VS

    A3 -->|Store| CODE
    A1 -->|Store| DOCS
    A2 -->|Store| BLUEPRINTS
    A4 -->|Store| TESTS

    CODE -->|Index| VS
    DOCS -->|Index| VS
    BLUEPRINTS -->|Index| VS
    TESTS -->|Index| VS

    CODE -->|Metadata| MD
    DOCS -->|Metadata| MD
    BLUEPRINTS -->|Metadata| MD

    ADO <-->|Read/Write| A3
    ADO -->|Index| VS

    style VS fill:#4F46E5,color:#fff
    style MD fill:#2563EB,color:#fff
    style ADO fill:#10B981,color:#fff
Hold "Alt" / "Option" to enable pan & zoom

How Agents Use Knowledge

Agents use knowledge in several ways:

Avoid Repeating Mistakes

How: Agents query knowledge system for past failures and avoid similar patterns.

Example: If a previous generation had performance issues with a specific pattern, agents avoid that pattern in future generations.

Reuse Patterns Across Projects

How: Agents find similar solutions from previous projects and adapt them.

Example: Agent generating an Audit microservice finds a similar Audit microservice from a previous project and reuses proven patterns.

Generate Consistent Naming and Structures

How: Agents learn naming conventions and structural patterns from knowledge system.

Example: Agent learns that "Invoice" aggregates are typically named "InvoiceAggregate" and follow a specific structure, then applies this consistently.

Context-Aware Generation

How: Agents retrieve relevant context based on current task and domain.

Example: Agent generating Insurance domain code retrieves Insurance-specific patterns and domain models from knowledge system.

Continuous Improvement

How: Agents store outcomes and metrics, enabling the system to learn what works best.

Example: System learns that certain template configurations produce higher-quality code, then prefers those configurations.

Governance and Safety

The knowledge system includes governance and safety mechanisms:

Access Control Between Tenants

Mechanism: Strict tenant isolation in knowledge storage.

How It Works: - Each customer's knowledge is stored separately - Agents can only access knowledge from their tenant - No cross-contamination between customer projects

Safety: Customer data and patterns never leak to other customers.

No Cross-Contamination

Mechanism: Metadata tagging and filtering ensures proper isolation.

How It Works: - All knowledge tagged with tenant ID - Queries filtered by tenant automatically - Vector search scoped to tenant's knowledge

Safety: Even semantic search respects tenant boundaries.

Alignment with Security/Compliance

Mechanism: Knowledge system follows same security and compliance policies as Factory.

How It Works: - Encryption at rest and in transit - Audit logs for all knowledge access - Compliance with data residency requirements - No training on customer data without explicit opt-in

Safety: Knowledge system meets enterprise security and compliance standards.

Important

The knowledge system maintains strict tenant isolation. Customer data and patterns never leak to other customers, even through semantic search. This is critical for enterprise trust and compliance.

Example Knowledge Flows

Example 1: New Project Leveraging Internal Blueprint

Scenario: Customer wants to build an Audit Platform similar to ConnectSoft's internal Audit Platform.

Flow:

  1. Architect Agent queries knowledge system:
  2. Searches for "Audit Platform" patterns
  3. Finds ConnectSoft's internal Audit Platform blueprint
  4. Retrieves architecture, APIs, and domain models

  5. Architect Agent adapts blueprint:

  6. Uses internal blueprint as starting point
  7. Adapts to customer's specific requirements
  8. Creates new ADR documenting adaptations

  9. Engineering Agent queries knowledge system:

  10. Searches for "Audit event storage" patterns
  11. Finds proven patterns for event storage and querying
  12. Reuses code patterns from knowledge system

  13. Knowledge system stores new project:

  14. Stores customer's Audit Platform as new knowledge module
  15. Tags with customer tenant ID
  16. Indexes for future semantic search

Result: Customer gets Audit Platform faster by leveraging proven patterns, while knowledge system learns from customer's specific adaptations.

Example 2: QA Agent Logging Outcomes

Scenario: QA Agent validates generated code and logs outcomes.

Flow:

  1. QA Agent validates code:
  2. Runs tests and quality checks
  3. Identifies issues and patterns
  4. Generates quality report

  5. QA Agent stores outcomes:

  6. Stores test results and coverage metrics
  7. Stores quality issues found
  8. Stores resolution patterns

  9. Knowledge system learns:

  10. Tracks which patterns produce high-quality code
  11. Identifies common quality issues
  12. Suggests improvements for future generations

  13. Future agents benefit:

  14. Engineering agents avoid patterns that cause quality issues
  15. QA agents know what to check based on historical data
  16. System improves over time

Result: Knowledge system learns from every validation, making future generations better.

Example 3: Cross-Project Pattern Reuse

Scenario: Customer has multiple projects, wants to reuse patterns from Project A in Project B.

Flow:

  1. Architect Agent queries knowledge system:
  2. Searches for patterns from Project A
  3. Finds relevant patterns (e.g., "multi-tenant user management")
  4. Retrieves patterns with full context

  5. Architect Agent adapts patterns:

  6. Uses Project A patterns as reference
  7. Adapts to Project B's domain and requirements
  8. Ensures consistency across projects

  9. Knowledge system tracks reuse:

  10. Records that Project B reused Project A patterns
  11. Tracks which patterns are reused most
  12. Enables finding related projects

Result: Customer maintains consistency across projects while knowledge system learns which patterns are most valuable.