Skip to content

Repository files navigation

Convos.AI

Convos.AI is a single-player AI conversation lab for pressure-testing ideas. Choose a prompt and a side, speak or type through timed rounds, and receive a direct counterargument. OpenRouter supplies the reasoning model while Moss stores, indexes, and retrieves the topic knowledge and live conversation context.

What is included

  • Original Convos.AI lobby, live conversation arena, knowledge stream, and results screen
  • User-provided Moss Project ID and project key in Settings
  • OpenRouter default mode or a user-provided API key and model
  • On-demand generation of 24 balanced knowledge cards for the selected topic
  • Automatic creation or updating of the user's debate-evidence Moss index
  • Moss persistent-index retrieval and live-session retrieval after every turn
  • Three, five, or seven timed rounds per side
  • Browser Web Speech input with interim transcription and visible microphone errors
  • Optional ElevenLabs eleven_flash_v2_5 speech output with a local character guard
  • Demo opponent, evidence, and verdict fallbacks when no provider is connected

Requirements

  • Node.js 22.13 or newer
  • pnpm 11
  • A Moss Project ID and project key for the connected experience
  • An OpenRouter API key for user-selected models
  • Optionally, an ElevenLabs API key for AI voice output

Run locally

pnpm install
pnpm dev

Open http://localhost:3000, then open Settings to connect Moss and OpenRouter. Credentials are stored only in the browser tab's sessionStorage, sent to server actions for the active operation, and never written to disk by the app.

Optional server defaults

Copy .env.example to .env.local if the app owner wants to provide fallback credentials:

cp .env.example .env.local

Environment credentials remain server-only. User-provided credentials take priority for their active browser session.

How the Moss-powered flow works

When a connected user starts a conversation, the server:

  1. Uses the selected OpenRouter model to generate 24 concise knowledge cards: eight pro, eight con, and eight neutral.
  2. Creates the configured Moss index or upserts the generated topic cards into an existing index.
  3. Loads that index locally through the Moss SDK.
  4. Extracts checkable claims from each completed turn.
  5. Adds the current transcript to a Moss live session.
  6. Queries the topic-filtered persistent index and live session in parallel.
  7. Drops results below EVIDENCE_RELEVANCE_THRESHOLD = 0.5 and displays the strongest matches.
  8. Pushes the completed live session to Moss after judging and releases its native resources.

The knowledge cards are intentionally labeled as OpenRouter-generated surface-level knowledge, not independently verified citations.

Optional fixed corpus

The project still includes a run-once 162-document seed script for app-owner deployments:

pnpm seed:evidence

This creates the configured MOSS_INDEX_NAME with moss-minilm and { topic, stance } metadata.

Voice behavior

Voice mode is enabled when SpeechRecognition or webkitSpeechRecognition is available. The microphone is disabled while ElevenLabs audio is playing. Generated speech usage is tracked locally, warns at 8,000 characters, and stops at 10,000 characters.

Build and test

pnpm lint
pnpm test
pnpm build

The production build targets the Next.js Node runtime. The current @moss-dev/moss SDK uses native bindings, so this app requires a Node deployment rather than an edge-only or Cloudflare Worker host.

About

Debate practice app on Next.js and pnpm. Generates 24 balanced knowledge cards per topic, writes them to a Moss debate-evidence index, and retrieves from both the persistent index and the live session after every turn. OpenRouter for reasoning, Web Speech for input, ElevenLabs flash v2.5 for output.

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages