Labs

How to Enhance Salesforce Agentforce with Heroku & GRAX

You must consent to Statistics cookies to watch this video.

Unlocking the Full Power of Salesforce Agentforce with Your Data

Salesforce’s introduction of Agentforce marks an exciting development in how businesses can leverage artificial intelligence to better manage customer relationships. These AI agents can now handle complex tasks that previously required human intervention, from qualifying potential customers to answering support questions. But what if you could make the agent’s capabilities even more powerful?

With GRAX, you retain a secure copy of your data that’s available to rollback to when needed. Your Salesforce data is securely stored in your cloud infrastructure and that ensures your data is compliant with data retention policies, audit requirements, and industry-related regulations. This empowers you to reuse your data for AI, analytics, and other applications freely knowing that you have the ability to roll back to a secure backed up copy if ever needed. 

Source: Salesforce

Why Enhance Agentforce with GRAX and Heroku?

For organizations already using GRAX, there’s an opportunity to significantly enhance what Agentforce can do. Agentforce gains access to a treasure trove of queryable data beyond what’s available in Salesforce. Heroku provides the compute power needed to process all that data in near real-time and deploy custom AI models. This powerful combination ensures you’re making decisions based on all of your information, rather than based on a single snapshot. 

By connecting Agentforce to your GRAX Data Lake through Heroku (Salesforce’s cloud platform), you can:

– Get deeper insights from your data – current and historical – using advanced AI models

– See exactly how the AI makes its decisions

– Create custom solutions tailored to your business needs

Without GRAX and Heroku, Agentforce can only provide surface-level insights and recommendations. When you leverage this combination, your AI becomes smarter and better aligned with your business goals—a real advantage.

Source: Pexels

How to Power Up Agentforce with GRAX and Heroku

Have you ever asked AI a question, only to have it return a totally unexpected answer or even no answer? This type of thing can happen for many reasons: limitations in the model, a poorly crafted prompt, or a random hallucination. That’s why it’s imperative to give access to the best quality dataset, ensure there’s enough processing power, and have a full audit trail. 

By leveraging GRAX’s data lake and Heroku’s compute capabilities, organizations can augment their Agentforce actions with their salesforce data at any level of scale – from in house experiments to internet level workloads.

Let’s explore how you can achieve this with our step-by-step guide below. 

Step 1: Secure and Replicate Your Salesforce Data

Before you can generate meaningful responses and insights from your data, it needs complete access to comprehensive and reliable data beyond a single snapshot. GRAX ensures that every version of your Salesforce data is securely captured, replicated, and 100% accessible for downstream consumption—AI, analytics, dashboards, etc. 

When you’re armed with all of your historical snapshots:

  • Agentforce becomes smarter because of the large data volume it’s able to leverage.
  • All historical context and data trails are preserved by GRAX, even when it’s been deleted or modified in Salesforce production.
  • Tracking changes, identifying patterns, and improving predictions are all in the realm of reality.

When you use GRAX, you’re not just protecting your data, you’re protecting its full value.

Secure and replicate your Salesforce data now

Try now

Step 2: Connect GRAX Data Lake to Heroku

Now that your data is securely backed up, you can consume that dataset without fear. This is made possible by the GRAX Data Lake, as it serves as the central repository of your Salesforce history and is stored separately from your backed up copy. 

Next, you’ll want to leverage Heroku to host the Agentforce action and consume the data lake via an Athena client.

We made setting up GRAX on Heroku quite easy and quick: check out our full how-to guide here.

Step 3: Build Custom Agentforce Actions with GRAX and Heroku

With your data in GRAX, you can combine GRAX’s Data Lake with Heroku’s compute platform to interact with your Salesforce data and only be limited by your ability to create—or have agents create—applications that interact with that data, including building or hosting your company’s internal agents.

We built an Agentforce Action, hosted on Heroku, pointed to our own internal GRAX Data Lake so that we could observe how the agent worked and explore differences in answers with and without GRAX. We wrapped up the GRAX Data Lake as a tool and instrumented the agent to store its tool calls, thoughts, and decisions. It also required some help with prompt engineering. Once we completed that, we found it to deliver what we expected from AI!

Source: Pexels

A Real-World Example: Lead Analysis

Let’s look at a real-world example of how integrating GRAX Data Lake and Heroku dramatically improves lead analysis with Agentforce.

Standard vs. Enhanced Agentforce Responses

