yanjustino/AgentPatternCatalogue

C#

8

24 commits

updated Dec 6, 2025

See the code

README

🧠 Agent Patterns in C#

Welcome to the Agent Patterns Project β€” a hands-on, developer-friendly exploration of agent design patterns for foundation model-based systems.

This repository brings to life selected architectural patterns from the paper
Agent Design Pattern Catalogue: A Collection of Architectural Patterns for Foundation Model Based Agents by Yue Liu et al. (CSIRO Data61).

πŸš€ Goal: Implement and experiment with agent behavior, memory handling, and goal inference using C# and local LLMs like LLaMA.
πŸ§ͺ Why? This is a research-driven initiative to learn and explore how these patterns work in practice β€” not just theory.


βœ… Implemented Patterns

  • πŸ“„ Passive Goal Creator is the first pattern implemented in this project. It extracts user goals from natural language input by using contextual memory and a local LLaMA model.
  • πŸ“„ Proactive Goal Creator anticipates users’ goals by analysing human interactions and proactively capturing multimodal context through appropriate detectors, thereby enriching goal descriptions and improving accessibility.
  • πŸ“„ Prompt Response Optimiser is a pattern designed to enhance the interaction between agents and large language models (LLMs). It refines goals and contextual information into optimized prompts, ensuring that the LLM produces accurate, relevant, and goal-aligned responses.
  • πŸ“„ Retrieval Augmented Generation (RAG) is a pattern that combines retrieval and generation techniques to enhance the performance of large language models (LLMs). It retrieves relevant information from a knowledge base and uses it to generate more accurate and contextually relevant responses.
  • πŸ“„ One-Shot Model Querying is a pattern that describes a direct interaction in which the agent queries a foundation model (LLM) only once to generate a complete plan based on a user’s input. This approach favors simplicity and efficiency, making it suitable for straightforward tasks that can be handled in a single reasoning step.
  • πŸ“„ Incremental Model Querying is a pattern that describes an iterative process where the agent interacts with the foundation model multiple times throughout plan generation. At each step, new prompts and partial context are used to refine the reasoning and build a more complete, explainable plan.
  • πŸ“„ Voting Based Cooperation is a pattern that enables multiple agents to independently estimate the complexity of user stories by voting. A coordinator agent collects, validates, and aggregates these votes, presenting the results in a clear and structured format without performing consensus or statistical analysis.
  • πŸ“„ Multimodal Guardrails is a pattern that applies guardrails as an intermediate layer between the foundation model and all other system components. It ensures robustness, safety, and standards alignment by validating inputs and outputs across multiple modalities (text, image, audio).

βš™οΈ Dependencies

Ollama

We use Ollama to run foundation models locally.

  1. Download Ollama
  2. Ensure the server is running at http://localhost:11434/
  3. Verify with:
    ollama list
    
  4. Pull the phi3:mini model:
    ollama pull phi4-mini:latest
    

⚑ Quick Start

Clone the repo, restore dependencies, and run the agent:

# Run the PassiveGoalCreator agent
dotnet run --project agent-patterns/src/<<patter>>/<<pattern>>.csproj

βœ… Make sure the Ollama server is running before launching the agent.


πŸ”­ Future Work

New patterns from the paper will be added iteratively.
Stay tuned β€” this project is evolving with each experiment and pull request!

yanjustino/AgentPatternCatalogue

C#

8

24 commits

updated Dec 6, 2025

See the code

README

🧠 Agent Patterns in C#

Welcome to the Agent Patterns Project β€” a hands-on, developer-friendly exploration of agent design patterns for foundation model-based systems.

This repository brings to life selected architectural patterns from the paper
Agent Design Pattern Catalogue: A Collection of Architectural Patterns for Foundation Model Based Agents by Yue Liu et al. (CSIRO Data61).

πŸš€ Goal: Implement and experiment with agent behavior, memory handling, and goal inference using C# and local LLMs like LLaMA.
πŸ§ͺ Why? This is a research-driven initiative to learn and explore how these patterns work in practice β€” not just theory.


βœ… Implemented Patterns

  • πŸ“„ Passive Goal Creator is the first pattern implemented in this project. It extracts user goals from natural language input by using contextual memory and a local LLaMA model.
  • πŸ“„ Proactive Goal Creator anticipates users’ goals by analysing human interactions and proactively capturing multimodal context through appropriate detectors, thereby enriching goal descriptions and improving accessibility.
  • πŸ“„ Prompt Response Optimiser is a pattern designed to enhance the interaction between agents and large language models (LLMs). It refines goals and contextual information into optimized prompts, ensuring that the LLM produces accurate, relevant, and goal-aligned responses.
  • πŸ“„ Retrieval Augmented Generation (RAG) is a pattern that combines retrieval and generation techniques to enhance the performance of large language models (LLMs). It retrieves relevant information from a knowledge base and uses it to generate more accurate and contextually relevant responses.
  • πŸ“„ One-Shot Model Querying is a pattern that describes a direct interaction in which the agent queries a foundation model (LLM) only once to generate a complete plan based on a user’s input. This approach favors simplicity and efficiency, making it suitable for straightforward tasks that can be handled in a single reasoning step.
  • πŸ“„ Incremental Model Querying is a pattern that describes an iterative process where the agent interacts with the foundation model multiple times throughout plan generation. At each step, new prompts and partial context are used to refine the reasoning and build a more complete, explainable plan.
  • πŸ“„ Voting Based Cooperation is a pattern that enables multiple agents to independently estimate the complexity of user stories by voting. A coordinator agent collects, validates, and aggregates these votes, presenting the results in a clear and structured format without performing consensus or statistical analysis.
  • πŸ“„ Multimodal Guardrails is a pattern that applies guardrails as an intermediate layer between the foundation model and all other system components. It ensures robustness, safety, and standards alignment by validating inputs and outputs across multiple modalities (text, image, audio).

βš™οΈ Dependencies

Ollama

We use Ollama to run foundation models locally.

  1. Download Ollama
  2. Ensure the server is running at http://localhost:11434/
  3. Verify with:
    ollama list
    
  4. Pull the phi3:mini model:
    ollama pull phi4-mini:latest
    

⚑ Quick Start

Clone the repo, restore dependencies, and run the agent:

# Run the PassiveGoalCreator agent
dotnet run --project agent-patterns/src/<<patter>>/<<pattern>>.csproj

βœ… Make sure the Ollama server is running before launching the agent.


πŸ”­ Future Work

New patterns from the paper will be added iteratively.
Stay tuned β€” this project is evolving with each experiment and pull request!

Languages

C#

100.0%