DEV Community

Cover image for How to Build Blog Generator AI App Using Deep Seek R1 and Semantic Kernel in .NET9
CodeStreet
CodeStreet

Posted on • Edited on

5

How to Build Blog Generator AI App Using Deep Seek R1 and Semantic Kernel in .NET9

In this post, I’m excited to share the journey behind our latest project: building a blog generator AI app that harnesses the power of Deep Seek R1, Semantic Kernel, and .NET9. This blog serves as a companion to my YouTube video where I walk through the entire process step-by-step.

Introduction

Have you ever found yourself staring at a blank screen, struggling to come up with blog content? What if you could let AI do the heavy lifting and generate blog posts for you? In this tutorial, I'll show you how to build an AI-powered blog generator that not only speeds up content creation but also produces quality posts automatically.

What You'll Learn

  • Integrating Deep Seek R1: Learn how to leverage advanced search capabilities to gather relevant content and ideas.
  • Using Semantic Kernel: Discover how to orchestrate AI tasks for natural language processing and content generation.
  • Building with .NET9: See how .NET9 provides a robust framework for developing and deploying your AI application.
  • Step-by-Step Guidance: Follow a clear, concise guide that breaks down the process into manageable steps.

Why Build an AI-Powered Blog Generator?

Automating blog creation saves you time and effort, allowing you to focus on other aspects of your business or creative pursuits. This project not only demonstrates cutting-edge technology integration but also provides a scalable solution for content creators and developers alike.

Technologies at a Glance

  • Deep Seek R1: This tool helps in deep searching, ensuring your content is backed by extensive and relevant data.
  • Semantic Kernel: Acts as the brain behind content generation by processing natural language and orchestrating AI tasks.
  • .NET9: The latest iteration of .NET offers improved performance, modern features, and a great development experience for building robust applications.

1. Prerequisites

  • Visual Studio 2022+ (with .NET 9 SDK installed) .NET 9 is still in preview, so ensure that you have the preview SDK installed.
  • Ollama (for managing and running local models)
  • DeepSeek1.5b Model

2. Installing Ollama

Ollama is a platform or tool (specific details may vary depending on the context) that allows users to interact with large language models (LLMs) locally. It simplifies the process of deploying and running LLMs like LLaMA, Phi, DeepSeek R1, or other open-source models.

To install Ollama visit its official website https://ollama.com/download and install it on your machine.

3. Installing DeepSeek R1

DeepSeek's first-generation reasoning models with comparable performance to OpenAI-o1, including six dense models distilled from DeepSeek-R1 based on Llama and Qwen.

On the Ollama website click on Models and click on deepseek-r1 and choose 1.5b parameter option

How To Use DeepSeek With .NET 9 - deepseek-r1:1.5b

Open Command Prompt and run the below command.

ollama run deepseek-r1:1.5b

It will download the model and start running automatically.

Once done, verify the model is available

ollama list

That’s it! We’re ready to integrate DeepSeek locally.

4. Creating .NET Console Application

  1. Launch Visual Studio
  2. Make sure .NET 9 is installed.
  3. Create a New Project
  4. File → New → Project…
  5. Pick Console App with .NET 9.
  6. Name Your Project
  7. e.g., DeepSeekDemoApp or any name you prefer.
  8. Target Framework Check
  9. Right-click on your project → Properties.
  10. Set Target Framework to .NET 9.

5. Integrating DeepSeek R1 with Semantic Kernel

While you could call DeepSeek via direct HTTP requests to Ollama, using Semantic Kernel offers a powerful abstraction for prompt engineering, orchestration, and more.

  1. Add Necessary NuGet Packages
<ItemGroup>
  <PackageReference Include="Codeblaze.SemanticKernel.Connectors.Ollama" Version="1.3.1" />
  <PackageReference Include="Microsoft.SemanticKernel" Version="1.35.0" />
</ItemGroup>
Enter fullscreen mode Exit fullscreen mode

6. Code

using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Codeblaze.SemanticKernel.Connectors.Ollama;
using Microsoft.Extensions.DependencyInjection;

var builder = Kernel.CreateBuilder().AddOllamaChatCompletion("deepseek-r1:1.5b", "http://localhost:11434");

builder.Services.AddScoped<HttpClient>();

Kernel kernel = builder.Build();
var chatCompletionService = kernel.GetRequiredService<IChatCompletionService>();

string GetUserInput(string prompt)
{
    Console.ForegroundColor = ConsoleColor.Green;
    Console.WriteLine(prompt);
    Console.ForegroundColor = ConsoleColor.White;
    return Console.ReadLine();
}

string topic = GetUserInput("Tell me the topic for the blog");
string tone = GetUserInput("Provide blog tone");
int length = Convert.ToInt32(GetUserInput("Provide total blog length"));
string keywords = GetUserInput("Provide some keywords to target");

string prompt = $@"
Your_prompt
";

var blogResponse = await kernel.InvokePromptAsync(prompt);

Console.ForegroundColor = ConsoleColor.DarkCyan;

Console.WriteLine(blogResponse.ToString());

Console.WriteLine("Press enter to exit...");
Console.ReadLine();

Enter fullscreen mode Exit fullscreen mode

Downlaod Complete Project

Generated Blog

It generates the blog into markdown format, which Dev.to and Github support, you can also easily convert it into WordPress formats.

How to Build Blog Generator AI App Using Deep Seek R1

