Tuesday, April 7, 2026

🚀 Agentic Framework 1.0 in .NET: The Power Combo of Semantic Kernel + AutoGen

The AI landscape is shifting fast—from simple prompt-response systems to autonomous, decision-making agents. If you're still building basic chatbots, you're already behind.

Enter Agentic Framework 1.0 in .NET—a practical evolution where Microsoft Semantic Kernel and AutoGen-style multi-agent orchestration come together to create intelligent, collaborative AI systems.

This isn’t just another framework. It’s a mindset shift.


🧠 What is an Agentic Framework?

An agentic framework is a system where AI agents:

  • Think (reason over tasks)
  • Act (execute tools/functions)
  • Collaborate (communicate with other agents)
  • Adapt (handle dynamic workflows)

Instead of one monolithic AI, you build a team of specialized agents.


⚙️ Why Combine Semantic Kernel + AutoGen?

Let’s be brutally honest:

  • Semantic Kernel alone → Great for plugins, orchestration, memory
    ❌ But weak in multi-agent collaboration out of the box
  • AutoGen-style systems → Excellent for agent-to-agent conversations
    ❌ But lack strong enterprise-grade integration and structured execution

👉 Combine them, and you fix each other’s weaknesses.


🧩 Architecture Overview

Here’s how Agentic Framework 1.0 typically looks:

                +----------------------+
                |   User / Trigger     |
                +----------+-----------+
                           |
                    +------v------+
                    |  Orchestrator|
                    +------+------+
                           |
        -----------------------------------------
        |                  |                    |
+-------v------+  +--------v--------+  +--------v--------+
| Planner Agent|  | Executor Agent  |  | Reviewer Agent  |
+--------------+  +-----------------+  +-----------------+
        |                  |                    |
        ----------- Communication Layer --------
                           |
                 +---------v----------+
                 | Semantic Kernel    |
                 | Plugins + Memory   |
                 +--------------------+

🔍 Core Components Explained

1. 🧭 Orchestrator (Brain)

This is your control layer.

  • Decides which agent to call
  • Manages workflow execution
  • Handles retries and failures

👉 Built using .NET + Semantic Kernel pipelines


2. 🤖 Agents (Specialists)

Instead of one AI doing everything poorly, split responsibilities:

🧠 Planner Agent

  • Breaks problem into steps
  • Uses reasoning (LLM)

⚡ Executor Agent

  • Calls APIs / tools
  • Uses Semantic Kernel plugins

🔍 Reviewer Agent

  • Validates output
  • Ensures quality

👉 This structure mimics real engineering teams. That’s why it works.


3. 🔌 Semantic Kernel (Execution Engine)

Semantic Kernel gives you:

  • Plugin system (functions as tools)
  • Memory (context persistence)
  • Prompt orchestration

Example:

var kernel = Kernel.CreateBuilder()
    .AddAzureOpenAIChatCompletion(...)
    .Build();

kernel.Plugins.AddFromType<WeatherPlugin>();

👉 This is where actual work happens.


4. 🔄 AutoGen Pattern (Collaboration Layer)

AutoGen-style design enables:

  • Agent-to-agent messaging
  • Task handoffs
  • Debate & refinement loops

Example flow:

Planner → Executor → Reviewer → (feedback loop) → Executor

👉 This is what makes the system agentic, not just scripted.


🔥 Real Use Case

Let’s say you’re building an AI content creator:

Flow:

  1. Planner Agent → "Write blog on .NET agents"
  2. Executor Agent → Calls content generation plugin
  3. Reviewer Agent → Improves SEO, grammar
  4. Optional Loop → Refine until quality threshold met

👉 This is not a chatbot. This is an AI workflow system.


💡 Why This Matters for .NET Developers

If you're still stuck in CRUD APIs, here’s the truth:

  • That skill is getting commoditized
  • AI-integrated systems are the next high-paying layer

With Agentic Framework:

  • You move from API developer → AI system architect
  • You build products, not endpoints

⚠️ Hard Truths (Read Carefully)

  • Just knowing Semantic Kernel ≠ you understand AI systems
  • Copy-pasting GitHub examples won’t make you job-ready
  • If you don’t understand orchestration, you’ll build toy apps

👉 The real value is in:

  • Designing agent roles
  • Handling failure cases
  • Managing cost (token usage)
  • Building scalable workflows

