Skip to content

feat: add full-stack visual RAG playground - #12

Merged
ChinaYiqun merged 23 commits into
masterfrom
agent/rag-playground-ui
Jul 29, 2026
Merged

ChinaYiqun merged 23 commits into
masterfrom
agent/rag-playground-ui

Conversation

@ChinaYiqun

Copy link
Copy Markdown
Owner

What changed

  • adds a React 19 + TypeScript three-panel playground for knowledge-base documents, grounded chat, and retrieval evidence;
  • adds a framework-free NanoHTTPD API with health, upload, text ingestion, document listing/deletion, and chat endpoints;
  • returns answer and Top-K evidence together, including source document, chunk ID, similarity score, and original passage;
  • adds a deterministic in-memory retrieval engine and offline tests, requiring no API key or database;
  • supports optional Ollama generation while keeping the evidence contract unchanged;
  • adds Docker Compose startup for the Java backend, Nginx-served React frontend, and optional Ollama profile;
  • adds frontend and Compose validation to CI;
  • adds bilingual README positioning and a complete playground/API guide.

Why

The repository previously had useful backend components but no coherent user-facing application. The old chat controller accepted form data, had no managed knowledge-base state, and returned generated text without retrieval evidence. Visitors could not upload a document, ask grounded questions, or inspect why an answer was produced.

This PR creates the product surface needed for demos, tutorials, social sharing, and practical secondary development:

Knowledge base | Grounded chat | Retrieval evidence

Default experience

docker compose up --build

Then open http://localhost:3000.

The default mode uses local hashing embeddings and an explicitly labeled extractive generator, so it runs without credentials or a model download. For real local generation:

RAG_PLAYGROUND_MODE=ollama docker compose --profile ollama up --build

API

  • GET /api/health
  • GET /api/documents
  • POST /api/documents
  • POST /api/documents/text
  • DELETE /api/documents/{id}
  • POST /api/chat

Validation

GitHub Actions runs:

bash scripts/check-no-hardcoded-secrets.sh
mvn --batch-mode --no-transfer-progress test
bash scripts/run-no-api-demo.sh
cd frontend && npm install --no-audit --no-fund && npm run build
docker compose config --quiet

Current boundaries

  • document state and vectors are in memory and reset with the backend;
  • the default local embedding/generator path is for deterministic demos, not production semantic quality;
  • authentication, quotas, async ingestion, persistent vector storage, and multi-tenant isolation remain future work.

@ChinaYiqun
ChinaYiqun marked this pull request as ready for review July 29, 2026 09:34
@ChinaYiqun
ChinaYiqun merged commit dd6f636 into master Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant