Skip to content

Commit 9ce0571

Browse files
committed
docs: rewrite README with banner, story diagrams + screenshots; harden ingest source-fetch retry
- New README: generated banner, how-it-works + vs-RAG story SVGs, install/terminal and dashboard screenshots, Docker quick-start, BYOK, API, SDK, benchmark sections. - Widen getSourceWithRetry window (~16s) so large sources survive heavy concurrent ingestion; UI Ask falls back to the server key when no BYOK key is set.
1 parent 678a7a3 commit 9ce0571

8 files changed

Lines changed: 222 additions & 235 deletions

File tree

README.md

Lines changed: 105 additions & 231 deletions
Large diffs are not rendered by default.

docs/images/banner.png

88.6 KB
Loading

docs/images/how-it-works.svg

Lines changed: 63 additions & 0 deletions
Loading
130 KB
Loading

docs/images/screenshot-install.png

103 KB
Loading

docs/images/vs-rag.svg

Lines changed: 39 additions & 0 deletions
Loading

localapp/index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,21 @@ <h3>Model & API key</h3>
375375
document.getElementById("q").addEventListener("keydown",e=>{ if((e.metaKey||e.ctrlKey)&&e.key==="Enter") ask(); });
376376
async function ask(){
377377
if(!activeDoc) return; const q=document.getElementById("q").value.trim(); if(!q) return;
378-
if(!getSettings().apiKey){ openSettings(); document.getElementById("setStatus").innerHTML='<span style="color:var(--warn)">Set an API key to ask questions.</span>'; return; }
379378
const out=document.getElementById("result"), btn=document.getElementById("ask"); btn.disabled=true; pdfDoc=null;
380379
out.innerHTML=`<div class="res card" style="margin-top:16px"><div class="body"><span class="spin"></span><span class="askhint">Navigating the document…</span></div></div>`;
381380
const t0=performance.now();
382381
try{
383382
const r=await fetch(E("/v1/answer/treewalk"),{method:"POST",headers:{"Content-Type":"application/json",...llmHeaders()},body:JSON.stringify({document_id:activeDoc.id,query:q})});
384383
const d=await r.json();
385-
if(!r.ok){ out.innerHTML=`<div class="res card"><div class="body err">Error: ${esc(d.error||JSON.stringify(d))}</div></div>`; return; }
384+
if(!r.ok){
385+
const msg=d.error||JSON.stringify(d);
386+
if(/no LLM credentials|X-LLM-Api-Key/i.test(msg)){
387+
out.innerHTML=""; openSettings();
388+
document.getElementById("setStatus").innerHTML='<span style="color:var(--warn)">Set your API key to ask questions.</span>';
389+
return;
390+
}
391+
out.innerHTML=`<div class="res card"><div class="body err">Error: ${esc(msg)}</div></div>`; return;
392+
}
386393
renderResult(d,Math.round(performance.now()-t0));
387394
}catch(e){ out.innerHTML=`<div class="res card"><div class="body err">${esc(String(e))}</div></div>`; }
388395
finally{ btn.disabled=false; }

pkg/ingest/ingest.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,11 @@ func (p *Pipeline) parse(ctx context.Context, parsers *parser.Registry, pl Paylo
556556
// retried with short backoff rather than failing the whole document.
557557
// Any non-ErrNotFound error returns immediately.
558558
func getSourceWithRetry(ctx context.Context, s storage.Storage, key string) (io.ReadCloser, storage.Metadata, error) {
559-
const attempts = 6
559+
// Up to ~16s of incremental backoff. A large source (multi-MB) written
560+
// under heavy concurrent ingestion on a busy/low-disk filesystem can take
561+
// several seconds to become visible to this worker; a too-short window
562+
// turns that transient into a hard "object not found" failure.
563+
const attempts = 16
560564
var lastErr error
561565
for i := 0; i < attempts; i++ {
562566
rc, meta, err := s.Get(ctx, key)
@@ -570,7 +574,7 @@ func getSourceWithRetry(ctx context.Context, s storage.Storage, key string) (io.
570574
select {
571575
case <-ctx.Done():
572576
return nil, storage.Metadata{}, ctx.Err()
573-
case <-time.After(time.Duration(i+1) * 150 * time.Millisecond):
577+
case <-time.After(time.Duration(i+1) * 125 * time.Millisecond):
574578
}
575579
}
576580
return nil, storage.Metadata{}, lastErr

0 commit comments

Comments
 (0)