An AI-powered search engine with a generative UI.
Please note that there are differences between this repository and the official website morphic.sh. The official website is a fork of this repository with additional features such as authentication, which are necessary for providing the service online. The core source code of Morphic resides in this repository, and it's designed to be easily built and deployed. When using Morphic, please keep in mind the different roles of the repository and the website.
- 🧱 Stack
- 🚀 Quickstart
- 🌐 Deploy
- ✅ Verified models
- Enable specifying the model to use (only writer agent)
- Implement search history functionality
- Develop features for sharing results
- Implement functionality to get answers from specified URL
- Add video support for search functionality
- Implement RAG support
- Introduce tool support for enhanced productivity
- Expand Generative UI capabilities
- App framework: Next.js
- Text streaming / Generative UI: Vercel AI SDK
- Generative Model: OpenAI
- Search API: Tavily AI / Exa AI
- Serverless Database: Upstash
- Component library: shadcn/ui
- Headless component primitives: Radix UI
- Styling: Tailwind CSS
Fork the repo to your Github account, then run the following command to clone the repo:
git clone git@github.com:[YOUR_GITHUB_ACCOUNT]/morphic.git
cd morphic
bun install
Follow the guide below to set up Upstash Redis. Create a database and obtain UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
. Refer to the Upstash guide for instructions on how to proceed.
cp .env.local.example .env.local
Your .env.local file should look like this:
# OpenAI API key retrieved here: https://platform.openai.com/api-keys
OPENAI_API_KEY=
# Tavily API Key retrieved here: https://app.tavily.com/home
TAVILY_API_KEY=
# Upstash Redis URL and Token retrieved here: https://console.upstash.com/redis
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
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.
bun dev
You can now visit http://localhost:3000.
Host your own live version of Morphic with Vercel or Cloudflare Pages.
- Fork the repo to your GitHub.
- Create a Cloudflare Pages project.
- Select
Morphic
repo andNext.js
preset. - Set
OPENAI_API_KEY
andTAVILY_API_KEY
env vars. - Save and deploy.
- Cancel deployment, go to
Settings
->Functions
->Compatibility flags
, addnodejs_compat
to preview and production. - Redeploy.
The build error needs to be fixed: issue
List of verified models that can be specified to writers.
- Groq
- LLaMA3 8b
- LLaMA3 70b