A modern semantic search interface built with Next.js 15, React, and Moss SDK.
This demo showcases how to use Server Actions to securely interact with Moss from a web application.
- Sub-10ms Retrieval: Experience Moss's industry-leading speed in a browser.
- Server Actions: Secure implementation that keeps your API keys on the server.
- Glassmorphism UI: A sleek, responsive dark-mode interface.
- Real-time Stats: View retrieval time and match confidence scores.
-
Install Dependencies:
npm install
-
Configure Environment: Copy the example and fill in your credentials from the Moss Portal:
cp .env.example .env.local
Required variables:
MOSS_PROJECT_IDMOSS_PROJECT_KEYMOSS_INDEX_NAME
-
Run Development Server:
npm run dev
Open http://localhost:3000 in your browser.
app/page.tsx: The main UI component (Client Side).app/actions.ts: Moss logic and Server Actions (Server Side).app/globals.css: Premium styling and glassmorphism definitions.
To add Moss to your own Next.js app:
- Install the SDK:
npm install @moss-dev/moss-web - Create a Server Action (see
app/actions.ts). - Call the action from your React components.