🧪 Minimal Starter Strategy

Don’t overcomplicate:

Step 1:

Build a single agent using Semantic Kernel

Step 2:

Add 2nd agent (planner + executor)

Step 3:

Introduce feedback loop

Step 4:

Add memory + logging

👉 That’s your Agentic Framework v1.


🚀 Final Thoughts

Agentic Framework 1.0 in .NET is not a library—it’s a pattern.

By combining:

  • Semantic Kernel → execution + tools
  • AutoGen concepts → collaboration + intelligence

You unlock a system that behaves less like software… and more like a team.

Monday, August 18, 2025

How to make Scheduler with Azure Queue using .net

I created Two methods one for schedule and log in db and second method is related to reschedule message.



1.

Schedule and Reschedule Message



2. While Process=>

Code Snippet

Friday, August 1, 2025

How to Do Cross-Browser Testing on Windows — Including Safari via Playwright

To test follow few steps:

Step 1. Install node
Step 2. create Folder and run these commands

commands


Step 3. update package.json 's scripts

package.json


Step 4. create Test folder in above folder and create file with name browser.test.ts and add below code

browser.test.ts


Step 5. run command npm run test:safari

Friday, July 18, 2025

How to Highlight a Link of Side Nav When It Has Multiple Child Links in Angular

🔗 How to Highlight a Link When It Has Multiple Child Links in Angular

When building a sidebar in Angular, you might want to highlight a parent link when any of its child routes are active. Angular’s routerLinkActive only works for single routes — so here’s a quick 2-step solution using a custom directive.

  1. Step 1: Create a custom directive
    Write a directive that checks the current URL against a list of child links and adds an active class if any match.

Step 1: Directive Code

  1. Step 2: Use it in your template
    On your parent menu link, pass the list of child URLs to the directive.

Step 2: Template Code

✅ Works with multiple child links, query parameters, and is easy to reuse.

✅ This blog is written by TechJourney with Gagan, sharing practical Angular tips for developers.

Tuesday, July 1, 2025

Create Search Functionality using 2 steps using pipe in Angular

To Implement Search Functionality without writing code in ts file

Step1: Create a Pipe using below code.

Code Of Search Filter Pipe



Step2: write below code where you want to implement search like in drop down.

Code Snippet



In above code we use just
<input matInput  placeholder="Search Company" #searchInput /><br> 
based on referece variable we took input and pass to pipe | searchByFilter:searchInput.value:'organizationName'"

Thursday, June 26, 2025

🧩 Implementing a Lightweight Query Handler in .NET using GMediator fully free for commerical use

In modern .NET applications, maintaining clean architecture is critical — and that’s where the Mediator pattern shines. It decouples the request/response flow and promotes separation of concerns.

While libraries like MediatR are popular, sometimes you want something even lighter — with zero dependencies.

Enter: GMediator, a custom lightweight mediator implementation.


🚀 What We’ll Build
In this blog, we’ll create a simple GET API using GMediator that returns a list of products stored in an in-memory store — no database, no ORM — just the core pattern in action.
🧱 Step 1: Define the Product Model

Code Snippet


💾 Step 2: Create an In-Memory Store

Code Snippet


📬 Step 3: Create the Query Request

Code Snippet


🎯 Step 5: Create the Controller

Code Snippet


🧪 Step 6: Register GMediator in Program.cs

Code Snippet


💡 Final Thoughts
GMediator is a great option for internal projects, low-dependency APIs, or learning the Mediator pattern hands-on.
You can extend this by adding Create, Update, Delete, or integrating with a real database like SQLite or SQL Server.

Wednesday, June 11, 2025

Building a Scalable .NET Backend Using Clean Architecture (With Optional Layers) in just an second

If you're building a new .NET backend, Clean Architecture is the best way to keep your code organized, scalable, and future-proof.
🧱 What is Clean Architecture?
It's a way to structure your project into layers:
Domain – core business models
Application – commands, queries, interfaces
Infrastructure – external services (API, logging, etc.)
Persistence – database (EF Core, SQL)
API – controllers
Tests – optional unit/integration tests
⚙️ Script-Based Setup
You can auto-generate this structure using a simple CMD script.
✅ You choose what to include:
Want Infrastructure? Type y
Need Tests? Type n
Want to skip Persistence? Type n




Steps To use:

1. use notepad save below code as setup-architecture.cmd

