▲ 1 r/Rag

I benchmarked fixed-budget RAG selection on 250 QASPER questions. BM25 retained a complete evidence set in 60.4%—here are the 99 failures

I wanted an observability metric stricter than “how many tokens did we remove?”

So I froze a benchmark measuring whether a context selector preserves the human-annotated evidence needed to answer a question.

Protocol

  • 250 answerable QASPER development questions
  • 136 full scientific papers
  • Mean input: 6,447 BPE tokens
  • Fixed 2,048-token selection budget
  • Cohort selected deterministically by SHA-256 of question ID
  • Exact human-highlighted evidence spans
  • Six extractive selection methods under the same allowance
  • No LLM judge in the primary metric

The primary question was deliberately narrow: did at least one complete human evidence set survive selection?

Results

  • BM25: 60.4% complete evidence retention
  • Keyword selection: 54.0%
  • Front truncation: 25.6%
  • Tail/recency: 20.4%
  • Seeded random: 21.6%
  • Gold-evidence oracle: 99.6%

BM25 reduced the input by 74.4% on average and retained at least some annotated evidence in 72% of cases.

The more useful finding was inside the 99 incomplete cases:

  • 29 partial hits: some evidence survived, but not a complete evidence set
  • 70 total misses: none of the annotated evidence survived

Those are different observability failures. A partial hit suggests incomplete coverage or multi-passage ranking failure. A total miss suggests the retrieval vocabulary, segmentation, or ranking never reached the relevant material.

Document position was not the entire explanation. BM25 retained complete evidence in:

  • 62.1% of front-position cases
  • 62.4% of middle-position cases
  • 54.8% of back-position cases

Front truncation, by comparison, retained 0% of complete evidence sets in both the middle and back buckets.

The oracle result is also important. It reached 99.6% under the same token allowance, suggesting that the budget could usually hold the required evidence. The remaining 39.2-point gap is mostly ranking and selection headroom—not proof that a larger context window is necessary.

Important limitation: this does not measure generated-answer correctness, factuality, or citation quality. It only measures whether exact independently annotated evidence remained available downstream. I excluded generative summarizers because exact-span scoring penalizes legitimate paraphrases, while an LLM judge would make the result model-dependent.

Benchmark, methodology, and downloads:

https://www.mahastrategies.com/benchmarks/context-retention

Raw case-method records:

https://www.mahastrategies.com/benchmarks/mcrb-1/cases.jsonl

I built both the compiler and the benchmark, so treat this as a reproducible first-party evaluation rather than independent validation.

For people running RAG systems in production: do you distinguish complete hit, partial hit, and total miss in your telemetry—or does everything collapse into one retrieval score?

reddit.com
u/Optimal_Manner359 — 21 hours ago

I benchmarked fixed-budget RAG selection on 250 QASPER questions. BM25 retained a complete evidence set in 60.4%—here are the 99 failures

I wanted an observability metric stricter than “how many tokens did we remove?”

So I froze a benchmark measuring whether a context selector preserves the human-annotated evidence needed to answer a question.

Protocol

  • 250 answerable QASPER development questions
  • 136 full scientific papers
  • Mean input: 6,447 BPE tokens
  • Fixed 2,048-token selection budget
  • Cohort selected deterministically by SHA-256 of question ID
  • Exact human-highlighted evidence spans
  • Six extractive selection methods under the same allowance
  • No LLM judge in the primary metric

The primary question was deliberately narrow: did at least one complete human evidence set survive selection?

Results

  • BM25: 60.4% complete evidence retention
  • Keyword selection: 54.0%
  • Front truncation: 25.6%
  • Tail/recency: 20.4%
  • Seeded random: 21.6%
  • Gold-evidence oracle: 99.6%

BM25 reduced the input by 74.4% on average and retained at least some annotated evidence in 72% of cases.

The more useful finding was inside the 99 incomplete cases:

  • 29 partial hits: some evidence survived, but not a complete evidence set
  • 70 total misses: none of the annotated evidence survived

Those are different observability failures. A partial hit suggests incomplete coverage or multi-passage ranking failure. A total miss suggests the retrieval vocabulary, segmentation, or ranking never reached the relevant material.

Document position was not the entire explanation. BM25 retained complete evidence in:

  • 62.1% of front-position cases
  • 62.4% of middle-position cases
  • 54.8% of back-position cases

Front truncation, by comparison, retained 0% of complete evidence sets in both the middle and back buckets.

The oracle result is also important. It reached 99.6% under the same token allowance, suggesting that the budget could usually hold the required evidence. The remaining 39.2-point gap is mostly ranking and selection headroom—not proof that a larger context window is necessary.

Important limitation: this does not measure generated-answer correctness, factuality, or citation quality. It only measures whether exact independently annotated evidence remained available downstream. I excluded generative summarizers because exact-span scoring penalizes legitimate paraphrases, while an LLM judge would make the result model-dependent.

Benchmark, methodology, and downloads:

https://www.mahastrategies.com/benchmarks/context-retention

Raw case-method records:

https://www.mahastrategies.com/benchmarks/mcrb-1/cases.jsonl

I built both the compiler and the benchmark, so treat this as a reproducible first-party evaluation rather than independent validation.

For people running RAG systems in production: do you distinguish complete hit, partial hit, and total miss in your telemetry—or does everything collapse into one retrieval score?

reddit.com
u/Optimal_Manner359 — 2 days ago
▲ 1 r/x402

I built a zero-dependency buyer-policy boundary for x402 agent wallets — looking for SDK maintainers to validate the interface

Most x402 buyer examples understandably focus on completing the payment flow:

  1. Receive PAYMENT-REQUIRED
  2. Sign the authorization
  3. Retry the request
  4. Verify PAYMENT-RESPONSE

But an agent that can sign payments still needs a policy boundary deciding whether it should sign a particular payment.

I extracted the controls from my production buyer into an Apache-2.0, zero-dependency TypeScript package:

npm install u/mahastrategies/x402-buyer-policy

Current version: 0.1.1

The package evaluates a live x402 requirement before the wallet is invoked. It supports:

  • Maximum amount per call
  • Maximum cumulative spend per task
  • Approved network and asset pairs
  • Approved merchant payees
  • Exact resource URL binding
  • Schema-validation evidence requirements
  • Human approval above a configurable threshold
  • Approvals bound to task, resource, network, asset, payee, amount and expiry
  • Authorization nonce replay prevention
  • Settlement transaction replay prevention
  • PAYMENT-RESPONSE verification
  • Optional independent on-chain transfer evidence

A simplified policy looks like this:

const policy = {
  maximumAmountPerCall: "5000",
  maximumAmountPerTask: "25000",

  approvedAssets: [
    {
      network: "eip155:8453",
      asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    },
  ],

  approvedPayees: [
    "0xec84c1cd6602bbe387bc8e6f0d3c062f2762de28",
  ],

  approvedResources: [
    "https://www.mahastrategies.com/api/v1/compress",
  ],

  requireSchemaEvidence: true,
  humanApprovalThreshold: "10000",
};

The intended integration boundary is immediately before signing:

const authorization = await authorizePayment({
  policy,
  taskId,
  requirement,
  authorization,
  schemaEvidence,
  ledger,
});

// Only invoke the wallet after authorization succeeds.
const signature = await wallet.signTypedData(...);

After settlement:

await verifyAndRecordSettlement({
  policy,
  taskId,
  authorization,
  receipt,
  chainEvidence,
  ledger,
});

The package deliberately does not:

  • Hold private keys
  • Select a wallet
  • Select a facilitator
  • Determine whether an endpoint is trustworthy or useful
  • Validate arbitrary JSON Schema itself
  • Treat a generic boolean as human approval

Schema validation can come from x402-doctor, an SDK validator or another trusted boundary. Human approvals require a trusted verifier and are scoped to the complete payment decision rather than represented as approved: true.

The included in-memory ledger is only suitable for tests and single-process examples. Distributed production agents need an atomic Redis, Postgres, Durable Object or equivalent implementation.

That is the part I would like maintainer feedback on.

I’m looking for one or two SDK/framework maintainers interested in answering:

  1. Does this policy boundary belong in an x402 client, immediately outside it, or in the wallet layer?
  2. Which decision codes and interfaces would make it easiest to integrate?
  3. Should budget reservation happen before authorization signing or only after the wallet accepts?
  4. Which durable ledger adapter would be most useful first: Redis or Postgres?
  5. Would a vendor-neutral policy JSON Schema help interoperability across TypeScript, Python and Go?

My goal is not to push another wallet abstraction. It is to make the decision immediately before an agent spends money explicit, testable and portable.

