Show HN: I built an open source AI video search engine to learn more about AI (avse.vercel.app)
With the rise of short form content with TikTok and Youtube. A lot more knowledge is in videos than ever before. Finding specific answers within millions of videos can be difficult for any one person to go through. So the question is if there is Google that indexes text on website making it easier to find based on the context of on your question, why is there no Google that indexes video content making it easier for users to find answers within them.
So I built this to showcase that it's very much possible with the technology and infrastructure that is readily available.
I've indexed thousands of videos from Youtube and will be adding more, some of the things coming soon: - Index TikTok videos - Using whisper to transcribe audio in videos that don't have captions - Auto scraping both Youtube and Tiktok everyday to add new content
The tech stack: - Supbase (PostgreSQL, PG_Vector, Auth) - Hasura (GraphQL layer, permissions) - Fly (Hosting of Hasura) - JigsawStack (Summary AI, Chat AI) - Vercel (NextJS hosting, Serverless functions)
The code is opensource here:https://github.com/yoeven/ai-video-search-engine
Would love some feedback and thoughts on what you would like to see?
50 comments
[ 5.5 ms ] story [ 105 ms ] threadCurious, can you share your decision making for adding Hasura on top of Supabase? I used Hasura a couple of years ago, recently started using Supabase and it seems to cover my Hasura use case in a simpler way.
I've been using Hasura generally with vanilla Postgres DBs and I've mainly used it for three real reason: Client side permission management, DB dashboard and GraphQL.
Supabase has done an amazing job trying cover all those aspects with their own solutions but I still find Hasura really found the sweet spots for those aspects a little better and more fine tuned.
Client side permission: Hasura has an amazing UI to build permissions compared to Supabase sql based row level permissions where I still need to right code and then verify it
DB dashboard: managing the db, adding/removing columns, changing types, creating triggers, index etc, works/feels a lot better to me on hasura or maybe its just something I've gotten use to
GraphQL - I love writing in GraphQL, and Supabase Graphql layer isn't production standard at this stage.
Again, a lot of this is preferences and my personal opinion. You can build amazing products with just Supabase for sure, just a lot faster for me with Hasura right now :)
EDIT: of course GPT4 blows mistral out of the water for those very specific "needle in a haystack" or "sharp deductive reasoning needed" cases. Sometimes it makes people go wow, when I present that
TheBloke / Mistral-7B-Instruct-v0.2-GGUF / mistral-7b-instruct-v0.2.Q8_0.gguf
and I'm running it in LMStudio with the config:
Also the way its built, you can chat with a 5 hour video without breaking the bank because only relavant chunks of that video will be passed as context based on the question
My test example for such a soltion would be: "does it find the chapter about thermal calculations in a video about electronics": https://youtu.be/8xX2SVcItOA?feature=shared&t=758
How do I add a video? I'd love to test your solution with this video.
Thanks for making the source available too! I've been trying to build something similar with jupyter notebooks, but I keep getting stuck at this "hidden gem" problem.
You could also add more videos by clicking on the hamburger menu on the right of the search bar and click on "Index videos". However, you'll need to do a quick email sign up and you can index as many videos as you like!
Yeah the "hidden gem" problem is a difficult one to solve and I think with the current tech out there, we are getting a step closer with better solutions. The search engine still has a lot of work to be done especially for broader queries & improving accuracy.
Would love to see how the community can build on this!
I'm blown away how good this works! I searched for the query just like you said and it really found exactly the relevant section of the video. Very impressive!
You're right, the query seems to be very sensitive to the exact phrasing. Searching for "heat sink thermal calculation" results in nine videos, (the wanted one on fifth place at least), while your query seems more targeted. "calculate heat sink power dissipation" works reasonably well too.
So again - wow. This is really great and exactly what I've been trying to build for myself too.
One really useful feature for me would be inclusion/exclusion of channels in the search results. For this example, when I'm specifically looking for calculations, I can probably skip channels like LTT from the search results.
Thanks for this amazing tool!
Is it random luck which phrases work best, or is it in a way that a frequent user of the service could learn the good and bad ways to structure a query (and/or can it be tweaked so that all queries work well)?
(Questions aimed at the world generally, not specifically at the person I'm replying to.)
While yes promoting/querying tends work better in questions based on how its built, I've been exploring more ways by mixing full text fuzzy search along with the current method to allow for broader queries as well :)
Some videos are a real treasure
this is already possible for photos/images, so getting this for video is just a matter of time, but i don't know how far along the technology is at this point and how much resources it will take.
https://www.videogist.co/
But I don't know about searchability.
https://www.adept.ai/blog/fuyu-8b
https://github.com/THUDM/CogVLM
Which does essentially this but requires no indexing of videos!
Bookmarked.
And how are you getting funds for expenses like whisper etc?
That's why I love open source tech, because whisper is open source, people have made it cheaper, faster and better. Check this out: https://replicate.com/vaibhavs10/incredibly-fast-whisper
I have some ideas I'd like to share - something to improve this project:
1: Are you only scraping the video id and text content? (the meta-data and description text is still useful to have searchable maybe - at least as an option)
2: In addition to audio - you can capture video content as well into tags (which for videos without sound, poor sound, or non-speaking would make those searchable). audio content is only part of the information I personally want to search. being able to ask for videos "about"/"with" a topic.
3: defined search keywords: searching though different stacks could be speed up by specifying which stack to search (if you take the above suggestion about video tags). as a user I would want to specify if I am looking for audio content, or video content (such as showing a mechanical process of some kind, or how a specific design of dress looks vs just talking about it).
4: dark mode.
I really like this project and hope it becomes the best possible version of itself!
1: Nope, I'm also taking the title, description and tags as part of the content as well.
2: Agreed! This is something I'm aiming to put out in the next few updates where the AI tries to understand what's going on in the video along with the transcribed audio. This would be great for video demos with no audio etc.
3: That's pretty interesting! pre-processing the search query and trying to understand the category of that search could narrow down the specific tags in that sense. Would be interesting to try something like that!
4: Yes!! hahaha this will be priority
If there are specific channels with tons of videos you like to see, share them here and I can add the channel videos directly in the backend :)
It's effectively just a very simple "indexer", if you can even really call it that because it's only chunking audio for semantic search rather than actually indexing it.
Search engines are hard because of ranking and scale. This project does not solve either of those problems.
Personally if I was going to build this I would exclusively focus on the data side and use a pre-built traditional search engine like meilisearch, typesense, elasticsearch, etc to handle the indexing and search side. Adding semantic search into the mix upfront makes your life so much harder.
Ranking is a huge topic by itself, which beyond similarity/text matching, other topics like SEO, popularity, etc plays a huge part and those are aspects that I'm looking forward to understand better and see how the community can contribute as well!
Are you sure this is what users want? Semantic search is not appropriate for all situations.
> adding a traditional form of full text fuzzy search which will help with some of the ranking problems
Full text fuzzy search is NOT a performant search engine and is NOT related to ranking or relevance. Ranking is an independent process after finding matching results.
Semantic search would make more sense in the context of ranking rather than pure search. E.g. you use traditional search to find matching documents then semantic search on matches to rank them.
> Ranking is a huge topic by itself, which beyond similarity/text matching, other topics like SEO, popularity, etc plays a huge part
Based on my mediocre understanding of ranking, basic ranking is generally not about any of these factors. Presumably because they are too slow and computationally intensive. Maybe there are multiple layers of ranking for these different features though.
My understanding is that basic ranking is/was more about metrics like TF-IDF. I’m sure there are more advanced modern techniques, but also likely more complicated.
Search is a ridiculously big and complex topic. If you want this to be more than a toy project I think it would be wise to focus on much smaller sliver and have a much clearer value prop.
You are currently trying to tackle multiple big problems simultaneously.
UX Feedback:
The vid bubbles are HUGE. https://i.imgur.com/TjHhtRr.png
It would be great to have TopicTabs... I search for "X" and it gives me one of the topic bubbles (as seen on the landing) - under my search bar. I enter a new search, the vids change, but the previous search results bubble is still there.
This is fantastic though.
--
It would be really interesting to package it in such a way where one can connect all their CCTV cams/footage to this. Then have all their video searchable:
"Show me any white vehicles that drove by in the last hour"
As seen on TV...
Also yes sometimes when you search about a topic that doesn't exist meaning not indexed it will try to find the closet next best. If you're looking for specific video categories, you could index them by clicking on the hamburger menu on the right of the search bar.
Yeah agreed! This tech has tons of use cases like the one you shared with CCTV. While code is open source, so anyone can take it and implement it for their use case :)
Are you sure about the below?...How did you test this? My experience is the opposite.
Edit: For example, Youtube will return a video result of a video with a transcript containing the same quoted text that I've searched. Wouldn't that imply that Youtube has indexed the transcript?
>>FAQ
Doesn't youtube do this?
(I've tried emailing you about this but not sure if you've seen my email.)One thing I am struggling is adding videos. I was trying to see if I can add Huberman's podcast videos on YT and then find specific parts on say light therapy rather than going through the whole set of videos or even the video on sleep. I get the OTP but nothing works.
Had the same result in relation to the OTP.
What did you mean by this "the content is built up to ensure a particular podcast running time."?
Btw, the website on your profile didn't work for me.
e.g. Q) "can you give me the complete list of questions asked by Lex in the Jeff Bezos episode"
A) gives me one paragraph and then says, "Please note that this is not a complete list of all questions asked in the episode, but only those present in the provided podcast chunks. For a complete list, you would need to listen to the full podcast episode."
If people could actually find things the whole purpose is gone. (lol)