Scan your whole stack
From OX Research Newsroom
Are you using rust-scholar-transformer?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.3.0
rust-scholar-transformer was last scanned on 29 Nov 2026 at version 0.3.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.3.0 LATEST | 29 Nov 2026 | No rules fired |
Findings for v0.3.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.3.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A real-time multi-source retrieval core engine, written in Rust.
It fetches arXiv, Semantic Scholar, news, blogs, YouTube, and the web concurrently, then runs normalize -> deduplicate -> rank fusion -> caching, and exposes a search core that an LLM or Python uses with a one-line import.
This document is the complete developer manual for the library. It covers the design philosophy, the public API, per-source behavior and limitations, Python usage, how to add a new source, and the build and test workflow.
Key references
In a RAG / research agent, external knowledge retrieval (the latest papers, news, and web) directly determines answer quality, yet the Rust ecosystem lacks a single core that federates, normalizes, deduplicates, and re-ranks multiple sources asynchronously. This library is not a plain fetch; it aims to be a collection, normalization, and ranking engine that prepares material an LLM can trust and cite.
| Principle | What it means |
|---|---|
| Multi-source federation | One query fetches arXiv, Semantic Scholar, news, blogs, YouTube, and web concurrently (tokio fan-out) and normalizes them into a single Document. |
| Deterministic local processing | Live API results are non-deterministic, but the local processing (normalization, deduplication, rank fusion) is deterministic: the same per-source result lists always yield the same order and dedup outcome, regardless of which source answered first. |
| Plugin-extensible | A new source needs only one trait, Source. The core stays untouched. |
| Resilient | If one source fails or times out, the rest of the results survive and the failure is reported as a warning in the SearchReport. |
| Model-free, zero-FFI by default | The default build is pure Rust with no neural-network or LLM dependency. Semantic understanding, summarization, and re-ranking are the caller's (LLM's) job. |
A single fetch is network-bound, so the language difference is small. Where Rust makes a difference is large concurrent fan-out plus result post-processing (normalization, deduplication, rank fusion, caching): these are CPU and concurrency work, where GIL-free Rust wins on throughput and memory.
one LLM's fetch(url) = fetch a single page
this engine = fetch many sources at once -> normalize -> deduplicate -> rank fusion -> prepare citable material
There is one boundary between the core and the caller: can it be done deterministically without a model (core), or does it require understanding and generating meaning (caller). What to search, summarizing results, generating answers, and semantic re-ranking are the caller's job (LLM/Python).
use rust_scholar_transformer::{ArxivSource, Engine, GoogleNewsSource, SearchQuery};
#[tokio::main]
async fn main() {
let mut engine = Engine::new();
engine.register(Box::new(ArxivSource::new())); // no key needed
engine.register(Box::new(GoogleNewsSource::new())); // no key needed
let report = engine.search(SearchQuery::from_text("agentic loop engineering", 20)).await;
for d in &report.docs {
println!("[{:?}] {} ({})", d.source, d.title, d.url);
}
for w in &report.warnings {
eprintln!("warning from {:?}: {}", w.source, w.message);
}
}
Results are returned as a JSON string (serialization stability first).
import json
from rust_scholar_transformer import Retriever
r = Retriever(sources=["arxiv", "news"]) # works with zero keys
report = json.loads(r.search("agentic loop engineering", limit=20))
for d in report["docs"]:
print(d["source"], d["title"], d["url"])
for w in report["warnings"]: # includes sources that returned nothing
print("warning:", w["source"], w["message"])
Write focused queries. Terms are combined with AND, so a long natural-language sentence can legitimately
return nothing. Use two or three keywords, or quote a phrase, and narrow by arXiv category when it helps:
r = Retriever(sources=["arxiv"], arxiv_categories=["cs.CL", "eess.AS"])
report = json.loads(r.search('"speaker diarization" whisper', limit=10))
Date windows, sort order, citation counts, and caching are optional arguments:
r = Retriever(sources=["arxiv", "s2"], cache="memory")
report = json.loads(r.search('"speaker diarization"', limit=10,
sort="citations", from_date="2024-01-01", to_date="2025-12-31"))
for d in report["docs"]:
print(d["sources"], d["extra"].get("citationCount"), d["title"])
Cargo.toml:
[dependencies]
rust_scholar_transformer = "0.3"
| Feature | Enables | Notes |
|---|---|---|
| (default) | all source adapters + L1 in-memory cache + rate limiting | pure Rust, zero FFI |
cache-disk |
L2 disk cache | redb (pure Rust, expiry checks) |
python |
PyO3 cdylib bindings | pyo3 (abi3, Python 3.9+) |
# default = [] # free, keyless core + all adapters, zero FFI
rust_scholar_transformer = { version = "0.3", features = ["cache-disk"] }
The default build requires no external
.so/.dlland no subprocess. The L1 cache (moka) and rate limiter are pure Rust and included by default; only the disk cache (redb) and Python bindings (pyo3) are explicit features. The published Python wheel is built with bothpythonandcache-disk. Transport security uses rustls (avoiding a system OpenSSL dependency).
SearchQuery -> Engine (fan-out + per-source concurrency cap + rate limit) -> [Source adapters run concurrently]
-> normalize (single Document) -> results reordered by registration order
-> identity grouping + weighted RRF fusion -> MinHash-LSH near-duplicate
-> recency/date filter -> cache (successful reports only) -> SearchReport (docs + warnings)
The heart of it is the single Document layer and the Source trait abstraction. Each adapter normalizes a source's own response into a Document, and the engine performs fusion, deduplication, and filtering without knowing the source kind.
Engine as a Source implementation. If a per-source rate policy exists, a limiter is attached automatically at registration.Because it calls live external APIs, the results themselves are non-deterministic. Determinism applies only to the local processing (normalization, deduplication, rank fusion).
The model module. Every type implements serde::{Serialize, Deserialize}.
pub struct Document {
pub identity: DocIdentity, // deduplication key
pub source: SourceKind, // Arxiv | News | Blog | Youtube | Web | Scholar
pub title: String,
pub url: String,
pub authors: Vec<Author>,
pub published_at: Option<DateTime<Utc>>,
pub fetched_at: DateTime<Utc>,
pub summary: Option<String>,
pub content: Option<String>,
pub language: Option<String>,
pub tags: Vec<String>,
pub sources: Vec<SourceKind>, // sources that provided the same document (merge tracking)
pub score: Score,
pub extra: HashMap<String, serde_json::Value>, // per-source raw data preserved
}
pub struct DocIdentity {
pub doi: Option<String>,
pub arxiv_id: Option<String>, // normalized: 2301.00001v2 -> 2301.00001
pub canonical_url: Option<String>, // canonical URL after removing tracking parameters
pub title_hash: u64, // fallback when no identifier (FNV-1a)
}
pub struct Author { pub name: String, pub id: Option<String> }
/// Serialized as the enum name by serde. `Scholar` is Semantic Scholar (added in 0.3.0).
pub enum SourceKind { Arxiv, News, Blog, Youtube, Web, Scholar }
pub struct Score {
pub fused: f64, // (weighted) RRF fusion result: the primary sort axis
pub freshness: f64, // freshness: the first tie-breaker
pub authority: f64, // per-source-kind prior, reported only (not used for ordering)
pub relevance: f64, // reserved; not populated by the core (always 0.0)
}
What the date and metadata fields mean, per source:
| Field | arXiv | Semantic Scholar | RSS / news |
|---|---|---|---|
published_at |
first submission (<published>) |
publicationDate (midnight UTC; the venue's date, which may differ from the arXiv date) |
the item's pubDate |
fetched_at |
when this engine received the response | same | same |
extra |
primaryCategory, updated (last revision) |
citationCount, influentialCitationCount, year, venue, s2PaperId, openAccessPdf |
none |
tags |
all arXiv categories | fieldsOfStudy |
none |
A missing citationCount means the source did not report one; 0 means the paper has no counted citations. Citation counts are an attention signal from one index, not a measure of correctness.
Query type:
pub struct SearchQuery {
pub text: String,
pub sources: Vec<SourceKind>, // empty = all registered sources
pub limit: usize, // unified top-K (not the per-source fetch count)
pub language: Option<String>,
pub recency: Option<Recency>, // Day | Week | Month | Year
pub from_date: Option<DateTime<Utc>>,
pub to_date: Option<DateTime<Utc>>,
pub sort: SortOrder, // Recent (default) | Relevance | Citations
pub include_content: bool, // not implemented: a Notice warning says so
pub expansions: Vec<String>, // not implemented: a Notice warning says so
}
// helpers: SearchQuery::from_text(text, limit) .with_sources(vec![..]) .with_sort(SortOrder::Citations)
// .with_recency(Recency::Month) .with_dates(Some(from), Some(to))
Query semantics:
sort orders results inside each source. The final list is always in fused (RRF) order, so sort="citations" with several sources gives "the most cited candidates from Semantic Scholar, fused with the others", not a citation-ordered list. For a strictly citation-ordered list, query Semantic Scholar alone.recency and from_date/to_date combine into one window; the narrower lower bound wins. recency counts back from now in exact durations (Month is 31 days), not whole calendar days.to_date given as a date covers that whole day (a document published at 15:00 on the to_date is kept).from_date after to_date returns no documents and an error warning without calling any source.Source TraitImplemented by every source adapter. A new source implements only this and registers with the engine.
#[async_trait::async_trait]
pub trait Source: Send + Sync {
fn kind(&self) -> SourceKind;
async fn search(&self, query: &SearchQuery) -> Result<Vec<Document>, FetchError>;
// what the engine calls; the default wraps `search` with no notes
async fn search_with_notes(&self, query: &SearchQuery) -> Result<SourceOutput, FetchError>;
fn rate_policy(&self) -> RatePolicy; // default implementation provided
}
pub struct SourceOutput { pub docs: Vec<Document>, pub notes: Vec<SourceNote> }
pub struct SourceNote { pub kind: WarningKind, pub message: String } // SourceNote::notice(..), ::partial(..)
pub struct RatePolicy { pub min_interval_ms: u64, pub max_concurrency: usize, pub daily_quota: Option<u32> }
Override search_with_notes when a source has something to say besides its documents: a partial failure inside the source, or a requested option it could only approximate. daily_quota is not enforced by the engine yet.
EngineFind threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.