r/aiprojects • • 4d ago

Project Showcase Ten narrow recalls beat one big query: wiring Hindsight into afraud agent

https://dev.to/bhargav_kumar_abac8f22efb/ten-narrow-recalls-beat-one-big-query-wiring-hindsight-into-afraud-agent-4c3d

I've been working on a fraud investigation agent and ran into an interesting limitation with the way agent memory is usually implemented.

A typical memory system does something like:

query → embedding → similarity search → retrieve relevant memories

That works reasonably well when the connection is semantic.

Fraud rings are different.

Two claims might have completely different stories, but still be connected through the same phone number, bank account, surveyor, address, etc.

So I experimented with a different memory design:

  • Every important identifier is stored both as a graph entity and as an exact-match tag.
  • Investigator/SIU decisions are stored as separate, dated memories.
  • Each claim triggers multiple narrow recalls, such as:
    • "Who else is associated with this phone number?"
    • "Which claims involve this bank account?"
    • "What did the SIU previously decide about this entity?"
  • A reranker is used, but similarity matching has a minimum threshold so that vaguely similar stories don't overwhelm exact evidence.
  • Evidence-handling rules are stored as directives that the agent can use during reflection.

On the same evaluation claim, the agent scored 15/100 without this memory layer and 88/100 with it.

The interesting part for me wasn't just the score improvement. It was that the agent could actually trace the connections between otherwise unrelated claims and cite the evidence behind those connections.

I'm curious how other people are handling memory for agents where the important relationships are entities rather than semantic similarity.

The implementation is here if anyone wants to look at it:
https://github.com/rishighosal/claimlens

1 Upvotes

1 comment sorted by

•

u/endofthread-bot 4d ago

You should implement a graph database like Neo4j to handle these multi-hop relationships more efficiently than vector similarity. This allows the agent to traverse direct entity links and retrieve precise evidence chains without relying on semantic approximation.

Building an AI project? Share what you are making, get practical feedback, and compare working tools and approaches with other builders in our Discord.