Imagine a sales manager asks Agentforce: “Who are my top leads?”. Your expectation in response would be a list of highly ranked leads with a high probability to convert. But the standard response from Agentforce might simply be: “There are no specific top leads found in the system.” Well, that response certainly didn’t meet your expectations or even really help. 

Agentforce Standard Response Without GRAX and Heroku
Agentforce Standard Response Without GRAX and Heroku

Without greater context, Agentforce is limited to basic, surface-level responses or even no response. However, with GRAX Data Lake and Heroku, Agentforce gains access to a rich data set of customer interactions and conversion history—resulting in an enhanced response with actionable insights. 

Agentforce Enhanced Response With GRAX and Heroku
Agentforce Enhanced Response With GRAX and Heroku

We found the frontier models (such as Claude and OpenAI) were able to provide these outcomes:

  • Detailed revenue information for each lead
  • Conversion history and success rates
  • Strategic recommendations based on past patterns
  • Clear explanation of why certain leads are considered “top” prospects
Query: “Who are my top leads?”Standard Agentforce ResponseEnhanced Agentforce Response with GRAX & Heroku
Agentforce Response“It looks like there are no specific top leads found in the system. The query returned the most recently created leads, but no specific results were identified. How else can I assist you?”“Here are insights about your top leads based on data from our system… These leads are considered top based on their “Warm” rating and high annual revenue (where available). It’s important to note that all these leads have already been converted which suggest they were indeed high-quality leads. For future lead prioritization, we should focus on leads with similar characteristics: from large companies, holding senior positions, and preferable with known high annual revenues:
Datasets ConsideredCurrent snapshot of Salesforce dataAll snapshots from the GRAX Data Lake
Response TransparencyNo explanation or justification of responseJustified rankings with data-driven insights for future-proofing
AI Decision QualityOnly able to identify recently created leads but unable to rank by lead qualityUtilizes lead rating, annual revenue, company size, and past conversion history
Business ImpactNoneMore accurate lead targeting and higher conversion rates

If you are looking to drive real results and business impact, it’s clear that a rich, quality data source and data processing power is required. Otherwise, you could be left behind the competition due to data gaps.

Enhance Your Agentforce Responses with GRAX + Heroku

Watch now

Key Benefits of This Integration

As you can see, integrating GRAX and Heroku with Agentforce, unlocks enhanced responses that deliver on the AI-promise compared to the standard response. Let’s dive into some of the key benefits of this integration.

Deeper AI Insights

By connecting Agentforce to your GRAX Data Lake, you gain the ability to analyze patterns across your historical data in ways that weren’t possible before. This allows you to combine information from multiple sources, giving you a more complete picture of your business. Instead of simple answers, you can receive detailed, tailored responses that take into account the full scope of your organization’s data.

Complete AI Transparency

One of the most significant advantages of this integration is the ability to see exactly how the AI reaches its conclusions. You can review the complete decision-making process, from initial data analysis to final recommendations. This transparency helps retain control and build trust in automated decisions across your organization, as team members can verify and understand the reasoning behind each AI-generated insight.

This provides the foundation for human in the loop interactions—having the agent know when to pause, wait for human review, and resume operation.

Source: Pexels

Custom AI Actions

Every business has unique needs, and this integration allows you to create specialized tools that address your specific challenges. You can choose from multiple AI models to handle different tasks, selecting the best tool for each job while maintaining your familiar Salesforce interface. This flexibility ensures that you can adapt the system to your business processes rather than the other way around. 

Data Security and Compliance

With GRAX, you retain a secure copy of your data that’s available to rollback to when needed. Your Salesforce data is securely stored in your cloud infrastructure and that ensures your data is compliant with data retention policies, audit requirements, and industry-related regulations. This empowers you to reuse your data for AI, analytics, and other applications freely knowing that you have the ability to roll back to a secure backed up copy if ever needed.

See GRAX + Heroku in Action

Watch now

Looking to the Future of AI with GRAX and Heroku

AI is rapidly reshaping the way businesses analyze their CRM data, automate processes, and interact with their customers. To stay competitive, Salesforce users need more than just Agentforce, they need to ensure that the data that feeds it is comprehensive enough to get smarter insights. 

By combining GRAX’s secure data management and Heroku’s compute power with advanced AI capabilities:

1. You protect your existing Salesforce investment while adding new capabilities

2. Your team keeps their familiar interface while gaining powerful new tools

3. You maintain control and visibility over AI decisions

4. Your business can adapt and scale AI usage as needed