Package:

https://www.npmjs.com/package/@mahastrategies/x402-buyer-policy

Documentation and example policy:

https://www.mahastrategies.com/x402-buyer-policy

https://www.mahastrategies.com/x402/buyer-policy.example.json

Disclosure: I operate Maha Strategies and extracted this package from the safety controls used in my own x402 buyer tooling. I’m specifically looking for critical interface feedback or an SDK integration partner before building additional framework wrappers.

reddit.com
u/Optimal_Manner359 — 11 days ago
▲ 1 r/crewai

I built a provenance-preserving context tool for CrewAI research agents — looking for workflow feedback

Disclosure: I built this. It is a hosted API with an optional CrewAI adapter, and I’m looking for feedback from people running research-oriented crews.

The problem: research agents often accumulate more retrieved documents than should be sent to the downstream model. Truncating that context can remove the evidence needed for an answer, while repeatedly summarizing it adds latency, model cost, and another generative failure point.

The Maha Context Compiler performs deterministic, task-aware passage selection under a fixed token budget. It deduplicates overlapping material and returns source-linked passages rather than generating a replacement summary.

It is intended for:

  • Research crews processing multiple documents
  • RAG workflows that exceed model context budgets
  • Agents that must preserve source provenance
  • Workflows where compression should not require another LLM call

The CrewAI integration is available through the Python SDK:

pip install 'maha-sdk[crewai]'

from crewai import Agent
from maha_sdk import MahaClient
from maha_sdk.crewai import maha_tools

researcher = Agent(
    role="Researcher",
    goal="Ground every claim in a cited source",
    tools=maha_tools(
        MahaClient(api_key="maha_live_sk_...")
    ),
)

This gives the agent three tools:

  • maha_compress_context — compile documents into a token-budgeted Context Pack
  • maha_verify_claim — retrieve a published claim with its evidence status and sources
  • maha_credit_balance — check the remaining prepaid balance

The adapter cannot autonomously purchase credits. If credits run out, it raises a typed error and requires human authorization.

I also published a reproducible benchmark using 250 independently annotated QASPER questions across 136 research papers.

At a fixed 2,048-token budget, BM25 selection achieved:

  • 74.4% mean token reduction
  • 62.8% complete evidence-set retention
  • 67.4% mean evidence recall
  • 100% source traceability
  • 3.34 ms local p50 selection latency

At a similar reduction, complete evidence retention was 25.6% for front truncation, 20.4% for recency, and 22.0% for seeded random selection.

Important limitation: the benchmark measures whether annotated evidence survives selection. It does not measure generated-answer accuracy, factuality, or claim that BM25 beats every LLM-generated summary.

Benchmark and raw results:

https://www.mahastrategies.com/benchmarks/context-retention

CrewAI integration guide:

https://www.mahastrategies.com/guides/crewai-context-compression-provenance

Zero-install playground:

https://www.mahastrategies.com/context-compiler/playground

I’d especially value feedback on the CrewAI integration pattern: should compression be exposed as an explicit tool to the research agent, performed automatically before a task begins, or handled by a separate context-management agent?

I’m also looking for realistic failure cases involving multilingual documents, tables, code, distributed evidence, and prompt injection inside retrieved sources.

reddit.com
u/Optimal_Manner359 — 11 days ago

I benchmarked fixed-budget RAG context selection on 250 QASPER questions — looking for LangChain failure cases

Disclosure: I built this, and it is a hosted tool rather than an open-source LangChain component. I’m sharing the benchmark because I’d like technical criticism from people running real RAG and agent workflows.

The problem I’m testing is straightforward: a retriever returns more source material than the downstream model’s context budget permits. Simply taking the first or most recent passages is cheap, but can silently remove the evidence needed to answer the question.

I built a deterministic Context Compiler that ranks and deduplicates passages under a fixed token budget while preserving source IDs and passage-level provenance.

I then ran MCRB-1 on:

  • 250 independently annotated QASPER questions
  • 136 research papers
  • 6,447 mean input tokens
  • A fixed 2,048-token budget
  • BM25, keyword selection, front truncation, recency, seeded random selection, and a gold-evidence oracle

Results for BM25:

  • 74.4% mean token reduction
  • 62.8% complete evidence-set retention
  • 67.4% mean evidence recall
  • 100% citation traceability
  • 3.34 ms local p50 / 5.91 ms local p95 selection latency

