# Morphic

CreateWithAI Hub page: https://createwithaihub.com/templates/morphic
Latest version of this file: https://createwithaihub.com/templates/morphic.md

- Type: Template · Category: Templates & Starter Kits
- Publisher: miurla
- Pricing: Free · License: Apache-2.0
- Runs on: Web, Docker / self-hosted

Open-source AI answer engine with cited answers and generative UI, built on Next.js and the AI SDK and self-hostable with Docker.

Morphic is an Apache-2.0 AI-powered search engine that returns grounded, cited answers and renders rich inline components from a streamed generative UI spec. It is a Next.js and Vercel AI SDK app with a model selector for OpenAI, Anthropic, Google, Ollama, Vercel AI Gateway and OpenAI-compatible providers, and search via Tavily, SearXNG, Brave or Exa. Chat history is stored in PostgreSQL, and the Docker Compose setup starts PostgreSQL, Redis, SearXNG and the app together.

Useful for: Running your own Perplexity-style search assistant, or starting a cited-answers product from a working codebase.

## Key features

- Grounded, cited answers with Quick and Adaptive search modes
- Generative UI components streamed into answers
- Model selector for OpenAI, Anthropic, Google, Ollama, AI Gateway and OpenAI-compatible APIs
- Search providers: Tavily, SearXNG, Brave, Exa
- PostgreSQL chat history, shareable result URLs, file upload, guest mode
- Docker Compose stack and Deploy-to-Vercel button

## Connection

- Stack: Next.js, React, TypeScript
- Builds: Chatbot, Full app
- Deploys to: Vercel, Anywhere / self-host

## Before you start

- Docker (recommended) or Bun
- AI provider API key

## Install steps from the official documentation

Clone repository:

```
git clone https://github.com/miurla/morphic.git
```

Create env file:

```
cd morphic && cp .env.local.example .env.local
```

Start with Docker Compose:

```
docker compose up -d
```

## Limitations

- Needs at least one AI provider API key
- Local development without Docker also needs a search API key (e.g. Tavily) and Bun

## Official links

- Source repository: https://github.com/miurla/morphic
- Documentation: https://github.com/miurla/morphic#readme
- Source: https://github.com/miurla/morphic (README: features, providers, Docker and local setup, Vercel deploy button; Apache-2.0 LICENSE; package.json shows next, react, ai, typescript)
