Skip to content

SimpleAISearch: Implementing Simple AI Search Using C# Semantic Kernel and DuckDuckGo.

License

Notifications You must be signed in to change notification settings

Ming-jiayou/SimpleAISearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

简体中文 | English

SimpleAISearch✨

Implement a simple AI search using C# Semantic Kernel and DuckDuckGo.✨

Recently, AI search has become very popular, with platforms like Perplexity, Metaphora, MindSearch, Perplexica, memfree, khoj, and more.

During the use of large language models, you may have encountered the limitation of not being able to access the latest online information, resulting in responses that are not based on the most up-to-date information. To address this issue, a solution can be achieved through a combination of large language models (LLM) and search engines.

Taking a simple open-source project I previously developed as an example, if you directly ask a general large language model, it may not know the answer, as shown below:

image-20240924090255175

Compare the responses that can be connected to the internet as follows:

Perplexity

image-20240924090303534

khoj

image-20240924090314749

Kimi

image-20240924090322749

Let's see how we can achieve a similar effect on our own:

Translate the input above into English, without any additional content.

image-20240924090331157

GitHub repository link: https://github.com/Ming-jiayou/SimpleAISearch

If you're interested, you can continue reading below.

Implementation Ideas

Essentially, it's about integrating LLM with a search engine.

First, you need to enable function calling capabilities, which I've previously discussed. I'll mainly outline the implementation ideas here, and the source code is open-sourced, so feel free to check it out for more details.

First, add the code to call the search engine in the plugin. The search engine I used here is DuckDuckGo.

When execution starts, the LLM will determine that it needs to call this function, and the parameter is the question:

image-20240920105218166

The function is as follows:

image-20240920105254572

A search engine will find relevant content:

image-20240924090340697

Translate the input above into English with no additional content:

image-20240920105518735

Currently, after summarization, the results are displayed on the interface, and it can also be modified to not go through summarization.

That's the simple idea for the implementation.

Quick Start

Build from Source Code

Similar to previous LLM projects, simply rename appsettings.example.json to appsettings.json, select your platform of choice, and fill in your API Key.

Direct Experience

I have published two versions on GitHub, one that requires a framework and one that does not:

image-20240920113656942

Download and unzip, then fill in your API key in appsettings to start using it.

About

SimpleAISearch: Implementing Simple AI Search Using C# Semantic Kernel and DuckDuckGo.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages