An open API service indexing awesome lists of open source software.

https://github.com/ajay-dhangar/answer-engine-generative-ai

An AI-powered search engine with a generative UI.
https://github.com/ajay-dhangar/answer-engine-generative-ai

ai generative-ai generative-model generative-ui openai tavily

Last synced: 3 months ago
JSON representation

An AI-powered search engine with a generative UI.

Awesome Lists containing this project

README

          

# Morphic

An AI-powered search engine with a generative UI.

![capture](https://github.com/Ajay-Dhangar/answer-engine-generative-ai/assets/99037494/5416d57c-6d1b-4155-8cb1-245f3ee93602)

## 🔍 Overview

- 🧱 [Stack](#-stack)
- 🚀 [Quickstart](#-quickstart)
- 🌐 [Deploy](#-deploy)
- ✅ [Verified models](#-verified-models)

### 🚗 Roadmap [WIP]

- [x] Enable specifying the model to use (only writer agent)
- [ ] Implement chat history functionality
- [ ] Develop features for sharing results
- [ ] Add video support for search functionality
- [ ] Implement Retrieval-Augmented Generation (RAG) support
- [ ] Introduce tool support for enhanced productivity
- [ ] Expand Generative UI capabilities

## 🧱 Stack

- App framework: [Next.js](https://nextjs.org/)
- Text streaming / Generative UI: [Vercel AI SDK](https://sdk.vercel.ai/docs)
- Generative Model: [OpenAI](https://openai.com/)
- Search API: [Tavily AI](https://tavily.com/)
- Component library: [shadcn/ui](https://ui.shadcn.com/)
- Headless component primitives: [Radix UI](https://www.radix-ui.com/)
- Styling: [Tailwind CSS](https://tailwindcss.com/)

## 🚀 Quickstart

### 1. Fork and Clone repo

Fork the repo to your Github account, then run the following command to clone the repo:

```
git clone git@github.com:[YOUR_GITHUB_ACCOUNT]/answer-engine-generative-ai.git
```

### 2. Install dependencies

```
cd answer-engine-generative-ai
bun i
```

### 3. Fill out secrets

```
cp .env.local.example .env.local
```

Your .env.local file should look like this:

```
# Used to set the base URL path for OpenAI API requests.
# If you need to set a BASE URL, uncomment and set the following:
# OPENAI_API_BASE=

# Used to set the model for OpenAI API requests.
# If not set, the default is gpt-4-turbo.
# OPENAI_API_MODEL='gpt-4-turbo'

# OpenAI API key retrieved here: https://platform.openai.com/api-keys
OPENAI_API_KEY=[YOUR_OPENAI_API_KEY]

# Tavily API Key retrieved here: https://app.tavily.com/home
TAVILY_API_KEY=[YOUR_TAVILY_API_KEY]

# Only writers can set a specific model. It must be compatible with the OpenAI API.
# USE_SPECIFIC_API_FOR_WRITER=true
# SPECIFIC_API_BASE=
# SPECIFIC_API_KEY=
# SPECIFIC_API_MODEL=
```

_Note: This project focuses on Generative UI and requires complex output from LLMs. Currently, it's assumed that the official OpenAI models will be used. Although it's possible to set up other models, if you use an OpenAI-compatible model, but we don't guarantee that it'll work._

### 4. Run app locally

```
bun dev
```

You can now visit http://localhost:3000.

## 🌐 Deploy

Host your own live version of Morphic with Vercel or Cloudflare Pages.

### Vercel

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fajay-dhangar%2Fanswer-engine-generative-aic&env=OPENAI_API_KEY,TAVILY_API_KEY)

### Cloudflare Pages

1. Fork the repo to your GitHub.
2. Create a Cloudflare Pages project.
3. Select `Morphic` repo and `Next.js` preset.
4. Set `OPENAI_API_KEY` and `TAVILY_API_KEY` env vars.
5. Save and deploy.
6. Cancel deployment, go to `Settings` -> `Functions` -> `Compatibility flags`, add `nodejs_compat` to preview and production.
7. Redeploy.

## ✅ Verified models

List of verified models that can be specified to writers.

- [Groq](https://console.groq.com/docs/models)
- LLaMA3 8b
- LLaMA3 70b