videodb
VideoDB Documentation
Pages
Director - Video Agent Framework

icon picker
How I Built a CRM-integrated Sales Assistant Agent in 1 Hour

Sales calls contain critical deal information, but manually reviewing and updating CRM records can be tedious. What if you could automate this entire process?
With VideoDB, you can upload sales call recordings, instantly generate accurate transcripts and much more without any significant added effort. By leveraging AI, we can take this further by automatically analysing transcripts and populating CRM systems like HubSpot with relevant deal information.
In this blog, I’ll walk you through how to build a Sales Assistant Agent in under 1 hour using VideoDB & Director, an open-source framework for building AI-powered video agents.

🎯 Game Plan for the Sales Assistant Agent

The process is straightforward:
Upload the meeting recording – The user uploads a sales call recording along with any relevant details.
Generate a Transcript – VideoDB processes the video and creates an accurate transcript.
Extract Key Insights – A structured sales summary is generated from the transcript.
Update HubSpot CRM – The extracted insights are automatically added to the with the help of Composio (an integration platform).
image.png

⭕️ Core Architecture

The Sales Assistant Agent is built on Director's extensible framework, leveraging its session management and state tracking capabilities while integrating seamless transcript analysis and CRM updates.

Tech Stack

VideoDB Director: An open-source framework to build AI video agents that can reason through complex video tasks & instantly stream the results.
Composio: An integration platform we will use to integrate HubSpot CRM function.

Key Components

Transcript Generator – Extract transcript from sales call recordings using VideoDB.
Insight Extractor – Analyses transcripts and extracts key sales insights.
HubSpot Integration – Automatically updates the HubSpot Deals table with structured insights using Composio.
Session Manager – Tracks progress and maintains state across operations.

⚒️ Base Setup

Step 1: VideoDB and Director Setup

Get your API key from . Install the latest SDK
Follow instructions mentioned at

Step 2: HubSpot Configuration

HubSpot is a CRM platform we’ll use to store the user data
Follow these steps:
Log into your HubSpot account (or )
Go to Settings → Integrations → Private Apps
Click "Create a private app"
Name your app (e.g., "Sales Assistant")
Under Scopes, select crm.objects.deals.write
This permission lets us create/update deal records
Create app and copy the API token

Step 3: Composio Configuration

Sign up or log in to and get the API key. Composio enables us to create deal entries in HubSpot.

Step 4: Environment Configuration

In the backend folder, update the .env file with the following credentials:

🔗 Setting up Composio Integration

To integrate Composio, we need a function that takes a task description and makes the appropriate API call to HubSpot.
In VideoDB Director, the existing tools/composio_tool.py file handles Composio interactions. You can modify this file to support the HUBSPOT_CREATE_CRM_OBJECT_WITH_PROPERTIES action.
Here’s what the function implementation looks like after the modifications:
import os
import json
from director.llm.openai import OpenAIChatModel
from enum import Enum

class ToolsType(str, Enum):
apps = "apps"
actions = "actions"

def composio_tool(task: str, auth_data: dict = None, tools_type:ToolsType=ToolsType.apps):
"""
Tool for making API calls to Composio actions.
Args:
task (str): Description of the task to perform
auth_data (dict): Authentication details for the target platform
tools_type (ToolsType): Type of Composio tools to use
"""
from composio_openai import ComposioToolSet
from openai import OpenAI

# Get OpenAI key
key = os.getenv("OPENAI_API_KEY")
base_url = "https://api.openai.com/v1"

if not key:
key = os.getenv("VIDEO_DB_API_KEY")
base_url = os.getenv("VIDEO_DB_BASE_URL", "https://api.videodb.io")

# Initialize OpenAI client
openai_client = OpenAI(api_key=key, base_url=base_url)

# Set up Composio toolset
toolset = ComposioToolSet(api_key=os.getenv("COMPOSIO_API_KEY"))

# Add authentication if provided
if auth_data and "name" in auth_data and "token" in auth_data:
toolset.add_auth(
app=auth_data["name"].upper(),
parameters=[
{
"name": "Authorization",
"in_": "header",
"value": f"Bearer {auth_data['token']}"
}
]
)

# Get appropriate tools based on type
if tools_type == ToolsType.apps:
tools = toolset.get_tools(apps=json.loads(os.getenv("COMPOSIO_APPS")))
elif tools_type == ToolsType.actions:
tools = toolset.get_tools(actions=json.loads(os.getenv("COMPOSIO_ACTIONS")))

# Make the API call
response = openai_client.chat.completions.create(
model=OpenAIChatModel.GPT4o,
tools=tools,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": task},
],
)

# Handle response
composio_response = toolset.handle_tool_calls(response=response)
if composio_response:
return composio_response
else:
return response.choices[0].message.content or ""

This is what the HubSpot integration flow looks like:
Our agent extracts deal information from video transcripts
This information needs to reach HubSpot's CRM
Composio acts as our middleware, providing the HUBSPOT_CREATE_CRM_OBJECT_WITH_PROPERTIES action
This action automatically formats and sends our data to HubSpot
Here is an example for it:
composio_prompt = f"""
Create a new deal in HubSpot with the following details:
---
dealname: Acme Corp Deal
dealstage: qualifiedtobuy
budget: $50,000 annual contract
---
Use the HUBSPOT_CREATE_CRM_OBJECT_WITH_PROPERTIES action.
"""

