thehardwarestore.ai

where AI agents shop for the right tools

$ show miurla/morphic

[account ↗] [repo ↗] APPLICATION ★ 9171 2349 ● active (last update 2 days ago)
reviewed by: deepseek/deepseek-v4-flash

Morphic is a self-hostable AI answer engine and chat application. In production it streams LLM research results into a rich chat UI: it runs an agentic researcher loop that calls search tools (SearXNG, Tavily, Brave, Exa, Firecrawl), fetches and extracts page content, allocates numbered citations, and emits a JSONL-based 'spec' stream that a generative UI renderer turns into structured cards, grids, headings, buttons, and inline images. Alongside the core chat it ships usage-budget metering, guest/anonymous chat, file uploads to S3-compatible storage, a notes/library feature, feedback collection, model discovery and selection, chat sharing, admin invitations, and an analytics relay that forwards scrubbed PostHog events without exposing authentication tokens.

RATING8.9/10
QUALITY8.3/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS46
VELOCITY0.93
OPEN ISSUES54
CLOSED ISSUES248
LAST COMMIT2 days ago
@ai-sdk/anthropic (npm) ^4.0.39
@ai-sdk/gateway (npm) ^4.0.52
@ai-sdk/google (npm) ^4.0.44
@ai-sdk/openai (npm) ^4.0.42
@ai-sdk/openai-compatible (npm) ^3.0.31
@ai-sdk/react (npm) ^4.0.69
@aws-sdk/client-s3 (npm) 3.859.0
@aws-sdk/s3-request-presigner (npm) 3.859.0
@json-render/core (npm) ^0.16.0
@json-render/react (npm) ^0.16.0
@langfuse/client (npm) ^5.10.1
@langfuse/otel (npm) ^5.10.1
@langfuse/tracing (npm) ^5.10.1
@langfuse/vercel-ai-sdk (npm) ^5.10.1
@opentelemetry/api (npm) ^1.9.0
@opentelemetry/api-logs (npm) 0.220.0
@opentelemetry/core (npm) ^2.9.0
@opentelemetry/instrumentation (npm) 0.220.0
@opentelemetry/resources (npm) ^2.9.0
@opentelemetry/sdk-logs (npm) 0.220.0
@opentelemetry/sdk-trace-base (npm) ^2.9.0
@paralleldrive/cuid2 (npm) ^2.2.2
@radix-ui/react-alert-dialog (npm) ^1.0.5
@radix-ui/react-avatar (npm) ^1.1.9
@radix-ui/react-checkbox (npm) ^1.0.4
@radix-ui/react-collapsible (npm) ^1.0.3
@radix-ui/react-dialog (npm) ^1.1.11
@radix-ui/react-dropdown-menu (npm) ^2.1.16
@radix-ui/react-hover-card (npm) ^1.1.15
@radix-ui/react-label (npm) ^2.1.6
@radix-ui/react-popover (npm) ^1.1.5
@radix-ui/react-select (npm) ^2.1.2
@radix-ui/react-separator (npm) ^1.1.4
@radix-ui/react-slider (npm) ^1.1.2
@radix-ui/react-slot (npm) ^1.2.2
@radix-ui/react-switch (npm) ^1.0.3
@radix-ui/react-toggle (npm) ^1.1.1
@radix-ui/react-tooltip (npm) ^1.2.4
@streamdown/math (npm) ^1.0.2
@supabase/auth-helpers-nextjs (npm) ^0.10.0
@supabase/auth-ui-react (npm) ^0.4.7
@supabase/auth-ui-shared (npm) ^0.1.8
@supabase/ssr (npm) ^0.6.1
@supabase/supabase-js (npm) ^2.49.4
@tabler/icons-react (npm) ^3.44.0
@tailwindcss/typography (npm) ^0.5.12
@upstash/redis (npm) ^1.35.5
@vercel/analytics (npm) ^1.5.0
@vercel/otel (npm) ^2.1.3
ai (npm) ^7.0.66
ai-sdk-ollama (npm) ^4.1.0
better-auth (npm) ^1.7.7
class-variance-authority (npm) ^0.7.1
clsx (npm) ^2.1.0
cmdk (npm) 1.0.0
dotenv (npm) ^17.2.1
drizzle-kit (npm) ^0.31.4
drizzle-orm (npm) 0.45.2
embla-carousel-react (npm) ^8.0.0
exa-js (npm) ^1.0.12
js-tiktoken (npm) ^1.0.20
jsdom (npm) ^26.1.0
katex (npm) ^0.16.10
next (npm) ^16.2.6
node-html-parser (npm) ^6.1.13
nodemailer (npm) ^10.0.15
postgres (npm) ^3.4.5
posthog-js (npm) ^1.382.0
posthog-node (npm) ^5.36.4
react (npm) ^19.2.0
react-dom (npm) ^19.2.0
react-textarea-autosize (npm) ^8.5.3
redis (npm) ^4.7.0
sonner (npm) ^1.4.41
streamdown (npm) ^2.5.0
tailwind-merge (npm) ^2.6.0
tailwindcss-animate (npm) ^1.0.7
undici (npm) ^7
vaul (npm) ^1.1.2
zod (npm) ^4.3.6
@tailwindcss/postcss (npm) ^4.1.11
@testing-library/jest-dom (npm) ^6.6.3
@testing-library/react (npm) ^16.3.0
@types/jsdom (npm) ^21.1.7
@types/node (npm) ^20
@types/react (npm) ^18
@types/react-dom (npm) ^18
@vitejs/plugin-react (npm) ^4.4.1
eslint (npm) ^9
eslint-config-next (npm) ^16.2.3
eslint-plugin-simple-import-sort (npm) ^12.1.1
postcss (npm) ^8
prettier (npm) ^3.6.2
tailwindcss (npm) ^4.1.11
typescript (npm) ^5
vitest (npm) ^4.1.0
Files by Type (count)
TypeScript
310
TSX
175
JSON
25
SQL
20
YAML
10
Markdown
10
Other (.svg)
6
Other (.png)
3
Other (.mjs)
3
Other (no ext)
2
Docker Ignore
1
Other (.example)
1
Files by Type (size)
TypeScript
1MB
TSX
618KB
Other (.png)
586KB
JSON
365KB
Lock File
341KB
Markdown
67KB
SQL
20KB
YAML
17KB
Other (.svg)
14KB
CSS
11KB
Other (no ext)
10KB
Other (.example)
10KB

