The fundamental goal of GroundX is to allow developers to easily integrate large stores of complex documents into LLM powered systems. We take care of parsing, storage, and retrieval, allowing you to easily integrate highly contextualized and accurate information into your AI system.
The handoff between GroundX and the AI applications we power usually happens at the prompting level. Somehow, as an application developer, you need to take our responses and feed them into your AI system. This guide concerns how that might be done for a variety of use cases.
The most common application of GroundX is in question answering applications, which work well with the traditional RAG approach. The essential idea is to pass the users query to GroundX, allowing you to retrieve relevant information based on the users query. This can then be used to construct an “augmented prompt”, which typically consists of three key components:
By constructing a single prompt which contains these three pieces of information, most modern LLMs can accurately and reliably answer the users question, provided the retrieved information is accurate and easily interpretable (that’s why GroundX exists).
Naturally, the system prompt you choose to use is dependent on your application. When constructing system prompts, we’ve found that this one serves as a good foundation:
As described in the search.content endpoint, the recommended context to use in RAG is the result.search.text component of the response.
Once GroundX derived content has been acquired for your specific query, an augmented response might be created. Here’s an example of implementing an augmented prompt with OpenAI’s JSON-esque formatting:
Another common use case of GroundX is in conversational systems, in which RAG needs to be applied within a larger conversational continuum. When employing GroundX in such a use case, there is one major consideration: Is GroundX context preserved throughout the conversation, or is it only exposed to the model for the most recent user query?
Each of these approaches has the following costs and benefits:
Generally, we recommend only preserving the context for the most recent query, and then modifying this paradigm as needed throughout the development process. We’ve found that only using GroundX context on the most recent user query is economical and sufficiently performant for the vast majority of applications.
In our testing GroundX has exhibited remarkably consistent performance across a variety of types of questions. However, the main goal of GroundX is to answer a question based on a query by finding the most relevant information to that question. In other words, GroundX tries to find the most relevant specific information in your documents to answer your questions.
Some user queries are not compatible with this paradigm in a fundamental way. For instance:
GroundX often works well with the traditional RAG approach even with these types of questions, but depending on their complexity and the nature of the data, it can be useful to encapsulate GroundX as a tool within a greater agentic process.
The implementation of this type of system is, naturally, dependent on the type of agent you’re implementing and they framework you’re implementing the agent in. Generally speaking, tool defining in an agentic system consists of the following:
result.search.text.The difficulty and the power of developing agentic tooling is one in the same: they’re complicated, and the decision process and agent employs when deciding which tool to use at which point can be very subtle. How you describe GroundX, and how you describe your other tools, can drastically impact the queries which your agent chooses to send to GroundX.
We don’t recommend starting with this approach, as the complexity is often unwarranted, but it can be a compelling option for more complex use cases.