EverAlgo rank: 4 business-facing rankers (episodic / profile / case / skill) over a shared fusion / weight / rerank toolkit.
Project description
everalgo-rank
Memory ranking for EverAlgo — four business-facing ranker classes (EpisodicRanker / CaseRanker / SkillRanker / profile rank) composed over a shared toolkit (fusion / weight / rerank). Pure in-memory rank, no storage I/O.
See the umbrella project: EverAlgo monorepo and the architecture document at docs/concepts/architecture.md.
Install
pip install everalgo-rank
What this distribution provides
| Symbol | Role |
|---|---|
EpisodicRanker |
Class facade — episodic memory ranking; LLM bound at construction |
CaseRanker |
Class facade — agent case ranking; LLM bound at construction |
SkillRanker |
Class facade — agent skill ranking; LLM bound at construction |
profile.rank |
Module-level sync function — profile ranking; cosine sort + dedup, no LLM |
RankConfig |
Frozen pydantic config: fusion_mode, rrf_k, alpha, etc. |
FusionMode |
Literal type: "rrf" / "lr" / "mrag" / "agentic" |
DEFAULT_RANK_CONFIG |
RankConfig() with defaults (fusion_mode="rrf", rrf_k=60) |
arank / rank |
Top-level async / sync dispatch — routes to the registered ranker by RankInput.memory_type |
arerank / rerank |
Low-level LLM rerank step; used by the ranker facades internally |
Quick start
import asyncio
import json
from everalgo.llm.types import ChatResponse
from everalgo.rank import EpisodicRanker, DEFAULT_RANK_CONFIG
from everalgo.testing.fake_llm import FakeLLMClient
from everalgo.types import Candidate, RankInput
_RERANK_JSON = json.dumps({"ranked": [{"id": "ep_a", "score": 0.95}]})
async def main() -> None:
fake = FakeLLMClient(responses=[ChatResponse(content=_RERANK_JSON, model="fake")])
ranker = EpisodicRanker(llm=fake)
rank_input = RankInput(
query="Python async retry patterns",
memory_type="episodic",
dense_candidates=[
Candidate(id="ep_a", score=0.9, metadata={"episode": "Alice asked about async retries."}),
Candidate(id="ep_b", score=0.5, metadata={"episode": "Team discussed lunch."}),
],
top_k=1,
)
output = await ranker.arank(rank_input, config=DEFAULT_RANK_CONFIG, enable_rerank=True)
for item in output.items:
print(f"{item.id} score={item.score:.2f}")
asyncio.run(main())
LLM rerank step
arerank is the standalone LLM reranking primitive used internally by the ranker facades and exposed for direct use:
from everalgo.rank.rerank import arerank
from everalgo.rank.prompts.en.episodic import EPISODIC_RERANK_PROMPT_EN
from everalgo.types import Candidate
reranked = await arerank(
candidates,
prompt=EPISODIC_RERANK_PROMPT_EN,
top_k=5,
llm=client,
)
API surface
| Symbol | Module | Signature summary |
|---|---|---|
EpisodicRanker |
everalgo.rank |
__init__(*, llm) → arank(rank_input, *, config, prompt, enable_rerank, ...) → RankOutput |
CaseRanker |
everalgo.rank |
Same shape as EpisodicRanker |
SkillRanker |
everalgo.rank |
Same shape as EpisodicRanker |
profile.rank |
everalgo.rank.profile |
(rank_input, *, threshold=0.0) → RankOutput — sync, no LLM |
RankConfig |
everalgo.rank |
fusion_mode: FusionMode = "rrf", rrf_k: int = 60, alpha: float = 1.0, expand_limit: int = 3 |
arank |
everalgo.rank |
Top-level async dispatch by rank_input.memory_type |
arerank |
everalgo.rank.rerank |
(items, *, prompt, top_k, llm) → list[Candidate] |
Cross-links
everalgo-core—RankInput,RankOutput,Candidate,ScoredItem,LLMClienteveralgo-user-memory— producesEpisode/AtomicFact/Profilethat EverOS Recall packages intoCandidatefor rankingeveralgo-agent-memory— producesAgentCase/AgentSkillcandidates
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file everalgo_rank-0.1.0.tar.gz.
File metadata
- Download URL: everalgo_rank-0.1.0.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f45911d0dafa72de311498f80139498bc7ba2fb649353d95770ad15f885b23eb
|
|
| MD5 |
a48d6bf4188be51a87afdc4f674d8897
|
|
| BLAKE2b-256 |
c7ba930febda69ad80bfbb201adf60f6bb6c4f8c03213e59b44877209df0f86e
|
File details
Details for the file everalgo_rank-0.1.0-py3-none-any.whl.
File metadata
- Download URL: everalgo_rank-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b95be1b9730803d48aa4c250c68f7258e4538636d81cffb7d7b0a25f71af79ed
|
|
| MD5 |
ff12831e29e3bc269254e6ba7c581109
|
|
| BLAKE2b-256 |
46083e4290058ab393c952706d680fe5c0ea7b6d9dcdf5a73e82aa9fb9e3cd80
|