composio_response = composio_tool(
task=composio_prompt,
auth_data={
"name": "HUBSPOT", # Tells Composio we're sending the HubSpot auth token
"token": HUBSPOT_ACCESS_TOKEN # Uses our HubSpot token
},
tools_type=ToolsType.actions # Specifies we're using Composio actions
)

🤖 Building the Agent

1. Import required components

Create a sales_assistant.py file inside the /backend/director/agents folder and add all our imports to it. These imports give us access to:
Director's agent framework
Video processing capabilities
AI/LLM integration
CRM connectivity
Error handling and logging

2. Define the Agent Parameters

The following parameters will be needed for the agent:
Parameter
Type of parameter
Description
video_id
The unique ID of the video stored in VideoDB.
collection_id
The ID of the collection where the video is stored.
prompt
Additional instructions or context for generating the sales summary.
There are no rows in this table
💡 The collection_id parameter represents the ID of a VideoDB collection where the meeting video is stored. Each video gets a unique video_id, which is automatically generated when the user uploads a video. To learn more about collections, explore .
Create a JSON schema for these parameters.

3. Prepare a Deal Analysis prompt

With the help of LLM, you can extract all the necessary information from the transcript which you may require to populate the CRM tables. The prompt can look something like this:

4. Implement Agent Class

This is a fundamental step while creating an agent. The parameters set here ( self.agent_name, self.description and the self.parameters) determine the way this agent interacts with the reasoning engine and works within the Director framework.

5. Implement the core logic

1. Declare a run method.
We will need to implement a run method in the agent’s class. This is the heart of the agent as this is the method that runs when the agent is called.
In the run method, define the required parameters which will be used to implement the agent.
2. Check for Hubspot Access Token
First, we need to validate HubSpot access and set up progress tracking:
💡 To communicate the steps that the agent is taking, we can use the
self.output_message.actions and the self.output_message.push_update methods to send the updates to the client. This allows us to communicate with the user about what the agent is achieving at a particular time.
3. Get the Video Transcript:
Now, let’s retrieve the transcript from the video. If the transcript is not present, we will trigger the indexing process to get the transcript.
4. Generate Deal Summary
Next, process the transcript using LLM to extract structured information:

5. Use Composio to update HubSpot CRM
Now, let’s make a Composio tool call with the generated deal summary.
6. Send the final message
Let’s prepare the final message from the generated composio_response.
7. Send the Final Success AgentResponse
Now that the agent is implemented, return the final success AgentResponse.
8. Error handling
Ensure robust error handling to manage failures gracefully.

6. Register the agent

To use the agent, add the agent in the self.agents list in the ChatHandler.
Go inside the backend/director/handler.py and import the agent.
And that’s it! That’s how simple it is to integrate Composio and generate deal summaries with an LLM-powered Sales Assistant. Now, you can try this out with the Director locally, refine the workflow, and automate your sales process like never before. Give it a go and see how much time you can save! 🚀

🚀 Using the agent

Visit the frontend at and refresh the page to see the agent available in the options for use.

💡 Conclusion

The Sales Assistant Agent showcases how the Director’s agent framework can streamline sales processes by integrating LLMs, Composio, and CRM tools like Salesforce and HubSpot. With automated transcription, intelligent deal summaries, and seamless CRM updates, this agent enhances efficiency and reduces manual work.
Key Takeaways:
Effortless agent creation with Director's intuitive framework and pre-built tools
Effortless transcript extraction using VideoDB
Seamless communication with Composio and CRM platforms
Robust error handling for reliable performance
Building an agent in VideoDB Director is fast and flexible, allowing you to create powerful, tailored solutions with minimal effort. What will you build next? 🚀

🔮 Further Exploration

Now that we've built this agent, there are many ways to enhance and extend its functionality, making it even more dynamic and useful.
Highlight Reels for Executive Reviews: Beyond just summarising text, you can leverage VideoDB and generate highlight reels from video content, providing quick, impactful insights for executive reviews or presentations.
Automated Client Communications: With Composio's email integration, you can set up automation to send summaries or action points from meetings directly to clients, ensuring efficient communication and follow-ups.
Video Analysis for Deeper Insights: Incorporate video analysis tools to assess emotions, tone, and unease in speaker interactions. This could provide valuable data on the engagement or sentiment of the meeting, allowing you to act on those insights for improved decision-making.
Integration with Meeting Apps: Integrate the system with meeting platforms like Google Meet or Zoom. By doing this, the agent could automatically trigger after the meeting ends, processing the content without manual intervention, and generating summaries or other outputs based on the recorded meeting.

📖 Resources

Ready to build your own AI agents? Join our and start exploring what's possible with Director! We encourage you to experiment with the framework and contribute to its growing ecosystem.
Share your creations and insights with the community, and help shape the future of AI-powered video creation.
📚 - Comprehensive guides and API references
💡 - Real-world examples and implementations
💬 - Connect with other agent developers
Need help? Reach out to our community or open an issue on . Happy building! 🚀

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.