As organizations continue to explore AI capabilities in their CRM systems, the combination of Salesforce data, modern AI, and cloud computing creates powerful new possibilities. By bringing together GRAX’s Data Lake capabilities with advanced AI models and Heroku’s flexible platform, businesses can build solutions that are more powerful than standard response AI tools, completely transparent in their decision-making, customized to specific business needs, and build on existing Salesforce investments.

Get in touch with a product expert

Get started

Video Transcript

Hi. This is Chris from GRAX. Today, we’re gonna take a look at building a custom Agentforce action with Heroku that can answer questions about your Salesforce data stored in GRAX’s data lake. This video is for people familiar with the Heroku and Salesforce ecosystem and have probably heard about Agentforce by now.

As part of its backup and archive solution, GRAX maintains a full mirror of your Salesforce data, including the history. So we’re gonna show you how quickly you can bring intelligence to that data when it’s warehoused in the GRAX data lake. We’re building off work that the Heroku team did with connecting Agentforce to custom actions running on Heroku.

Our custom action is technically an agent itself.

It takes natural language queries from Agentforce and constructs SQL queries against the GRAX’s data lake summarizing the results. This is a Python application that you can one click deploy to Heroku.

It uses an open source framework called langchain for the agent.

I like Claude, as a reasoning model. This can easily be replaced with an OpenAI model, DeepSeek, something else. The GRAX Data Lake has been wrapped as a tool, and all you do is give it a URL, which you can actually get from attaching the add on if you are going the add on route or from the platform copy and paste into the Heroku Env. And then we protected this with Google OAuth because our Salesforce data does have information about our leads and opportunities.

Wiring up this app to Salesforce, there’s a lot of steps and they’re well documented by Heroku, and so we can refer you to that.

To make the agent a little bit custom, and for this particular example, we will show you just the prompts we added and then get going. So this is our Einstein Copilot, and as you can see here, we let it know it is able to query the GRAX Data Lake with natural language, and I also added an extra instruction here when you’re asked to query the data lake, send the natural language question. This is actually because on the first version of this, Einstein would send over what it thought the SQL should be. Claude turned out to just be able to do a much better job with writing the SQL, as you’ll see, part of that is because when you do an agent interaction, the LLM is able to review its results and account for errors. So here’s just a very quick example of Ask GRAX “how many emails were sent per day last week?” and then it actually shows, broken down per day. It also notes that there’s a data inconsistency.

And so this, as you can see Ask GRAX, “how many leads were opened last week?”

And so we’ll let that bake right now, and so what you can see over here is our sort of backend for this. Let me send a Google login.

Come in here and you can see for the most recent time how many emails were sent per day over the last week. And you can see the response we got from the LLM. You can also see every thought it takes, every tool call it makes to the database, and you can see it actually winds up correcting errors as it works through the problem, figuring out which tables to query. And some of this is good information for us to feedback into the next version of this where we might want to let it know ahead of time what the queries are. For this version, we’ve told it to make sure it lists tables to get appropriate table names.

You know, agents are very not perfect, and for us, this gave us a feedback loop to be able to see what it’s doing and understand the steps that it’s taking.

Some places where we were actually sort of impressed is that this is, something we gave it in a prompt, for a single table, and it has generalized how to construct a view on live objects from an underlying historical table. And so this is some of the prompt engineering work that we think is going to come along with a lot of at least the next year or two of agents.

And so I can improve the navigation in this app right now. You can see here, just different questions we’ve been asking, our Salesforce data and, you know, learning how intelligence works. So here we go. We got an answer to our question here. Recorded data from the data lake. Eight new leads were opened last week, and it does a great job of letting us know, exactly, even in the response how I came to that conclusion, and then we can see here the SQL queries it ran, and once again fixing its queries. So there might be some work for us to do to get it, you know, give it some examples, and write better queries, but we’re actually really impressed with all that it’s able to do, when given the sort of right you know, this is what makes agents special is that it actually has this sort of loop.

More powerful than a loop is, of course, a computational graph, which is why LangGraph is the successor to this library and what we’re going to be exploring in future, examples.

But for right now, you can get a lot of bang for your buck by just really allowing Claude to query and reason against your GRAX Data Lake. And, of course, by Claude, I mean any frontier LLM model. Also kind of cool that you can swap between them, when you’re using an open source framework like LangChain.

That’s it for now. Stay tuned on more ways that you can bring intelligence to your GRAX and Salesforce data with the GRAX Data Lake.

See all
GRAX

Join the best
with GRAX Enterprise.

Be among the smartest companies in the world.