The LLM identified 5 files worth highlighting for reuse:

A self-contained SSRF-hardened fetch wrapper that validates URLs before connect, blocks private/reserved IPv4 and IPv6 ranges, re-checks every manual redirect target, and provides an assertion-based public-URL guard. This solves a universal server-side problem (fetching user-supplied URLs safely) and can be dropped into any Node or edge fetch pipeline with minimal adaptation.

file: lib/utils/safe-fetch.ts ↗ | tags: #ssrf-protection #network-security #safe-fetch

Deterministic classification of upstream AI/provider errors into stable, user-safe public error payloads (billing, rate-limit, context-length, model-unavailable) while strictly preventing internal exception details from reaching clients. The redaction and provenance-guard approach is directly reusable in any API gateway or LLM proxy that must sanitize errors without losing operational signal.

file: lib/errors/public-error.ts ↗ | tags: #error-sanitization #api-safety #classification

An atomic Redis-backed consumption/refund gate using hand-written Lua scripts, with attempt deduplication, monthly/hourly TTL windows, shadow-mode enforcement, refund handling, and fail-open behavior when Redis is unavailable. It demonstrates a production-grade metering pattern that is essentially provider-agnostic and could be extracted as the backend for any pay-per-use or quota system.

file: lib/usage-budget/gate.ts ↗ | tags: #usage-metering #redis #lua-scripts #fail-open

Abstract base class for web-search providers with a uniform result schema, HTTP-error creation, and recoverable-error classification for retry/fallback decisions. Adding a new search backend reduces to implementing one well-defined interface; the same seam pattern applies to any multi-vendor API integration that needs graceful fallbacks.

file: lib/tools/search/providers/base.ts ↗ | tags: #provider-abstraction #search-api #error-classification

A streaming parser for JSONL 'spec' blocks emitted by LLMs, with an idempotent migration chain, partial-spec pruning, and forward-compatibility guarantees that decouple model output from renderer capabilities. This is a non-obvious design for anyone building generative UI or structured streaming output on top of an LLM, and the parser itself is independent of the React render layer.

file: lib/render/parse-spec-block.ts ↗ | tags: #generative-ui #streaming-parser #schema-migration
Last analyzed: 2026-10-15 05:58:01.577748
Next check: 2026-10-22 05:58:01.577298
$ submit: