View All Sessions
ai4j-shader-screenshot

Context and Similarity - Food for Thought

In GenAI Java applications, “context” is critically important for guiding LLMs to generate useful results. You can include context in a simple prompt, or context can be extracted from a data store, eg, in a RAG-based system. Context is what separates a chatbot that sounds smart from one that is actually helpful. It allows agents to make more accurate decisions on what actions to take. Control of your context also allows black hats to distort results for nefarious purposes.

This short session breaks down context into similarity and embeddings. You’ll learn the fundamentals of embeddings, how embeddings turn text into vectors, how similarity search finds the best matching chunks, and what your Java code is really doing when it chunks documents, queries a vector store, and selects results to feed the LLM. We will cover the practical knobs that matter, including chunk size and overlap, metadata filters, distance metrics, and top-k settings, and how each one impacts answer quality, latency, and the risk of hallucinations. You will also see why adding more context and large “context windows” are not always better, and how to focus on the right context instead.

Frank Greco Headshot
Frank Greco
Enterprise AI Consultant, Crossroads Technology
Frank Greco Headshot
Frank Greco
Enterprise AI Consultant, Crossroads Technology

Frank Greco is a long-time denizen of the local NY tech scene, a senior consultant and enterprise architect focusing on AI / Machine Learning, Cloud, and Mobile/Edge computing. More than just a conventional consultant, Frank is a long-time educator, a prolific writer, a developer community builder, a mentor, a proponent of DEI, and an expert on tech partnerships and innovations, especially in financial systems and enterprise computing. 

Frank is the co-author of JSR #381 “VisRec”, a Java API for visual recognition and machine learning. He often shares his insights at top tech conferences worldwide, such as QCon, DevNexus, Dev2next, Jfokus, Devoxx, IDEA Conf, TechTran, and many others. 

In addition, Frank is a recognized Java Champion and the founder/Chairman of NYJavaSIG, the world’s first and North America’s largest Java User Group. Frank authored and performed “Java Jam” with the band The Yield, the first song about Java, at The Bitter End in 1996. 

More On-Demand Sessions

Building a Star Trek Computer with Java 25 and Spring AI

Ken Kousen
Java Champion, Author, and Professor of the Practice of Computer Science

Refactoring Code to Functional Style using AI

Dr. Venkat Subramaniam
President, Agile Developer, Inc.

Building AI Agents with Spring & MCP

James Ward
Developer Advocate, AWS
Josh Long
Spring Developer Advocate, Broadcom
Azul, Azul Systems, Zing, Zulu, Zulu Enterprise, ReadyNow! are either registered trademarks or trademarks of Azul Systems Inc., registered in the U.S. and elsewhere. All other trademarks belong to their respective owners.
© Azul 2025. All rights reserved.
  • Compliance
  • Privacy Policy
  • Legal
  • Terms of Use
  • Privacy Settings