Code Snippet


2. save this file in respective folder where u want your project files
3. open cmd at this location and run this script by just type its name only that is setup-architecture.cmd

Wednesday, May 28, 2025

🔄 How to Extend Component Logic and Template in Angular (Simple Guide) => use of extends and ngTemplateOutlet

When building Angular apps, you might have common logic or reusable layouts across components. Instead of duplicating code, you can use extends in TypeScript and ng-template + ngTemplateOutlet in HTML.

Let’s walk through a simple example with 2 components where one extends logic and also injects custom HTML.


✅ Step 1: Create a Child Component (as base layout)

This is the reusable component that contains a common layout and logic.

child.component.ts

child.component.html

  • ✅ Layout and logic are defined here.
  • ✅ Accepts external HTML through contentTemplate.

✅ Step 2: Create a Parent Component That Extends Child

This component inherits logic from ChildComponent and injects its own template content.

parent.component.ts

parent.component.html

  • ✅ Inherits logic like title and getTitle() from ChildComponent.
  • ✅ Injects its own content via ng-template.

✅ Final Output

  • ChildComponent provides the reusable layout.
  • ParentComponent injects dynamic HTML and extends the logic.
  • This keeps your code DRY, clean, and scalable.

Use Cases: shared card layouts, reusable modal structures, dashboards, etc.

Friday, May 2, 2025

🧹 How to Remove SSR (Server Side Rendering) from an Angular 19 Project

Sometimes you add Angular SSR using @angular/ssr, but later want to return to a clean client-side app. Here's how to fully remove SSR (Server-Side Rendering) from your Angular project. 🔥 Step 1: Delete SSR Files Remove these files from the src/ folder: main.server.ts app.server.module.ts server.ts Any .server.ts files like: app.routes.server.ts app.config.server.ts 🛠️ Step 2: Update angular.json Inside "architect > build > options", remove the following: Also remove the entire "server" block from angular.json if it exists. 🧾 Step 3: Clean Up TypeScript Config ❌ Delete: tsconfig.server.json ✅ Edit tsconfig.app.json like this: 🧹 Step 4: Uninstall SSR Dependencies 🖥️ Run in Terminal / PowerShell / CMD: 🚀 Step 5: Clean & Serve PowerShell (Windows): Mac/Linux terminal: ✅ Done! Your Angular app is now SSR-free and runs entirely with Client-Side Rendering (CSR) — faster dev, fewer headaches!

Saturday, March 29, 2025

🚀 How to Copy a SQL Server Database Using a .bacpac File (Schema + Data) || Clone DB

#Clone Database 
Need to duplicate a full SQL Server database — including tables, views, stored procedures and data — without writing complex scripts?

Let me show you a simple, reliable method: Exporting and Importing a Data-tier Application (.bacpac). It’s perfect for backups, migrations, and creating dev/test clones.


 Step 1: Export the Source Database

  1. Open SQL Server Management Studio (SSMS).

  2. Right-click your source database → Tasks → Export Data-tier Application.

  3. Choose "Save to local disk", then pick a file path and name (YourDatabase.bacpac).

  4. Click Next through the wizard and generate the .bacpac file.


 Step 2: Import into Target Server

  1. In SSMS, right-click DatabasesImport Data-tier Application.

  2. Select the .bacpac file you exported.

  3. Give the new database a name.

  4. Complete the wizard. 🎉 Done!


🧩 Diagram

[ Source DB ] | | Export as .bacpac ↓ [ YourFile.bacpac ] | | Import on Target Server ↓ [ New DB Clone ]

Why Use This?

  • 🔄 Migrate databases between environments (dev, staging, prod).

  • 🛠️ Create dev/test clones without risking production.

  • 📦 Archive snapshots with both schema and data.

Friday, March 14, 2025

Run ai model in python code with ollama

 First download and install ollama By this blog:
Tech Journey With Gagan: Run Any AI Model with ollama in windows

For Use AI model in python:
1. run this script
Note: this example for mistral ai model please change acording to your model

Declare function


For run

it is work like this


Option 2: 
Run server explicitly 

1. Click on Quit Ollama


2. run server with ollama serve mean in cmd type "ollama serve".



Run Any AI Model with ollama in windows

Steps for install Any model with ollama in local : 
1. Download Olama  and install 


2.  open cmd and run "ollama" command to verify that ollama installed or not.