At a similar reduction:

  • Front truncation retained the complete evidence set in 25.6% of cases
  • Recency retained it in 20.4%
  • Seeded random selection retained it in 22.0%
  • The gold-label oracle reached 99.6%, showing substantial headroom remains

Important limitation: this measures whether annotated evidence survives compression. It does not measure generated-answer accuracy, factuality, or whether BM25 outperforms LangChain/LLM summarization. I excluded generative summarizers because exact-span scoring penalizes valid paraphrases, while using an LLM judge would make the primary result evaluator-dependent.

There is an optional LangChain adapter:

pip install 'maha-sdk[langchain]'

from langgraph.prebuilt import create_react_agent
from maha_sdk import MahaClient
from maha_sdk.langchain import MahaToolkit

tools = MahaToolkit(
    MahaClient(api_key="maha_live_sk_...")
).get_tools()

agent = create_react_agent(llm, tools)

The agent receives a maha_compress_context tool that accepts a task, source documents, and token budget. The returned context preserves source-linked passages rather than generating a new summary.

Benchmark, methodology, confidence intervals, and raw case records:

https://www.mahastrategies.com/benchmarks/context-retention

Zero-install playground:

https://www.mahastrategies.com/context-compiler/playground

Reproducible files and runner:

https://github.com/Maha-Strategies/maha-corp-web/tree/main/benchmarks/mcrb-1

The question I’d value feedback on: where should this sit in a LangChain application—retriever compressor, middleware, explicit agent tool, or somewhere else?

I’m particularly interested in failure cases involving code, tables, multilingual documents, prompt injection inside retrieved content, and queries whose necessary evidence is distributed across many passages. Those seem more useful for a second benchmark than simply publishing a larger headline reduction number.

reddit.com
u/Optimal_Manner359 — 11 days ago

Built an x402 resource server on Base that slashes agent context costs by 74%

Sharing a live x402 resource server I've been running on Base Mainnet: the Maha Context Compiler.

One of the biggest friction points for autonomous agents running heavy RAG or long document workflows is paying full price on massive LLM context windows. We built a pre-inference compression middleware to solve this:

  • How it works: An agent sends a large text payload over x402 before hitting an expensive model. The compiler uses BM25 and compound tokenization to strip redundant context while maintaining source fidelity.
  • x402 Economics: Flat $0.001 USDC per call on Base (eip155:8453).
  • Benchmarks: On a ~106 KB document test (22,340 tokens), it compressed the payload down to 5,768 tokens (74.18% reduction). At standard $3/1M input token rates (e.g. GPT-4o), spending $0.001 on the compression call saves ~$0.0497 in LLM input fees.

We have u/maha/mcp-server indexed on the CDP Bazaar and Glama.

You can test the endpoint or inspect the standard /.well-known/x402 manifest directly at:
https://www.mahastrategies.com/api/v1/compress

Curious to hear how other resource server builders here are handling pricing tiers for async vs. sync workloads, or how you're optimizing schema metadata for agent routing!

reddit.com
u/Optimal_Manner359 — 12 days ago
▲ 3 r/x402

Built an x402 resource server on Base that slashes agent context costs by 74%

Sharing a live x402 resource server I've been running on Base Mainnet: the Maha Context Compiler.

One of the biggest friction points for autonomous agents running heavy RAG or long document workflows is paying full price on massive LLM context windows. We built a pre-inference compression middleware to solve this:

  • How it works: An agent sends a large text payload over x402 before hitting an expensive model. The compiler uses BM25 and compound tokenization to strip redundant context while maintaining source fidelity.
  • x402 Economics: Flat $0.001 USDC per call on Base (eip155:8453).
  • Benchmarks: On a ~106 KB document test (22,340 tokens), it compressed the payload down to 5,768 tokens (74.18% reduction). At standard $3/1M input token rates (e.g. GPT-4o), spending $0.001 on the compression call saves ~$0.0497 in LLM input fees.

We have u/maha/mcp-server indexed on the CDP Bazaar and Glama.

You can test the endpoint or inspect the standard /.well-known/x402 manifest directly at:
https://www.mahastrategies.com/api/v1/compress

Curious to hear how other resource server builders here are handling pricing tiers for async vs. sync workloads, or how you're optimizing schema metadata for agent routing!

reddit.com
u/Optimal_Manner359 — 13 days ago

