r/Rag • • 12h ago

Discussion RAG Evaluation

5 Upvotes

I’m spinning up a new RAG project and want to make sure I’m thinking about retrieval evaluation the right way before I get too deep into tweaking chunking or embedding models.

How do you guys typically set this up from scratch? I'm trying to figure out the best way to handle:

  1. Generating test data when you don't have real user queries yet.
  2. Creating the ground truth and measuring if a retrieved result is actually relevant for example, do you check if it came from the right document/page, match exact chunks, or just ask an LLM if it helps answer the question?
  3. Which tools you actually stick with vs. what ends up being unnecessary overhead.

Any advice on what a simple, practical "day one" setup looks like would be hugely appreciated!


r/Rag • • 9h ago

Discussion AI answers quoting one zip code's price as the national price: where it comes from and how to check

2 Upvotes

Many retailers, grocers and big-box chains price by store or zip code. AI engines rarely say which location a price came from, so a shopper in Denver can get a quote that only applies to one store in Ohio.

Most of it traces back to how the page gets crawled. A bot with no location set lands on a default store, or gets one assigned by IP, and that store's price becomes the price. Schema and feeds can carry one number while the visible price swaps after a location cookie loads. Aggregators flatten regional prices into a single figure, and online-only prices get mixed in with in-store ones.

Checking it doesn't need anything fancy:
- Pick a small product set and pull the live price from several zip codes on the same day.
- Note which store the page defaults to with no location set, since that's often what bots see.
- Compare each AI-quoted price against the regional prices and record which location it matches.
- Repeat on a schedule, because regional prices move independently.

The tedious part is collection, since every zip needs its own session and store selection on each run. For that I'd recommend Ficstar: we maintain location-specific crawlers that pull prices by zip or store.

Has anyone mapped which default location each major retailer serves to bots?


r/Rag • • 8h ago

Showcase How do you prevent AI agents from getting stuck in infinite tool-calling loops?

1 Upvotes

Ever had an AI agent call the same tool 10 times, each time with a slightly different query, without getting any closer to the answer?

That's the agent loop problem.

I experimented with cyclic graphs using:

  • Parallel tool execution
  • Independent verification gates
  • 80% completeness threshold
  • Targeted refinement
  • Hard iteration limits and tool circuit breakers

The goal: agents that can self-correct without running forever.

Here's the architecture and implementation:

https://medium.com/@anishvv212002/stop-agent-loops-how-to-build-cyclic-graphs-that-dont-get-stuck-51e4bbffb5bf

A few things I'd like to discuss:

  1. Do you use hard iteration limits or let the LLM decide when to stop?
  2. Do you use a separate evaluator or rely on the reasoning model's self-evaluation?
  3. How do you handle agents that keep retrying tools when the results are incomplete?

PS: Used AI to paraphrase the post.

Do like the post if you like it and follow me on GitHub. Thank you!!


r/Rag • • 12h ago

Showcase Semantic Chords Geometry: an experiment in high semantic information density

1 Upvotes

I started with a question about my own thinking. Sometimes I can see how several things fit together before I have the words to explain it. Later, working on a completely different problem, I recognize the same relationship. What would it take for a language model to remember something in that form?

I’m exploring that question through Semantic Chords Geometry (SCG), part of my ModelMemory project. I’m using Nemotron Ultra to build a graph of relationships it proposes, expressing each one as a compact structure called a semantic chord. The aim is high semantic information density: preserving how concepts relate in a compact form that can be inspected and composed with other ideas.

A chord has two nodes and a bridge. Each is a small group of terms. The nodes identify what is being related, and the bridge tells you how to read them together. Choosing a different bridge between the same nodes expresses a different idea.

Each node also has a tension relative to the bridge: + for alignment or attraction, − for opposition or repulsion, and null when the tension is unspecified. Both nodes can align with a bridge; a chord can express a mutually supportive relationship as well as a conflict.

For a simple illustration:

  • First node (tension: −): autonomy, discretion
  • Bridge: standardization, procedure, protocol
  • Second node (tension: +): consistency, predictability

Under this reading, standardization limits individual discretion and supports consistent outcomes. We could examine that relationship in settings as different as organizational procedures and software protocols. The signs belong to this particular interpretation of the relationship.

This is the compression I’m interested in: a few groups of terms preserve a way that concepts fit together, leaving room to recognize that relationship in another situation. The model’s explanation can be stored alongside the chord to preserve its intended reading.

The graph now contains roughly 35,000 chords. To build it, I used BaryGraph, a separate graph built from Kaikki dictionary data, with a hierarchy formed algebraically. It gave Nemotron Ultra starting points and an extended lexicon. From those seeds, Nemotron proposed relationships, selected terms for the two nodes and bridge, and assigned their tensions. The resulting chords preserve the ideas it expressed as structures that can be inspected, compared, and searched.

