agent.pyproductivityLangchainv1.0.0
LangChain: Meeting Summarizer
Summarizes meeting transcripts into key points, decisions, and action items.
Setup time: ~10 min
Model: GPT-4o
Cost: ~$0.10/day
Last updated: Mar 16, 2026
Template
agent.py
# Install: pip install langchain langchain-openai
from langchain_openai import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.chains.summarize import load_summarize_chain
from langchain_core.documents import Document
import sys
import os
# --- Config ---
llm = ChatOpenAI(model="gpt-4o", temperature=0)
# --- Summarization prompt ---
map_prompt = ChatPromptTemplate.from_messages([
("system", "You are an expert meeting note-taker."),
("human", """Summarize this section of a meeting transcript. Extract:
- Key discussion points
- Decisions made
- Action items (who, what, when)
Transcript section:
{text}
Summary:"""),
])
combine_prompt = ChatPromptTemplate.from_messages([
("system", "You are an expert meeting note-taker."),
("human", """Combine these meeting summaries into a final structured summary.
Format:
## Meeting Summary
### Key Discussion Points
- ...
### Decisions Made
- ...
### Action Items
- [ ] @person: task (due date)
### Next Steps
- ...
Summaries to combine:
{text}
Final Summary:"""),
])
def summarize_meeting(transcript_path: str) -> str:
with open(transcript_path, "r") as f:
transcript = f.read()
splitter = RecursiveCharacterTextSplitter(chunk_size=3000, chunk_overlap=200)
docs = [Document(page_content=chunk) for chunk in splitter.split_text(transcript)]
chain = load_summarize_chain(
llm,
chain_type="map_reduce",
map_prompt=map_prompt,
combine_prompt=combine_prompt,
)
result = chain.invoke(docs)
return result["output_text"]
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python agent.py <transcript.txt>")
sys.exit(1)
summary = summarize_meeting(sys.argv[1])
print(summary)Setup
- 1
Copy the agent.py content above.
- 2
Create a Python virtual environment and install dependencies.
- 3
Set your OPENAI_API_KEY environment variable.
- 4
Run: python agent.py
Run with LangChain
This is a Python script using LangChain. Set up a virtual environment and install dependencies.
# 1. Create a virtual environment
python -m venv venv && source venv/bin/activate
# 2. Install dependencies
pip install langchain langchain-openai langchain-community chromadb
# 3. Set your API key
export OPENAI_API_KEY="sk-..."
# 4. Save the agent.py from above and run it
python agent.pyVersion History
v1.0.0Initial releaseMar 16, 2026
Framework
LangchainRequirements
Python 3.10+
OpenAI API key
Estimated cost
~$0.10/day
on GPT-4o model
File type
agent.py
Version
v1.0.0
Updated Mar 16, 2026
You might also like
SOUL.md
Email Triage Bot
Scan your inbox every morning. Flag what matters, summarize the rest.
~$0.30/day · ~5 min setup
SOUL.md
Daily Standup Reporter
Generate standup reports from git, calendar, and tasks. Post to your team channel.
~$0.15/day · ~5 min setup
HEARTBEAT.md
Calendar Prep
Brief you on upcoming meetings with context from email and docs.
~$0.25/day · ~5 min setup