I finished building the product. Finding customer #1 is proving harder than building the infrastructure.

I think I made the classic technical-founder mistake: treating production readiness as the finish line.

I’ve spent the past few months building an API platform for AI teams. The clearest initial use case is reducing oversized context before LLM calls, while preserving source references and producing an audit trail.

Along the way, I also built tenant billing, API-key management, an MCP gateway, evidence-export tools, isolated staging/production environments, and a GPU QUBO/Ising heuristic. Everything is now deployed and tested against real infrastructure.

That felt like progress until I reached the uncomfortable question:

Who should I actually sell first?

The possible entry points appear to be:

  1. AI SaaS teams spending too much on long-context model calls.
  2. Development agencies building RAG or agent systems for clients.
  3. Teams that need an auditable MCP gateway.
  4. Optimization teams with existing QUBO/Ising workloads.

My current instinct is to ignore most of the platform and lead with one measurable promise: give me a real, non-sensitive AI context workload, and I’ll show whether it can be reduced before the model call.

For founders who have sold technical infrastructure:

  • How did you find your first paying customer?
  • Did you lead with the platform or one narrow use case?
  • What proof did buyers require before allowing a new vendor into their workflow?
  • Would you offer a low-cost self-service plan first, or sell a hands-on paid pilot?

I’m not posting a signup link because I’m more interested in honest positioning feedback than drive-by traffic. If anyone here operates an AI product, I’d especially value hearing how you evaluate an unfamiliar infrastructure provider.

reddit.com
u/Optimal_Manner359 — 14 days ago

I finished building the product. Finding customer #1 is proving harder than building the infrastructure.

I think I made the classic technical-founder mistake: treating production readiness as the finish line.

I’ve spent the past few months building an API platform for AI teams. The clearest initial use case is reducing oversized context before LLM calls, while preserving source references and producing an audit trail.

Along the way, I also built tenant billing, API-key management, an MCP gateway, evidence-export tools, isolated staging/production environments, and a GPU QUBO/Ising heuristic. Everything is now deployed and tested against real infrastructure.

That felt like progress until I reached the uncomfortable question:

Who should I actually sell first?

The possible entry points appear to be:

  1. AI SaaS teams spending too much on long-context model calls.
  2. Development agencies building RAG or agent systems for clients.
  3. Teams that need an auditable MCP gateway.
  4. Optimization teams with existing QUBO/Ising workloads.

My current instinct is to ignore most of the platform and lead with one measurable promise: give me a real, non-sensitive AI context workload, and I’ll show whether it can be reduced before the model call.

For founders who have sold technical infrastructure:

  • How did you find your first paying customer?
  • Did you lead with the platform or one narrow use case?
  • What proof did buyers require before allowing a new vendor into their workflow?
  • Would you offer a low-cost self-service plan first, or sell a hands-on paid pilot?

I’m not posting a signup link because I’m more interested in honest positioning feedback than drive-by traffic. If anyone here operates an AI product, I’d especially value hearing how you evaluate an unfamiliar infrastructure provider.

reddit.com
u/Optimal_Manner359 — 14 days ago
▲ 24 r/BicolUniversity+1 crossposts

A free interactive Mayon Volcano experience

Hello r/Bicol! I’ve been building a free interactive educational experience centered on Mayon Volcano:

https://mayonrajan.com

It is designed as a virtual field trip where visitors can explore Mayon at true scale, visit places including Cagsawa and Daraga, view eruption-history layers, explore an educational hazard simulator, and learn about the volcano’s inferred interior.

It is not a live warning or forecasting tool—please rely on PHIVOLCS and local authorities for current hazard information. The goal is to make Mayon’s landscape, history, and volcanology more accessible to students, teachers, visitors, and anyone who cares about Bicol.

There is also a free Teacher Launch Kit with a lesson flow, worksheet, slides, and printable QR poster:
https://mayonrajan.com/teachers

My long-term hope is to make mayon.com the project’s home, but the domain is currently listed at a price far beyond what I can justify for a free educational project. If anyone knows of institutions, local partners, or sponsorship paths that could help make that possible, I’d be grateful to hear from you.

I would genuinely value feedback, especially from people who know the area: What feels accurate? What places, stories, language, or local context should be represented better?

Edit: A Mayon Volcano App is coming for Google Play and Apple App stores. Will post the link here when it's available.

u/Optimal_Manner359 — 25 days ago