@Chris Krecicki, welcome to the team. Just got back from PTO.
were heading to big bear area this weekend and to laguna for a day
lol, oh. Staycation at my lady friends land and my lake house. House in order type of vacation with kids visiting their mom
@Chris Krecicki, when you get online, please send me a screenshot of the transcrirpt AI and send me some of the cool features, just need three...like what tech, what it does, how it helps.
call-transcription
Call recordings are found at https://shieldlegal.dev/reporting/five9/recordings?page=1 Script transcribes with assembly.ai, time stamps, labels and exports as a json file with conversation pieces broken up into objects. Call Transcription Chat System
A Flask-based web application that allows users to upload call transcriptions and interact with them through an AI-powered chat interface. The system uses OpenAI's GPT models to analyze transcriptions and answer questions about call content, making it ideal for quality assurance, call analysis, and information extraction. Project Overview
Call recordings are sourced from ShieldLegal Five9 Recordings Portal. The system transcribes audio using AssemblyAI with timestamps and speaker labels, then exports structured JSON files with conversation pieces broken into manageable objects for analysis. Features
β’ Audio Transcription: Convert audio files to text using AssemblyAI with speaker identification β’ Interactive Chat: Ask questions about call content through a web-based chat interface β’ Speaker Analysis: Automatic speaker detection and labeling β’ Conversation Context: AI maintains context about the loaded transcription β’ Chat History: Persistent chat history during session β’ Real-time Processing: Upload transcriptions and start chatting immediately Technology Stack
β’ Backend: Flask (Python) β’ AI/NLP: OpenAI GPT-4 β’ Transcription: AssemblyAI β’ Frontend: HTML/CSS/JavaScript β’ Data Format: JSON Prerequisites
β’ Python 3.7+ β’ OpenAI API key β’ AssemblyAI API key Installation
.env file in the root directory:Step 1: Transcribe Audio Files
audio/ directoryaudio_file path in assembly-ai-transcribe.pyThis generates a transcription.json file with speaker-labeled text and timestamps
Step 2: Start the Chat Application
Run the Flask application:
Open your browser and navigate to <http://localhost:5000>
Step 3: Load and Chat
Upload your transcription.json file through the web interface
POST /api/load_transcription_data
Load transcription data from uploaded JSON file.
Request Body:
{
"transcription_data": { ... },
"filename": "optional_filename.json"
}
Response:
{
"success": true,
"metadata": {
"participant_count": 2,
"total_utterances": 45
},
"audio_file": "path/to/audio.mp3"
}
POST /api/chat
Send a message and get AI response about the loaded transcription.
Request Body:
{
"message": "What was discussed about pricing?"
}
Response:
{
"response": "Based on the call transcription...",
"message_id": "msg_123"
}
GET /api/chat_history
Retrieve current chat history and transcription status.
GET /api/clear_chat
Clear the current chat history. File Structure
call-transcription-chat/
βββ app.py # Main Flask application
βββ assembly-ai-transcribe.py # Audio transcription script
βββ .env # Environment variables
βββ requirements.txt # Python dependencies
βββ transcriptions/ # Stored transcription files
βββ audio/ # Audio files for transcription
βββ templates/ # HTML templates
β βββ chat.html # Chat interface
βββ static/ # CSS/JS assets
Transcription Data Format
The system expects JSON files with the following structure:
{
"audio_file": "path/to/audio.mp3",
"transcription": "Full text of the conversation...",
"status": "completed",
"id": "transcription_id",
"utterances": [
{
"speaker": "A",
"text": "Hello, how can I help you?",
"start_time": 1000,
"end_time": 3000,
"confidence": 0.95
}
],
"words": [
{
"text": "Hello",
"start_time": 1000,
"end_time": 1500,
"confidence": 0.98,
"speaker": "A"
}
]
}
Configuration Options
Environment variables you can customize:
β’ TRANSCRIPTION_FOLDER: Directory to store transcription files (default: "transcriptions")
β’ MAX_CHAT_HISTORY: Maximum number of chat messages to keep in memory (default: 20)
β’ SECRET_KEY: Flask session secret key (required for production)
Common Use Cases
Quality Assurance
β’ "Were there any compliance issues in this call?" β’ "How was the customer's tone throughout the conversation?" β’ "Did the agent follow the proper script?" Information Extraction
β’ "What was the customer's main concern?" β’ "What solutions were offered?" β’ "Were there any follow-up actions mentioned?" Call Analysis
β’ "How long did each speaker talk?" β’ "What was the overall sentiment of the call?" β’ "Were there any moments of confusion or frustration?" Troubleshooting
Common Issues
.env file contains valid API keys
β¦ Check that the .env file is in the root directoryassembly-ai-transcribe.py
β¦ Ensure the audio file is in a supported format (MP3, WAV, etc.)
β¦ Check your AssemblyAI account creditsRun the application in debug mode for detailed error messages:
FLASK_DEBUG=1 python app.py
Contributing
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)β’ Never commit API keys to version control β’ Use environment variables for all sensitive configuration β’ Consider implementing rate limiting for production use β’ Add input validation and sanitization for user messages License
This project is licensed under the MIT License - see the LICENSE file for details. Support
For questions or issues: β’ Check the troubleshooting section above β’ Review the Flask and OpenAI documentation β’ Open an issue in the GitHub repository
It's also a Sanic application now. It was built in flask and I migrated it to sanic which is what were using as our internal tools site for employees to use the tools
any really specific search terms that will turn up court cases other than these : queries = [ "sexual assault lawsuit filed", "abuse allegations institution", "sexual misconduct settlement", "child abuse charges filed"
using Ollama locally and using llama3.1:8b
So you can see the progress, I need to do testing but this is the Github repo https://github.com/shield-legal/new-tort-opportunities
sure, give me until monday to get somethign working
im cleaning 90,000+ records and enriching the contact address data table with an agent I made -- using 40% of system resources
so if cam is interested, we have agents cleaning data
@Chris Krecicki , Iβll get them from Cam
Cams got to be so busy he doesnt have time to talk but if he has some specific ideas on this tort opportunity scanner let him know he can shoot me a message here anytime. I know some C-suite dont like to work down line but I am always open -- give me about a week or two so I can give him something good. And to get it live on GCP.
Cams got to be so busy he doesnt have time to talk but if he has some specific ideas on this tort opportunity scanner let him know he can shoot me a message here anytime. I know some C-suite dont like to work down line but I am always open -- give me about a week or two so I can give him something good. And to get it live on GCP.
Iβm gonna tell him about it, but he is also usually on the go with expanding offices of key accounts. Think of it as a media strategy mass tort prediction, tool, the word marketing is important because this tool will really be shown off to customers but used by Cameron and maybe a few select others. Really an AI tool.
But we could have James Scott integrate it into our Tortelligence to be the Abuse section. One toolset UX
Also you guys will have county data here soon and full data for your contact address table (assuming we had some address data for the lead to being with). This AI agent is killing it. I am using a local model too to save company on API costs, it cost zero dollars the way I have the local LLM server running.
Parsing messy address data (the bane of every database) Standardizing formats consistently Filling in missing information like counties and states Handling edge cases like PO boxes and unit numbers Built-in validation and error handling
starting on cams tort identifier today .. give me a week or two to really give him something good
Ok. Still need KWs? Ask him, heβs pretty specific.
nah when I get around to it, im sorting out DB schemas and stuff right now, was goign to use lancedb for vector db but were going with postgres because we arleady use it
Justice Department vs Southwest Key - Federal lawsuit for child sexual abuse in shelters Ohio State University abuse scandal - Major institutional abuse case LDS Church Sex Abuse Settlements - Large class-action settlements EEOC settlements - Government enforcement actions
A lot of these are dated. However, that is being fixed. I just wanted to pass along the scraped data. There is not a control panel yet. I am working on the script to pull more relevant things.
I setup a script to do more recent stuff and here is the text report
CAMPAIGN REPORT:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Give me some feedback on what I am pulling -- this is the basic foundation, I'll pull thigns into a control panel and do more AI stuff but here is the beginnings
Ok, newer the crime the better. They look for doctors, private schools, prisons, religious institutions, etc. where many people are vitctims.
we will iterate over this as i go so we can give cam a badass tool
im doing some research on exacty how this business works, torts .. it'll help me build this -- check this out its one of the first tort cases https://opencasebook.org/casebooks/10459-torts-the-mostly-common-law-of-civil-wrongs-[β¦]hulle-v-orynge-the-case-of-the-thorns-from-witt-tani-6th-ed/
from that 1466 case I came up with some logic rules for IDing these ```# new-tort-opportunities
Monitors news sources for sexual abuse/assault cases to identify potential mass tort opportunities.
A case with 12 victims but strong causation, high foreseeability, and clear institutional duty will now score higher than a case with 200 victims but weak tort elements. This prioritizes cases that will actually succeed in court. We want to know early too. This will solve that.
When a man acts he is bound to do it in such a manner that by his act neither prejudice nor damage is done to others." This establishes a duty of care in one's actions.
If a man acts whereby injury and damage are done to another person against his will, even though the act is lawful, nonetheless he shall be punished if he could by some means have avoided the damage.
1) Causation Through Human Action: The damage must result from the defendant's voluntary act, not natural forces. Justice Choke distinguishes between thorns falling due to the defendant's cutting (tortious) versus thorns falling by wind (not tortious). 2) Foreseeability and Control: The actor has a duty to conduct activities in a way that avoids foreseeable harm to others. Justice Littleton emphasizes that one must "make amends" regardless of intent when their actions cause damage. 3) Damage to Another: There must be actual harm or injury to the plaintiff's interests (here, the trespass onto plaintiff's land).
1) Rule 1 Ask: "Did the defendant's voluntary action cause damage to another person?" If yes, there is presumptive tort liability unless an exception applies.
2) Rule 2: Confirm all three elements are present:
3) Rule 3: Apply this logical sequence:
4) Rule 4: These are NOT valid defenses: Rejected Defenses (Do Not Accept These):
5) Rule 5: When analyzing scenarios, ask:
6) Structure findings as (output format):
lol lots of research .. tomorrow ill run what I have been making and send you the output -- once we like it ill make a GUI dashboard
if youre curious about the code so far, its commented well
@Chris Krecicki, this is very thoughtful, you may select all stories, note if your stories are rewrites of the same incident to count "story volume" and look at published dates frequency for a "Velocity" metric on "how many X stories on this adverse event, over Y time insight". Then you have a heuristic that has value. Then you can have the above recommendation and analysis summary to give the attorney information, removing liability from this beyond a "Analysis Summary Recommendation".
Make sense?
yes it does, i am saving everything to a DB too so I can add this in to track velocity to see whats gaining momentum
im actually going to make this modular because this will only need things already in the database
im helping the boys with some big data stuff .. projects coming along. lots of cool stuff. i will give a update on monday. Once we like the data outputs I'll make a GUI/dashboard for Cameron before I show him what I am working on π
lol you know it thanks for the awesome job
Would like some feedback ... this is the summary of these two raw logs. High-Priority Cases (Verified from Article Data)
These are actual case types we do have except a few, so it seems like you are finding them
cool, OK, let me continue, let me know if you or cam have any more feedback ... im getting the foundaiton down before I start putting things in the database so I can make a GUI/control panel for cam, or deciding how to serve this to the end user better.
Ask Mark Maniora to send you a list of all abuse verticals we have in Leadspedia. Youβll see our history of cases or cases attempted.
got that from mark, ill work it into the scanner to reject anything already in that list
take a look here at the database columns and data -- ill be using this to make a GUI/dash board here soon -- the plan is this will run the scraper every few days or everyday (well sort it out)
if you take a look in here you can see how I am doing a point system
lol this is so cool so far check it out
I will have the AI legal analyst & scraper running on another server. I'll have it run every few days. We'll be setting that up on a new docker container and this will run from the sheildlegal.dev site once it is live.
@Chris Krecicki , good morning. Cameron inquired about the status of this new tool, what are you thinking is a good day this week to give them a preview?
whenever he'd like to get together, it's still on my computer so I'll walk over and show him and get some feedback
whenever he'd like to get together, it's still on my computer so I'll walk over and show him and get some feedback
@Chris Krecicki , tell him weβll setup time for tomorrow to show it off.
ill wait till he gets back to me on that last msg i sent him
excited to get some feedback -- i updated the readme to explain more whats going on
Do we have a cool nickname for this product yet? Lol.
We can call it Predator: Premium Real-time Emergency Detection And Tort Opportunity Recognition "It hunts down institutional predators and their enablers"
showed him the video and the read me
He pinged me and said looks slick.
i told him i will do my best to get it live for him by end of week
have to wait for dustin to get a free minute -- i need a new container, db schema merge and some small things on that side
@Chris Krecicki , let Dustin know Camβs pushing for release, let me know if he needs a nudge
i just pushed the pull request to them on github
Nick is back so I will make sure it happens
Nice. OK. I will be in touch. Thanks Ryan.
i got two meeting requests from you -- the one for 1pm today is gone, the one for next Tuesday is still in my calendar, are we meeting today? also -- I asked Nick to get the container up for the backend and my table into production postgres. I will let you know. Come Friday, if it isn't live still. I can screenshare and go over everything: the limitations, the approach, caveats, and features. I'll show you guys the backend and front end. The keyword queries are really what is going to make this shine, in our meeting Friday I hope I can get some feedback on what you see.
Also, Cameron wanted to let outsiders use it, that could be an issue because our company tools shieldlegal.dev uses our company email addresses to handle roles, login and permissions. So we will see what we can do come time.
We can talk tomorrow in the AI projects meeting about that, we could put it into Tortelligence.AI app as the "Abuse" menu/tab.
Cool we'll talk about it then. I am running the mass surveillance pipeline for legal to make sure all the new employees are following compliance. I will be back in a bit when it finishes.
working with james on setting up sanic and local docker etc. working on getting this all integrated
i talked to Cameron he said he was sorry he missed the meeting is in paris with family and working too
awesome, on tomorrow's call I want to see all the tools you built so far, to ensure the younger DA's do not waste their time if they have use cases
but we should be on for friday, i saw your emails
yeah get excited, i have worked really hard on these and dealing with legal, call center people, intake people
ive been busy around the office with all the leads
i figure if I can make cam money it'll be through cutting times down on things they already do
like legal not having to listen to and find over 600 call files and listen to them
or intake not having to listen to 20-50 minute phone calls and can just chat about it
sorted out all the test email non-sense for dicello and they got that integrated
all these things would have taken a team months to make π
ahh yeah that's exactly what I have found myself a good use case for -- creating efficiency
this is a great group in here, everyone gets along and works well together ... ive heard the issues outside the room but its a really good group in here
Yes, we will address the clash of call center versus advanced analytical development soon. Predicted and aware.
exciting stuff lets make Cam some $$$$
i was working on UI for tort site, adding smart grouping etc.
Im going to start working on something Dustin needs with filling in questions with an LLM
Lets meet in our weekly tomorrow, slammed with a few guys out on PTO today
β€οΈ chat tomorrow
i am going to get together with james sometime this week so I can spin up a cloud docker container and we can merge our projects and get it running
if not this week, shooting for next week
lol cleaning up this tort tool with smart clusters and some other things -- getting dicello to run new campaigns is going to be a hit with this thing
Perfect, it will probably get agentic eventually
that's essentially what's going on in the background, thats how I get all that info for the detail panels. are you in town yet?
that's essentially what's going on in the background, thats how I get all that info for the detail panels. are you in town yet?
Do we have a Facebook developer account? I want to setup a way to pull ads on FB running at different tort companies pages.
Hmmm. That is a good question but Dacebook has an ad search.
See what competitors are doing and pull data from the facebook ads library
kind of like your media analyzer but for fb ads library -- see where the compeition is outside of search so we can decide if something is too "burdened" already by the compeition --- keep ad spend lower etc
We use a third party business manager and I would have to reach out to him on telegram but they did t give free wheel access last time.
We do have our own interval BMs and you could start there.
i just need to setup an app on FB and get a API key so I can pull data because they require a access token
did some awesome updates youll see soon
I need expert level help on some SL operational data that has to fit into our Looker Enterprise existing Dashboard underlying table that is a simple but complex lookup and pivot of data. Itβs not going to be hard and I can show your our data warehouse and that will tie into putting an LLM on it later. I will talk to Joe and confirm if you can help.
Yeah as long as we have clear directions, I'll do my best to whip something up. I am not familiar with Looker but I can write queries.
We'll figure it out. I am capable of anything. And if I am not. I'll put my tail between my legs and admit i have no idea and then I'll learn
my meeting vanished from my calendar
I mentioned pushing it in our AI channel for James. See there.
ah OK -- I did a ton of updates too you'll love it
If you do talk to James before I do tell him to get my his repo link and add me as a user or just zip it up and send it here so I can integrate it and come back with whatever else I need to merge it. I have Dustin/Tyson working on the DB migration from my test DB. Same goes for his Zillis info for logins etc so I can set it up on google secrets.
@Chris Krecicki lost that in #C092PBPCAGN please!
James gave me some updated files. Having to do a lot of work to integrate it. Maybe we should push the BI chat bot thing till tomorrow?
ill have this to show cam in the morning 100% for sure
Everything is working and looks good for our meeting tomorrow. Just finished up. Thanks for introducing me to Cameron. I like him a lot.
Boss. Man I love you guys haha amazing c-suite team so awesome
username: analytics@shield-legal.com pwd: ArSHkUDh6nbpu7u
You are on that email as a Member, it's a Google user email group.
@Ryan i was trying to login to google with analytics@shield-legal.com and it is saying Couldnβt find your Google Account -- and I need to get a code they emailed me to login to the email to get some login code
don't use Google, just sign in with that as UN and PW
i mean i tried login in to google to get the verification code
@Chris Krecicki, I added you to the analytics@shield-legal.com, check your inbox or resend. I did not see it.
Ah didnt realize you meant you were forwarding it sorry ryan lol
Ah didnt realize you meant you were forwarding it sorry ryan lol
@Ryan they want some sort of ID verifcation before we can use that mastercard https://in.sumsub.com/websdk/p/3kNC8XoT8bNz8865?from=linkMobile
these guys are supposed to be the real deal
I'm lost, that is expired and not sure how tha tis related to smartproxy.orgt
@Ryan they want identity verification before they'll let us use that mastercard
Have to go here https://www.smartproxy.org/user/my-account/settings/ and click Identity Verification
hell yeah -- also me and CC have been working on things -- we scraped 1300 cases last night, shes going to review them and we're going to whittle this down and refine the scraper further. After our open air meeting with Alex, CC and some of the other VSS team, we decided we needed a Defendants Tab that clusters defendants and their articles related to them, even older ones. The idea is when CC is writing on these proposals to the law firms for Andy to get money, they want some proof it will work out. And if the defendant has history and and bunch of related articles, that makes it look super attractive. $$$$$$$
Dustin should have this pushed live by Monday
money money money -- going to be a dream team CC and I. Great intro
i can start focusing on money related stuff with her
@Ryan we have this meeting today for Predator but Tyson is still getting it live on prodctuon.
We have another project for Call Center that will be super helpful.
It would make a lot more since to just type the leadid in somewhere and pull the Q&A. This report is going to be obnoxiously large. Check the last mail I sent, I revised the code after James and I just talked. I recommend us make this just pull a report for a specific leadid. Check the email for the numbers.
It would make a lot more since to just type the leadid in somewhere and pull the Q&A. This report is going to be obnoxiously large. Check the last mail I sent, I revised the code after James and I just talked. I recommend us make this just pull a report for a specific leadid. Check the email for the numbers.
we should catch up on this QA project
Talking to Dustin, someone named Sunnie has all of the qualifications per case type
solved the speed issue, getting full responses back on 90 questions in 1-2 seconds now
I will work on talking more for the team too. Thank you for the advice.
Can you get a hold of James Scott? I've been waiting on permissions for his big query tables so we can pull them over and re-write the predator backend so we can get this pushed.
Can you get a hold of James Scott? I've been waiting on permissions for his big query tables so we can pull them over and re-write the predator backend so we can get this pushed.
I just added you as BigQuery Admin on AI Projects, ai-projects-406720 is the name. Check your bigQuery project dropdown box for it.
Can you give Dustin Surwill admin access too?
*Thread Reply:* @Chris Krecicki Done
*Thread Reply:* Boss. By next week, mid-next week. I should have this backend done. And the QA tool looks ready for beta. I'll get Dustin to push these and we'll get down to letting people use Predator and the QA tool. Once I strip out BigQuery as an application layer, it'll be fast and won't crash the container again
Boss. By next week, mid-next week. I should have this backend done. And the QA tool looks ready for beta. I'll get Dustin to push these and we'll get down to letting people use Predator and the QA tool. Once I strip out BigQuery as an application layer, it'll be fast and won't crash the container again
we got it all ported over .. starting on the bigquery to postgres query refactor
i got james cell number too so were in touch