Perplexity AI is an AI-powered search engine that has gained traction for its ability to deliver answers to search queries by combining search engines and AI models.
Unlike traditional search engines like bing, google, yahoo. Perplexity uses large language models to interpret and respond to queries, providing results that are not just keyword-based but contextually relevant.
Building Perplexity
There are three important factors that we can interpret form the above paragraphs.
- Understanding user queries as theyβre natural language like, owning to LLMs and some prompt engineering.
- The searching capability to search and fetch answers from different sources.
- Bringing all the results together and generating an AI answer from it while citing the sources.
- (Optional) Re-ranking the results so results are more relevant to what user has asked for.
So, in order to have a working perplexity for your own data and data sources, weβll have to have a solution that connectors to datasources, apps and databases to fetch data. Needs to have a search infrastructure in place and then an integration with an AI model for summaries, re-ranking etc.
For this part weβll be using SWIRL for the integration with apps and AI models. And for the search part, weβll be using the default Google PSE which comes built in with SWIRLβs docker container. You can add more apps to search from, but thatβs a tutorial for some other time. π
Setting up SWIRL
To try SWIRL in Docker using the GitHub guide, follow these steps:
Thereβs also a short youtube tutorial that I made which you can watch.
Prerequisites
- Ensure that you have Docker installed and running on your system (MacOS, Linux, or Windows).
- Windows users may need to install and configure either WSL 2 or Hyper-V.
Steps to Set Up SWIRL in Docker π
-
Download the Docker YAML File:
- Open a terminal and run:
curl https://raw.githubusercontent.com/swirlai/swirl-search/main/docker-compose.yaml -o docker-compose.yaml
-
Start SWIRL with Docker:
- For MacOS or Linux, run:
docker-compose pull && docker-compose up
-
For Windows, run from PowerShell:
docker compose up
-
Enable Real-Time RAG (Retrieval-Augmented Generation):
- Set environment variables:
export MSAL_CB_PORT=8000 export MSAL_HOST=localhost export OPENAI_API_KEY='your-OpenAI-API-key'
- Restart Docker to activate RAG features.
-
Access SWIRL:
- Open your browser and go to
http://localhost:8000
. - Log in using the admin credentials (
admin
as username andpassword
as the default password). - Enter a search query and click 'Search' to see results.
- Open your browser and go to
If you need more help refer to the full guide here.
Start Searching and Generate AI Summaries π
Once we have SWIRL up and running we can get started with searching for different queries and generating AI summaries on top of it. The best part is that SWIRL provides re-ranking of search results.
Searching for βBest open source search enginesβ
Searching for βAttention is all you needβ
AI Summary of βAttention is all you needβ
So, far it works pretty well with Google PSE, but you can also search specific websites as well. As seen in the left pane. Also, adding a connector is pretty easy and just a PR away.
Adding more apps and personalizing your Search Experience
Using Google search results for search and RAG is a great start, but the real advantage comes when SWIRL is connected to various apps. This enables more comprehensive searches and AI-generated summaries directly from your workplace data, making information discovery faster and more effective.
To get started, simply visit the admin panel and enter the bearer token for the apps you want to connect. Thereβs a detailed video guide available that walks you through integrating with OpenSearch, along with documentation on supported connectors. This makes it easy to configure SWIRL and maximize its search capabilities across your connected data sources.
Join our SWIRL Community
SWIRL is open-source and licensed under Apache 2.0. Weβd love for you to check it out on GitHub and give it a Starβitβs a great way to support us and keep us motivated to roll out new features!
If youβre interested in adding a new website or app as a searchable connector, we welcome your contributions.
Top comments (18)
Nice article. Can I search any documentation website with it?
Yes, you can search websites with it following the
site:
format.Alright
Also, there are some websites which you can search via connectors like Arxiv, Blockchain.com etc.
Great read π₯ You're heavy coder for sure.
Ha ha, thanks for the nice words. ^^
Informative one!
Thanks π€©
Nice article!
Thanks Nate
nice!π
π Thanks
This is a nice search tool
Thanks, I'm glad that you liked it!
Another AI tool? What's left add AI to toothbrush?
We're all building AI tools. : )
Answering your AI to toothbrush: oralb.co.uk/en-gb/product-collecti...
π