Search with Ask AI The opinionated search + Ask AI experience built. Built like DocSearch but with Algolia InstantSearch and Ask AI.
Combine precise retrieval with conversational AI search. Search + AskAI keeps traditional hits in view while letting users ask follow-up questions powered by Algolia’s Ask AI .
AI-powered chat for complex queries
Conversational search
Keyboard-friendly, accessible navigation
Hybrid search with traditional hits and AI-powered follow-ups
npx shadcn@latest add @algolia / search - ai This will add the Search with AskAI experience to your project under components/search-ai. Use it like this:
import SearchWithAskAi from "@/components/search-ai" ;
< SearchWithAskAi
applicationId = "betaHAXPMHIMMC"
apiKey = "8b00405cba281a7d800ccec393e9af24"
indexName = "algolia_podcast_sample_dataset"
assistantId = "Y89iGlsnihaU"
attributes = {{
primaryText: "title" ,
secondaryText: "description" ,
image: "imageUrl" ,
}}
/> Prerequisites for using the SearchWithAskAi component:
applicationId: The Algolia application ID
apiKey: The Algolia API key
indexName: The Algolia index name
assistantId: The Ask AI assistant ID
hooksuse-keyboard-navigation.tsx
< link rel = "stylesheet" href = "https://unpkg.com/@algolia/sitesearch@latest/dist/search-askai.min.css" />
< div id = "search-container" ></ div >
< script src = "https://unpkg.com/@algolia/sitesearch@latest/dist/search-askai.min.js" ></ script >
< script >
SiteSearchAskAI. init ({
container: '#search-container' ,
appId: 'YOUR_APP_ID' ,
apiKey: 'YOUR_API_KEY' ,
indexName: 'YOUR_INDEX_NAME' ,
assistantId: 'YOUR_ASSISTANT_ID' ,
attributes: {
primaryText: 'title' ,
},
});
</ script >
Open CodeSandbox .
Update the experience in packages/standalone to fit your needs (requires React skills)
Build the bundle bun run bundle
Download the bundle from packages/standalone/dist
Use it in your project
<!-- styles -->
< link rel = "stylesheet" href = "./path/to/your/search-askai.min.css" />
<!-- scripts -->
< script src = "./path/to/your/search-askai.min.js" ></ script >
<!-- container -->
< div id = "search-container" ></ div >
<!-- initialization -->
< script >
SiteSearchAskAI. init ({
container: '#search-container' ,
appId: 'YOUR_APP_ID' ,
apiKey: 'YOUR_API_KEY' ,
indexName: 'YOUR_INDEX_NAME' ,
assistantId: 'YOUR_ASSISTANT_ID' ,
attributes: {
primaryText: 'title' ,
},
});
</ script >
Change the styling to match your brand
Open in v0 for more customization