DEV Community

Cover image for Creating an πŸ‘©β€πŸ’» Open Source Search Platform: Search Engines with AI - Swirl 🌌
Saurabh Rai for Swirl

Posted on

Creating an πŸ‘©β€πŸ’» Open Source Search Platform: Search Engines with AI - Swirl 🌌

Swirl is an Open-Source Search Engine written in Python. Powered by Large Language Models (LLMs) & ChatGPT along with ML & NLP Algorithms.

Before wasting time, let me introduce Swirl. This unified open-source search platform built with Python and Django seamlessly unifies searches across databases (SQL and NoSQL), cloud services, search providers, data siloes, and tools like Miro, Jira, GitHub, etc.

With Swirl, users can conduct a single query, instantly pooling and presenting relevant data from multiple platforms in one consolidated UI.

Swirl on GitHub πŸ‘‡

Link: https://github.com/swirlai/swirl-search🌌

Swirl Search on GitHub

The Hunt for Open Source Search Platforms πŸ•΅οΈβ€β™€οΈ

Search is everywhere in our daily lives. Giants like Google Search, Bing, and Duck Duck make it easy for us to find information at the click of a button.

However, the choices are somewhat limited for businesses, startups, and developers looking to incorporate search functionality into their platforms without being bound to these major players. Most enterprise-level search engines come with licensing fees or restrictions. Integration options such as Google's Programmable Search Engine and Algolia are powerful. Still, they might not always cater to the specific needs of all businesses, especially when customization and self-hosting are concerned.

This brings out the need for open-source search engines. For all the users trying to integrate search into their platforms, Swirl serves as one of the best choices. Built on Python, and it's highly customizable. Being free and open-source, it carries the Apache 2.0 License, which means developers and businesses can utilize and modify it without any licensing costs. The teams can contribute towards its development by doing improvements, bug fixes, and feature enhancements.

Searching for Open Source Search Engines

Dealing with Many Data Sources, Data Bases, and Data Siloes 😿

As any startup or company grows, so does the size of its data and databases. Eventually, the complexity of finding the correct information increases as well. As these organizations expand, they inevitably accumulate data in various forms – traditional documents, code repositories, spreadsheets, or more structured databases like SQL and NoSQL. The real challenge, however, is not just storing this large volume of data but efficiently retrieving the information when needed.

Where is the Data? We should have used Swirl

So, in which database is our document lying? Is it in USE_CASE_1 or USE_CASE_2?
A typical scenario is when you need data and don't know where.

The diversity of data sources adds another layer of complexity. Imagine sifting through a vast library where books, journals, handwritten notes, and digital records are all stored haphazardly. Sounds daunting, right? That’s precisely the scenario many businesses face today. Different data types, coupled with isolated data siloes, can make it a Herculean task for employees to locate the correct information promptly.

Swirl connects to multiple data sources and can search in all. Swirl is a centralized hub, enabling streamlined searches across all integrated data sources. This simplifies the search process and ensures that no crucial information gets overlooked because of its origin or format.

Using LLMs with Search and Bringing Multiple Data Sources Together 🀝

Swirl distributes user queries to search engines, databases, and other enterprise cloud services using their existing APIs and standards-based security mechanisms like OAuth2. Swirl asynchronously normalizes and re-ranks the unified results using large language models.

Let's understand how Swirl works.

  1. The user provides the data sources to which Swirl integrates.
  2. The user creates a query to search for.
  3. Swirl sends those queries to each source.
  4. Get the response and find the best using LLMs.
  5. Swirl then gets the citations in an async pipe.
  6. It then fetches the top results and creates a prompt.
  7. It sends the data + prompt to ChatGPT (or any LLM).
  8. Swirl returns answers with ChatGPT insights.

Diagram Explaining Swirl Search with ChatGPT as a configured LLM

How Swirl Works

A diagram explaining how Swirl can work with multiple data sources and provide results with ChatGPT insights.

The whole search process is simplified, and setting up Swirl is pretty straightforward. To state Raman Ramanenkou of Sense.

β€œSetting up and running Swirl in a Docker container is incredibly straightforwardβ€”it takes just a few minutes.
~ Raman Ramanenkou of Sense

Data privacy and security are essential while searching. People should only be able to search for information they can access in any corporation. Swirl incorporates OAuth2 authentication. This means that the access and visibility of data are tightly controlled based on the credentials of the individual searching. It ensures that sensitive information remains restricted, and only those with the necessary permissions can view it.

Therefore, someone who doesn't have access to critical files cannot search for them or even know that they exist.

Retrieval Augmented Generation (RAG) using Swirl ✨

Retrieval Augmented Generation (RAG) is a technique where information retrieval is combined with text generation. In simpler terms, RAG first fetches relevant data by searching and then crafts an answer based on that data using Large Language Models; a widely popular example is Bing AI Chat. You can create a dynamic knowledge base by implementing RAG on your data sets.

Swirl helps you create a chatbot for your data with ease. You can integrate the power of ChatGPT enterprise with Swirl and then generate answers on the fly. You don't need any extra database to store any information. Just search.

Swirl can retrieve accurate information and obtain answers complete with citations to the original documents. This will supercharge your productivity. And you will have reliable and referenced information at your fingertips.

RAG using Swirl

An example is when we search for Sid Probstein using ChatGPT and then search again using Swirl's RAG pipeline. We get the document used for generating the answer in the link at the bottom left.

Get Started with Swirl πŸ’»

If you want to try Swirl and get it up and running at no cost. Head to the GitHub page and check it out. πŸ‘‡

GitHub πŸ”—: Swirl on GitHub 🌌

πŸ’ΏInstalling instructions: Getting started with Swirl

πŸ“ƒ Documentation: Swirl Wiki

A snapshot of Swirl UI when running

Galaxy UI

Swirl in Action with the Galaxy UI


Swirl is a community-driven πŸ‘©β€πŸ’» open-source project. We welcome individuals interested in creating a search platform and contributing to the project's development. If you are interested in learning about the project and want to contribute or begin your open-source journey with us. We'd gladly guide you and help you understand and create your first open-source contribution. πŸ€—

Join our Slack Community. πŸ’–

Please give us a Star 🌟 on GitHub.

Follow us on Twitter/𝕏 for updates.

Top comments (6)

Collapse
 
srbhr profile image
Saurabh Rai

For all those who are willing to start their open source journey. Swirl can be a good start:

  • Built in Python and Django
  • Awesome people helping to get started
  • Growing community, so a lot of chances for learning

Image description

Collapse
 
nevodavid profile image
Nevo David

Swirl is really cool!

Collapse
 
srbhr profile image
Saurabh Rai

Thanks Nevo, we really need some more open source projects democratizing access to cool technologies. Like Novu, Swirl, Resume Matcher and more 🌟

Collapse
 
himikap profile image
Himika Prabhat

Swirl to the moon!

Collapse
 
sidswirl profile image
Sid Probstein

Thanks @srbhr !!

Collapse
 
srbhr profile image
Saurabh Rai • Edited

You're welcome! Thanks for working on this and making it open source!