3. Install models  
    a. find your model and click on it.

   b. copy command and paste into terminal





                      press Enter now your model installed 

Note :Later on same command run your model will run automatically this time it is not downloading it just run 



How To work python with ollama: Run AI Model with Python

Friday, March 7, 2025

😮Create Task Scheduler app using AI Agent in just before 2 min 😮



Steps to create :
1. use Cline Agent extention in vs code.
2. use api of AI models like.
3. Give prompt to Cline.
4. Work automatically give you clean app.
Note: No need to create any file it will do automatically.

GitHub Repository Viewer

📌 GitHub Repository Viewer

Loading...


Git Hub Repo Link Here

Thursday, March 6, 2025

Building a C# Web API with Onion Architecture, CQRS, MediatR & Quartz.NET CRON Jobs

 


Introduction

In modern C# applications, clean architecture plays a crucial role in maintaining scalability and maintainability. In this blog, we will build a C# Web API using Onion Architecture, CQRS, MediatR, and Quartz.NET for scheduling background jobs. This guide will walk you through structuring a project with best practices and SOLID principles.

Why Use Onion Architecture?

Onion Architecture provides a clear separation of concerns by organizing the application into different layers:

  1. Domain Layer → Contains core business logic and entities

  2. Application Layer → Contains CQRS commands, queries, and interfaces

  3. Infrastructure Layer → Handles database, repository pattern, and external integrations

  4. Presentation Layer (API Layer) → Exposes the application as an API

Tech Stack

  • ASP.NET Core Web API for building RESTful APIs

  • Entity Framework Core for database operations

  • CQRS Pattern for separating read & write operations

  • MediatR for in-memory messaging

  • Quartz.NET for CRON Job scheduling

  • SOLID Principles to make the application scalable

    📌 Project Structure

    Your project will be structured as follows:

    Architecture Snippet

    Step 1: Create the Student Model (Domain Layer)

    📍 Location: Onion.Domain/Models/Student.cs

    Model Snippet

    Step 2: Create CQRS Commands & Queries (Application Layer)

    ✅ Command to Create a Student

    📍 Location: Onion.Application/Features/Students/Commands/CreateStudentCommand.cs

    Code Snippet

    ✅ Query to Get All Students

    📍 Location: Onion.Application/Features/Students/Queries/GetAllStudentsQuery.cs

    Code Snippet

    Step 3: Implement Repository (Infrastructure Layer)

    📍 Location: Onion.Infrastructure/Repositories/StudentRepository.cs

    Code Snippet

    Step 4: Implement CRON Job Using Quartz.NET

    📍 Location: Onion.Infrastructure/Scheduler/CronJobService.cs

    Code Snippet

    Step 5: Register Everything in Program.cs (API Layer)

    📍 Location: Onion.API/Program.cs

    Code Snippet

    Conclusion

    By following this guide, you have successfully built a C# Web API with Onion Architecture, CQRS, MediatR, and Quartz.NET CRON Jobs.
    This approach ensures:
    Scalability using Onion Architecture
    Separation of Concerns (SoC)
    Background Job Execution with Quartz.NET
    Better Maintainability with CQRS & MediatR

    🚀 Download Full Project
    Github

🔥 "Building a C# Web API with Onion Architecture, CQRS, MediatR & Quartz.NET CRON Jobs Project" 🚀


Cover In this:
✅ Onion Architecture ka Overview
✅ CQRS Pattern + MediatR used
✅ Quartz.NET ke sath CRON Jobs
✅ Dependency Injection & SOLID
✅ GitHub :https://github.com/gaganmanakpuria/AddStudentCronJobWithOnionArchitectureWithSOLID


GitHub Repository Viewer

📌 GitHub Repository Viewer

Loading...

Tuesday, February 25, 2025

Efficient Parallel Processing in .NET: Using Parallel.ForEach, IServiceScopeFactory, and ConcurrentBag

Parallel processing in .NET can significantly improve performance when dealing with large collections. However, when working with scoped dependencies and thread-safe collections, managing them properly is crucial. This blog explores how to use Parallel.ForEach, IServiceScopeFactory, and ConcurrentBag efficiently.

Why Use Parallel.ForEach?
Parallel.ForEach executes iterations in parallel, utilizing multiple CPU cores to improve performance. However, it does not automatically handle scoped dependencies from IServiceScopeFactory, which is essential when working with services like DbContext in ASP.NET Core.