# The Future of Social Media Marketing: Why It’s Revolutionizing Modern Business Strategies  

## The Rise of Social Media in the Modern World  

In an era where social media has taken center stage as a key tool for business growth, social media marketing has emerged as a transformative force. From connecting with customers and driving sales to engaging the public on every level, this platform is reshaping how businesses approach their communication strategies.  

## The Key Benefits of Social Media Marketing  

### 1. **Sustainable Social Media Strategy**  
One of the most significant advantages of social media marketing is its ability to break free from traditional marketing boundaries. By leveraging platforms like Instagram and Facebook, businesses can consistently build relationships with customers who may not be reachable through other channels. This strategy ensures that the brand remains relevant and effective in the face of ever-changing market conditions.  

### 2. **Increased Visibility & Reach**  
Social media is renowned for its global reach. Through consistent posting and interactive content, brands gain visibility beyond their local markets. For example, a small business might see its product appear on billions of Instagram stories or Facebook posts every day, creating a loyal audience that would be difficult to compete with in a traditional marketing campaign.  

### 3. **Targeted Audience Engagement**  
One of the most powerful tools of social media marketing is its ability to target specific audiences. By analyzing data from platforms like Instagram and Facebook, businesses can identify demographics and interests where they can create more effective campaigns. This targeted approach ensures that marketing efforts align with customer needs, leading to higher engagement and conversions.  

### 4. **Building a Social Following**  
Social media is not just about sharing content; it’s also about building a community around the brand. By engaging with followers regularly and responding to comments, businesses can establish trust and credibility. This follows can lead to long-term relationships with customers who are drawn to brands that value their connection and want to share their own.  

### 5. **Improved Customer Relationships**  
Social media marketing is about more than just selling a product. It’s also about fostering meaningful connections. By sharing personal stories, tips, and updates, businesses can connect deeply with their audience and strengthen long-term relationships. This creates loyalty and trust that can translate into repeat business.  

## Examples of Social Media Marketing in Action  

### Instagram Marketing: A Global Reach  
A small tech startup, *TechGenius*, used Instagram to launch its latest product line. They created content that highlighted the benefits of their innovation, connecting with customers across countries through consistent posting and interactive posts. This strategy not only brought their product to a global audience but also built a loyal following.  

### Facebook Marketing: Building a Community  
A retail store, *FashionFlix*, used Facebook to create a community around its products. By sharing behind-the-scenes content, engaging with customers, and participating in influencer collaborations, the brand established itself as knowledgeable and trustworthy. This not only helped sell their clothing but also fostered connections that could lead to word-of-mouth referrals.  

### A/B Testing on Social Media: Measuring Success  
Social media marketing often involves testing different strategies to determine what works best for a business. By running A/B tests on platforms like Instagram or Facebook, companies can see which content types resonate with their audience and adjust their marketing efforts accordingly. This data-driven approach ensures that marketing initiatives are effective and aligned with customer needs.  

## Tools & Platforms for Social Media Marketing  

From content creation tools to analytics platforms, there’s no shortage of resources available to businesses looking to improve their social media strategy. Platforms like Instagram, Facebook, and YouTube have built into them powerful tools for creating engaging posts, tracking engagement, and measuring performance. By utilizing these features effectively, businesses can maximize the impact of their social media marketing efforts.  

## The Ultimate Guide: Tips on Social Media Marketing  

### 1. **Content Creation**  
The foundation of any successful social media strategy is well-crafted content. Businesses should focus on creating engaging, relevant, and timely posts that resonate with their audience. Whether it’s showcasing a product, sharing tips for a task or discussing recent events, the right content can catch people’s attention and encourage action.  

### 2. **Engagement**  
Social media is not just about posting; it’s also about interacting with your audience. Regular updates and timely responses to comments and questions create a sense of connection and trust. This engagement not only helps build relationships but also reinforces the brand’s message, making customers more likely to return for future purchases.  

### 3. **Analytics**  
To maximize the effectiveness of social media marketing, businesses should track their performance through analytics tools. These tools allow them to measure the impact of their content, identify trends in their audience, and adjust their strategies accordingly. By staying data-driven, they can ensure that their efforts are aligned with customer needs and driving results.  

### 4. **Leverage Influencer Marketing**  
Influencers are a powerful tool in social media marketing. Businesses should engage with influencers to gain credibility and reach a wider audience. Collaborating with influencers or following them on platforms like Instagram can help establish authority and trust, leading to more engagement from their followers.  

### 5. **Stay Updated with Trends**  
Social media is a dynamic platform that evolves quickly. To stay ahead of the curve, businesses should be aware of new trends and tools available on platforms like Instagram, Facebook, and Twitter. Keeping their strategy updated ensures they remain relevant in a competitive market and can adapt to changing customer preferences.  


Enter fullscreen mode Exit fullscreen mode

Support me

If you found this guide helpful, make sure to check out the accompanying YouTube video tutorial where I walk you through the process visually. Don’t forget to subscribe to my channel for more amazing tutorials!

I appreciate it if you could buy me a coffee.
Buy me a coffee

Conclusion

Building a blog generator AI app is not only an exciting project but also a practical solution for anyone looking to enhance their content creation process. I hope this guide inspires you to explore the possibilities of AI in your projects. If you have any questions or ideas, feel free to leave a comment below!

Feel free to leave your questions, comments, or suggestions below. Happy coding!

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️