Skip to content

feat: phase 1 — async ingestion, feedback loop, compose stack - #2

Open
rayperatta wants to merge 5 commits into
mainfrom
feat/phase-1
Open

rayperatta wants to merge 5 commits into
mainfrom
feat/phase-1

Conversation

@rayperatta

Copy link
Copy Markdown
Owner

Phase 1 — Scale & reliability

Async ingestion (arq + Redis)

  • REDIS_URL activates the queue: POST /api/upload → 202 + job_id, worker processes in background (retries max_tries=3, max_jobs=4, backpressure via Redis)
  • GET /api/jobs/{job_id} → queued | in_progress | complete | failed
  • Unset REDIS_URL → fully synchronous, same behaviour as before (feature-flag pattern, like Langfuse)

Feedback loop

  • /api/ask returns trace_id
  • POST /api/feedback (score +1/-1, optional comment) → local JSONL tuning dataset + Langfuse score mirroring
  • GET /api/feedback/summary → totals + thumbs-down rate

One-command stack

  • docker compose up → API + arq worker + Redis

Verification

  • ruff check clean (0.7.0, same as CI)
  • 24/24 tests passing (5 new: feedback store, async flag)

Pending in phase 1: publish baseline RAGAS metrics + p95 latency (requires API key for eval run).

…nd compose

- Async ingestion: REDIS_URL activates arq queue; upload returns 202+job_id,
  worker (worker.py) with retries (max_tries=3) and bounded concurrency;
  GET /api/jobs/{job_id} for status. Sync fallback when REDIS_URL unset.
- Feedback loop: POST /api/feedback (+1/-1) persisted to data/feedback.jsonl
  and mirrored as Langfuse trace score (Tracer.score_feedback);
  /api/ask now returns trace_id; GET /api/feedback/summary aggregates.
- docker compose: API + worker + Redis one-command stack.
- Health endpoint reports ingestion_mode and feedback stats.
- Tests: 5 new (feedback store, async flag). Lint fixes for unused imports.
- docs/rag-architecture.workflow.json: validated showcase spec (9/9 checks)
- docs/rag-architecture.html: interactive viewer (themes, guided views, trace)
- docs/rag-architecture.png: static render embedded in README
Light-themed 4-phase infographic (intake, hybrid retrieval, augmentation,
generation) with async indexing and quality-loop side lanes, matching the
reference style. The archify interactive viewer stays as docs/rag-architecture.html.
…ecision diamond

Closer to the reference style: saturated phase-label columns, dotted
connectors with joint dots, HYBRID_SEARCH decision diamond, icons in
every box, dashed side lanes for async indexing and quality loop.
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