Learn 🧠 All Concepts (20) 🤖 What is an LLM? 📚 RAG Explained ⚡ AI Agents 💻 Run AI Locally 🇮🇳 AI in India 📖 Learn Tracks 🔧 DevOps Track ⚙️ AI Ops Track 🗺️ AI Engineer Roadmap
Tools 🔧 AI Tools Directory 🔓 Open Source AI ⭐ Top GitHub Repos ✦ Claude Skill Repos 🚀 Ready-to-Deploy Projects
Build 🏗️ Build Hub 🎯 Master Prompts 🧩 RAG Agents 🚀 App Megaprompts
Workflows ⚡ All Workflows (22) 🎥 Text to Video 🎞️ Image to Video 🔊 Text to Speech ♻️ Automation
Resources 🧪 Colab Notebooks ⚙️ n8n Workflows 📈 Algo Trading 💰 Passive Income
🗂️ Browse All Topics About AItheGuru
← RAG agents
📞 RAG Agent · Sales

Sales Call Intelligence Agent

RAG over all your transcribed sales calls. Extract winning patterns, common objections, and competitor mentions.

Sales Advanced PostgreSQL on RenderRailway

Quick info

CategorySales
DifficultyAdvanced
Deploy onPostgreSQL on Render

Get the code

Includes install commands in comments

What it does

Whisper transcription pipeline
Cross-call pattern analysis
Objection extraction
Rep performance analysis
pgvector semantic search

Stack

PythonWhisperLangChainPostgreSQL + pgvector

Deploy on

✓ PostgreSQL on Render✓ Railway

Full source code

Install commands are in the top comments. Copy and run.

import whisper, os from langchain_openai import OpenAIEmbeddings, ChatOpenAI from langchain_community.vectorstores import PGVector from langchain.schema import Document from langchain.chains import RetrievalQA PG = os.getenv('PG_CONN') wm = whisper.load_model('base') def index_call(audio_file, meta): transcript = wm.transcribe(audio_file)['text'] words = transcript.split() chunks = [' '.join(words[i:i+300]) for i in range(0,len(words),280)] docs = [Document(page_content=c, metadata={**meta,'chunk':i}) for i,c in enumerate(chunks)] PGVector.from_documents(docs, OpenAIEmbeddings(), collection_name='sales_calls', connection_string=PG, pre_delete_collection=False) def query_calls(question): db = PGVector(collection_name='sales_calls', connection_string=PG, embedding_function=OpenAIEmbeddings()) result = RetrievalQA.from_chain_type( llm=ChatOpenAI(model='gpt-4o',temperature=0), retriever=db.as_retriever(search_kwargs={'k':6}), return_source_documents=True ).invoke({'query':question}) return {'answer':result['result'],'reps':list(set(d.metadata.get('rep_name') for d in result['source_documents']))} index_call('call.mp3',{'rep_name':'Rahul','outcome':'closed','deal_size':150000}) print(query_calls('What objections come up about pricing?'))