convez.ai
PluginDesenvolvimento WebIntermediário
mihairusu88

Document Assistant

mihairusu88/document-assistant

Chat RAG por conversa com visualização interativa da pipeline

Ver no GitHub
InicialPluginScore · de 0 a 100

Aplicação RAG estilo ChatGPT que permite fazer upload de documentos e fazer perguntas respondidas pelo próprio documento. Combina Next.js 16, Claude, Qdrant e embeddings Voyage em uma pipeline visual que mostra cada etapa do processamento (extração → chunking → embedding → armazenamento → recuperação → geração).

Instalação

$npx convez-ai mihairusu88/document-assistant

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
28%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Análise de documentos técnicos e PDFs em conversa privada
  • Assistente de pesquisa com isolamento de contexto por thread
  • Prototipagem de aplicações RAG com pipeline visual
  • Comparação em tempo real de respostas com/sem retrieval

Veredito

Projeto bem estruturado em Next.js 16 com TypeScript e RAG production-ready. Stack moderno (Voyage + Qdrant + Claude) e arquitetura limpa por serviços, mas requer setup inicial de múltiplas dependências externas (Supabase, Qdrant, Anthropic).

README

A tradução para o português deste README ainda está na fila.

Document Assistant

A ChatGPT-style RAG chat app: upload a document into a conversation, then ask questions answered from that document. Retrieval is scoped per conversation, so each thread only draws on the files you added to it. A live pipeline drawer visualises every RAG step (extract → chunk → embed → store → retrieve → generate), and a toggle lets you compare answers with retrieval on vs. off.

Stack

Next.js 16 (App Router, Turbopack) · React 19 · TypeScript · Tailwind v4 · hand-authored shadcn/ui · Zod · AI SDK v6 Supabase (Google OAuth + Postgres, accessed via @supabase/supabase-js + RLS) · Voyage AI embeddings (voyage-3-large) · Qdrant vector store · Anthropic Claude (claude-sonnet-4-6) for generation.

How it works

Ingest  (POST /api/documents, NDJSON stream)      Answer (POST /api/chat, UI message stream)
  1. Extract text   ExtractTextService              5. Retrieve   RetrievalService (Qdrant search)
  2. Chunk          ChunkingService                 6. Generate   ChatService (Claude, streamed)
  3. Embed          EmbeddingsService (Voyage)
  4. Store          StoreChunksService (Qdrant)

Chunks are stored in Qdrant tagged with their conversationId; retrieval filters on it so answers are grounded only in the current conversation's documents. Conversations and messages are persisted to Supabase Postgres (RLS-scoped to the signed-in user).

Project structure

src/
  app/
    (auth)/                  # sign-in / sign-up / password reset
    (app)/                   # authed shell: /chat and /chat/[conversationId]
    api/                     # chat, conversations, conversations/[id], documents
    auth/callback            # OAuth code exchange
  components/
    layout/                  # appSidebar, userMenu (app chrome)
    ui/                      # hand-authored shadcn primitives (camelCase filenames)
  services/                  # business + RAG pipeline (one service per step) + supabase persistence
  views/                     # route-aligned feature modules
    chat/                    #   chatWindow, conversationSidebar, the RAG drawer + zustand store
    conversations/hooks/     #   useDocumentUpload (ingest stream reader)
    users/                   #   auth server actions + forms
  lib/supabase/              # browser / server clients
  types/                     # api envelope + UI DTOs
  utils/                     # cn, files, apiClient
  proxy.ts                   # Next 16 middleware: session refresh + route guard
supabase/schema.sql          # run by hand in the Supabase SQL Editor

The feature folder is views/, not pages/ — pages is a reserved Next.js directory (the legacy Pages Router). Conventions: camelCase filenames, feature folders named to match routes.

Getting started

npm install
cp .env.example .env.local   # fill in Supabase, Qdrant, Voyage, and Anthropic values
npm run dev                  # or: npm run dev:proxy  (if you're behind a TLS-intercepting proxy)

Then, once per project:

  1. Database — open the Supabase Dashboard → SQL Editor and run supabase/schema.sql (creates conversations + messages with RLS).
  2. Auth — enable the Google provider in Supabase (Authentication → Providers), set the OAuth client's redirect URI to https://<project-ref>.supabase.co/auth/v1/callback, and set the Site URL to http://localhost:3000.

The UI compiles and renders with placeholder env values; sign-in, retrieval and generation activate once real credentials are present.

Environment

See .env.example. Public: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, NEXT_PUBLIC_SITE_URL. Server-only secrets (never NEXT_PUBLIC_): QDRANT_URL, QDRANT_API_KEY, VOYAGE_API_KEY, ANTHROPIC_API_KEY.

Scripts

dev · dev:proxy · build · start · lint · typecheck

There is no test suite — npm run typecheck and npm run lint are the correctness gates.

Screenshots

Dark theme

Dark theme — sign-in page

Dark theme — empty state with the pipeline drawer

Dark theme — conversation with the RAG pipeline drawer showing every step completed

Light theme

Light theme — sign-in page

Light theme — empty state with the pipeline drawer

Light theme — conversation grounded in the uploaded document, pipeline steps complete

Ver o original no GitHub

Bom para

Relacionados