Why IServiceScopeFactory?
Since DbContext and other scoped services should not be shared across multiple threads, using IServiceScopeFactory ensures each thread gets its own service scope.

Why ConcurrentBag?
When dealing with concurrent operations, ConcurrentBag is a thread-safe collection that allows multiple threads to add or retrieve items without conflicts.


Example:

Code Snippet


Key Takeaways
- Use Parallel.ForEach for performance gains when processing large collections.
- Utilize IServiceScopeFactory to create scoped services inside parallel loops.
- Store results in ConcurrentBag to ensure thread safety when collecting data.
This approach ensures efficient parallel execution while maintaining the integrity of scoped services in .NET. 🚀

Friday, February 14, 2025

🚀 Oops! Pushed to develop by Mistake? Here’s a Quick Fix! 🚀

🚀 Oops! Pushed to develop by Mistake? Here’s a Quick Fix! 🚀
We've all been there—accidentally pushing changes to the develop branch instead of a feature branch. Before you panic, there's a simple way to undo it gracefully using Git.

🔄 The Quick Fix
If you've mistakenly pushed your latest commit to develop, run the following command: 1️⃣ Save the commit/changes

Code Snippet


🔹 What does this do?
✅ Moves the latest commit to staged changes without deleting it.
✅ Allows you to fix things before re-committing or switching branches.

2️⃣ Discard the Commit Completely
If you want to undo the commit entirely (⚠️ This will remove all changes!):

Discard the Last Commit


🔄 Next Steps
Switch to the Correct Branch and Recommit
If you meant to push the changes to a different branch:

Move Changes to Correct Branch


😊Like that we can revert our mistake😊

Wednesday, February 12, 2025

How to handle when code push accidently in deleted branch

Have you ever pushed your code, only to realize the branch was deleted? 😱 No worries—your work isn't lost! Git keeps a history of all commits, and you can easily recover your code.
🚀 Steps to Recover Your Deleted Branch
1️⃣ Check Your Git Log Even if a branch is deleted, the commits still exist. Run:

Code Snippet

This will show a list of commit hashes with their messages.
2️⃣ Find Your Last Commit Look for the commit related to your deleted branch
3️⃣ Restore Your Branch Once you have the commit hash, recreate the branch:

Code Snippet

Note : Instead of "abc1234" write "your hashcode" and "recovered-branch" write your "new branch name"

😊Now you can push your code in that branch and you can able to create PR.😊

Sunday, February 9, 2025

How to Implement In Memory Caching in .net

 

Introduction

In modern web applications, performance is key. Fetching data repeatedly from a database can lead to increased response times and higher server load. One effective way to optimize performance is by using in-memory caching to store frequently accessed data. In this blog, we will explore how to integrate IMemoryCache in an ASP.NET Core Web API project to efficiently handle CRUD operations for a Student entity.

What is In-Memory Caching?

In-memory caching is a mechanism that temporarily stores frequently accessed data in memory, reducing the need to retrieve it from the database each time. ASP.NET Core provides IMemoryCache, which is a simple, high-performance, and thread-safe cache.

Setting Up the Project

To demonstrate in-memory caching, let’s build an ASP.NET Core Web API with a StudentController that performs CRUD operations using Entity Framework Core.

1. Install Required Dependencies

Ensure you have the necessary NuGet packages installed in your ASP.NET Core project:




2. Add Model and  AppDb Context file



Student Model

AppDb Context File

3. Add in Appsettings.json just below of AllowedHosts by put comma

Connection String

4. Add Settings

Program.cs

5. Add-Migration and Update-database run two commands
6. add Controller with name Student

Student Controller

6. SetSlidingExpiration: refreseh if no activity in 10 min
SetAbsoluteExpiration : always refresh after 1 hour

Expalin memory Cache options

Note: In this i used semaphoreslim for single process optimised the in memory cache. I am updating the in memory cache when add and update and delete. also this approch is helpfull for single server or small level applications. for multiserver or high level application we should go with distributed cache technique like redis so our ram not effected to much.

Clone this poc:InMemoryCachePOC

🚀 Agentic Framework 1.0 in .NET: The Power Combo of Semantic Kernel + AutoGen

The AI landscape is shifting fast—from simple prompt-response systems to autonomous, decision-making agents . If you're still building b...