The name describes three parts of the project. The semantics come from the terms in each group. The chord’s structure comes from the roles those groups play. The geometry comes from composing the vectors of the first node, bridge, and second node through an ordered Kronecker tensor product, stored as a compact tensor sketch. This makes role order part of the vector used to search for similar relationships. The tension labels preserve how each node relates to the bridge. Once a chord is stored, it becomes a possible neighbor for the next search. How well that geometry captures useful similarities across different vocabularies is something I want to test.

The same idea works one level up. In a meta-chord, each node is itself a chord, and a third chord serves as the bridge. This gives the graph a hierarchy of relationships built from other relationships. A higher-level idea remains connected to its components, so it can be opened up to examine the specific ideas it was built from.

One meta-chord from the latest run connects fractal curves with fast numerical algorithms. Each item below contains a complete child chord, written as [first node] → [bridge] → [second node]:

  • First node (meta-tension: +) [fractalesque, fractalated] + [iterated function system, space-filling curve, recursive construction] + [gosper curve, peano curve, hilbert curve, flowsnake]
  • Bridge (meta-tension: —) [recursion, quines, fixed point, y combinator, self-reference] + [hofstadter, strange loop, fractal, iteration, self-similarity] + [l-system, recursive structure, fractal, iteration, self-similarity]
  • Second node (meta-tension: +) [numerical linear algebra, computational fluid dynamics] + [strassen algorithm, schönage-strassen algorithm, toom-cook algorithm] null [scientific computing, applied mathematics]

The parenthetical signs give the tension at the meta-chord level. The three child chords retain their own internal tension pairs: (+, +), (+, +), and (+, null), respectively.

The resulting idea is that recursive organization can appear both as a geometric pattern and as a way of structuring a computation. Nemotron expressed that connection by composing three existing chords, each of which remains available to inspect.

This is what I mean by high semantic information density: a small structure can organize relationships between concepts whose detailed explanation spans many pages. Unpacking this meta-chord’s mathematical background, constructions, and connections could take tens of pages. The chord preserves the relational organization, while a model or reader draws on existing knowledge to develop the full explanation.

What I want to test is how much relational meaning survives in this compact form, and how reliably another model or person can recover the intended idea.

I’m looking for people who’d enjoy building or testing this with me. If two situations from your field come to mind that use very different vocabulary but turn on the same relationship, I’d love to hear the pair. That would give us something concrete to try.


r/Rag • • 19h ago

Showcase NornicDB - v1.5.4 - New Lands - PQC encryption and FGAC- MIT Licensed.

1 Upvotes

For both transport and at-rest encryption, New Lands brings us into alignment with new NSA/NIST-compliant standards.

The addition of XChaCha20 is in anticipation of a potential AES break. I have heard from multiple sources that any encryption that uses 2048 bit encryption hasn’t been broken, but I have it in good authority that the cost to break it has been reduced to GPU rental costs for, and the rest is conjecture: an algorithm designed by AI that is GPU accelerated to brute force the encryption for RSA and ECC.

These are wild times!

MIT Licensed,
Research-backed,
930+ stars and counting

features include FGAC (Fine-Grained-Access-Control) out of the box now as well, and new docs site and app UI. check it out here

if you like it give us a star!


r/Rag • • 22h ago

Discussion Need help for LLM-powered Natural Language to SQL converter.

1 Upvotes

So, I am building an NL-to-SQL converter, but I don't know how to build a RAG system for it.

Problems:

What if RAG is unable to retrieve an important table required to build the query?

What if we need 6 tables to build a query, but K = 5?

What's the best way to create documents and generate embeddings for this use case?

I added a description for better retrieval and it looks like this

{ Table , Column: { Name, Constrain: // pk, Isnullable, Default, } Relationship: // fk only, Description, }


r/Rag • • 2h ago

Discussion My company has provided us claude code but given us peanuts as usage credits. I want to build an internal tool to reduce token usage

0 Upvotes

I was very anti ai but i have decided to dip my toes. I want to build an internal tool which can cut token usage, i learnt a bit about rag pipelines and while ai tells me it will cut token usage can anyone here actually explain me how it will cut token usage without using the words load bearing and smoking gun. I would also like some guidance on how i should architect this tool considering this has to be scaled and should be a highly available system. Also i would like to know how it will connect to the already given claude code. Like how will claude code know that this rag pipeline is there, i will access it . What are the safe practices i should keep in mind and if there is amy other internal tool i can make please suggest that too im open to that. Also it would be great if you could share resource material which will increase my knowledge. Im very excited to make this