Repository navigation
Optional retrieval rerank (off by default): generic hook, Jev as one possible backend #2381
WiktorB2004
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Opening this as an Idea, not an issue. I will not open a PR unless you want this on the roadmap.
Summary
Would you consider an optional rerank step after vector retrieval, off by default? RAG chat could keep a larger
retrieval.top_kand only send the most relevant chunks to the LLM.I maintain
llama-index-postprocessor-jev(JevRerank), a LlamaIndexBaseNodePostprocessor. I am saying that so it is clear I am the package author. This is not a request to make TypeSafe required.Why
Embedding similarity often returns chunks that are about the topic but do not answer the question. Rerank is retrieve-many, keep-few.
PrivateGPT already retrieves with
retrieval.top_k(default 32). Older settings had optional local rerank:That block is gone on current
main. Contextual chat still has anode_postprocessorslist (for exampleMetadataReplacementPostProcessor), so a reranker can be appended when enabled.What I have in mind
Not a required dependency. Not on by default.
A generic rerank hook: after retrieval, optionally run a LlamaIndex postprocessor, then continue. Settings pick the backend. Default is none. Jev would be one implementation of that slot, not the feature itself.
backendnonelocalrag.rerank)jevJevRerank, extra/optional package, API key from env, never committedIf rerank errors, keep the original retrieval order (truncated). Do not drop context. Fail open.
Default install and air-gapped /
offline_modestay unchanged.If you only want
noneandlocal, that works. Hosted Jev can stay out of this repo.Local path on the package (not this discussion)
Jev is hosted today (
provider="typesafe"or"openrouter"). The package already switches transport withprovider=...and the same typed answers (Score/Choice/Noul).If a suitable open decision model appears (same return types, not necessarily TypeSafe weights), later package releases will add
provider="local"so rerank can run on-machine with no TypeSafe or OpenRouter call.For PrivateGPT, the same settings flag could later point at local inference. I am not asking you to wait for that. There is no local model I would ship yet as matching hosted Jev calibration.
Out of scope
provider="local"What I need from you
PrivateGPT is built for local/private models. Hosted Jev may be a no. Useful answers:
localand/orjev). I can PR.Offer
If you want it, I can PR: settings, optional extra, tests with a mocked client (no live API in CI), short docs note. I will wait for a yes or no.
References
All reactions