Nightwing11 commited on
Commit
36215f6
·
1 Parent(s): 6671679

Chunking issue solved

Browse files
Data/yt_transcript.py CHANGED
@@ -101,7 +101,7 @@ def all_video_transcript_pipeline():
101
  return video_transcripts
102
 
103
 
104
- if __name__ == '__main__':
105
- full_transcripts = all_video_transcript_pipeline()
106
- print("this is full transcripts of all the youtube videos")
107
- print(full_transcripts)
 
101
  return video_transcripts
102
 
103
 
104
+ # if __name__ == '__main__':
105
+ # full_transcripts = all_video_transcript_pipeline()
106
+ # print("this is full transcripts of all the youtube videos")
107
+ # print(full_transcripts)
Rag/{rag.py → chunking.py} RENAMED
@@ -3,6 +3,7 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
3
  from langchain_community.vectorstores import Chroma
4
  from langchain.chains import ConversationalRetrievalChain
5
  from langchain_community.document_loaders import TextLoader
 
6
  from langchain.memory import ConversationBufferMemory
7
  import google.generativeai as genai
8
  import os
@@ -14,15 +15,47 @@ import google.generativeai as genai
14
 
15
  PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
16
  sys.path.append(PROJECT_ROOT)
17
- print("THIS IS PROJECT ROOT")
18
- print(PROJECT_ROOT)
19
  API_KEY = os.getenv("GOOGLE_API_KEY")
20
  if API_KEY:
21
  genai.configure(api_key=API_KEY)
22
- print(API_KEY)
23
-
24
  full_transcripts = all_video_transcript_pipeline()
25
- print("this is full transcripts of all the youtube videos")
26
- print(full_transcripts)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- # loader = TextLoader()
 
 
 
 
 
3
  from langchain_community.vectorstores import Chroma
4
  from langchain.chains import ConversationalRetrievalChain
5
  from langchain_community.document_loaders import TextLoader
6
+ from langchain.schema import Document
7
  from langchain.memory import ConversationBufferMemory
8
  import google.generativeai as genai
9
  import os
 
15
 
16
  PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
17
  sys.path.append(PROJECT_ROOT)
 
 
18
  API_KEY = os.getenv("GOOGLE_API_KEY")
19
  if API_KEY:
20
  genai.configure(api_key=API_KEY)
 
 
21
  full_transcripts = all_video_transcript_pipeline()
22
+ loader = TextLoader(full_transcripts)
23
+
24
+ import logging
25
+
26
+ logging.basicConfig(level=logging.INFO)
27
+
28
+
29
+ def prepare_documents(full_transcript):
30
+ docs = []
31
+ for key, value in full_transcript.items():
32
+ if isinstance(value, dict) and "text" in value:
33
+ content = " ".join(value["text"]) if isinstance(value["text"], list) else value["text"]
34
+ docs.append(Document(page_content=content, metadata={"source": key}))
35
+ return docs
36
+
37
+
38
+ def split_text_to_chunks():
39
+ try:
40
+ docs = prepare_documents(full_transcripts)
41
+ logging.info(f"{len(docs)} documents prepared")
42
+ text_splitter = RecursiveCharacterTextSplitter(
43
+ chunk_size=1000,
44
+ chunk_overlap=200,
45
+ separators=['\n\n', '.', '?', '!'])
46
+ splits = text_splitter.split_documents(docs)
47
+ return splits
48
+ except Exception as e:
49
+ logging.error(f"Error while splitting text: {str(e)}")
50
+ # Optionally log the full traceback to a file
51
+ import traceback
52
+ with open("error_log.txt", "w") as f:
53
+ traceback.print_exc(file=f)
54
+ return None
55
+
56
 
57
+ all_splits = split_text_to_chunks()
58
+ if all_splits:
59
+ print(f"Total chunks created: {len(all_splits)}")
60
+ else:
61
+ print("Splitting failed. Check logs for details.")
Rag/transcripts/SjPJn4QP0dk_20250109191200.txt ADDED
@@ -0,0 +1,932 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ welcome to hubman lab Essentials where
2
+ we revisit past episodes for the most
3
+ potent and actionable science-based
4
+ tools for mental health physical health
5
+ and
6
+ performance I'm Andrew huberman and I'm
7
+ a professor of neurobiology and
8
+ Opthalmology at Stanford School of
9
+ Medicine let's continue our discussion
10
+ about
11
+ neuroplasticity this incredible feature
12
+ of our nervous system that allows it to
13
+ change itself in response to experience
14
+ and even in ways that we consciously and
15
+ deliberately decide to change it most
16
+ people don't know how to access
17
+ neuroplasticity and so that's what this
18
+ entire month of the huberman Lab podcast
19
+ has been about we've explored
20
+ neuroplasticity from a variety of
21
+ different perspectives we talked about
22
+ representational plasticity we talked
23
+ about the importance of focus and reward
24
+ we talked about this amazing and
25
+ somewhat surprising aspect of the
26
+ vestibular system how altering our
27
+ relationship to gravity and in addition
28
+ to that making error as we try and learn
29
+ can open up Windows to plasticity but we
30
+ have not really talked so much about
31
+ directing the plasticity toward
32
+ particular outcomes and thus far we
33
+ really haven't talked yet about how to
34
+ undo things that we don't want and so
35
+ today we are going to explore that
36
+ aspect of neuroplasticity and we are
37
+ going to do that in the context of a
38
+ very important and somewhat sensitive
39
+ topic which is pain and in some cases
40
+ injury to the nervous system we as
41
+ always here on this podcast are going to
42
+ discuss some of the science we get into
43
+ mechanism but we
44
+ also really get at principles principles
45
+ are far more important than any one
46
+ experiment or one description of
47
+ mechanism and certainly far more
48
+ important than any one protocol because
49
+ principles allow you to think about your
50
+ nervous system and work with it in ways
51
+ that best serve you so let's start our
52
+ discussion about pain and the somata
53
+ sensory system the somata sensory system
54
+ is as the name implies involved in
55
+ understanding touch physical feeling on
56
+ our body and the simplest way to think
57
+ about the somata sensory system is that
58
+ we have little sensors and Those sensors
59
+ come in the form of neurons nerve cells
60
+ that reside in our skin and in the
61
+ deeper layers below the skin we have
62
+ some that correspond to and we should
63
+ say respond to Mechanical touch so you
64
+ know pressure on the top of my hand or a
65
+ pinpoint or other sensors for instance
66
+ respond to heat to cold some respond to
67
+ vibration we have a huge number of
68
+ different receptors in our skin and they
69
+ take that information and send it down
70
+ these wires that we call axons in the
71
+ form of electrical signals to our spinal
72
+ cord and then up to the brain and within
73
+ the spinal cord andin brain we have
74
+ centers that interpret that information
75
+ that actually make sense of those
76
+ electrical signals and this is amazing
77
+ because none of those sensors has a
78
+ different unique form of information
79
+ that it uses it just sends electrical
80
+ potentials into the nervous system pain
81
+ and The Sensation of pain is Believe It
82
+ or Not A controversial word in the
83
+ Neuroscience field people prefer to use
84
+ the word no acception noors are the
85
+ sensors in the skin that detect
86
+ particular types of stimuli it actually
87
+ comes from the Latin word noera which
88
+ means to harm and why would neurosci
89
+ does not want to talk about pain well
90
+ it's very subjective it has a a mental
91
+ component and a physical component we
92
+ cannot say that pain is simply an
93
+ attempt to avoid physical harm to the
94
+ body and here's why they actually can be
95
+ dissociated from one another and there's
96
+ a famous case that was published in the
97
+ British Journal of Medicine where a
98
+ construction
99
+ worker I think he fell is how the story
100
+ went and a 14inch nail went through his
101
+ Boot and up through the boot and he was
102
+ in excruciating pain just beyond
103
+ anything he'd experienced he he reported
104
+ that he couldn't even move in any
105
+ Dimension even a tiny bit without
106
+ feeling excruciating pain they brought
107
+ him into the clinic into the hospital
108
+ they were able to cut away the boot and
109
+ they realized that the nail had gone
110
+ between two toes and it had actually not
111
+ imp impaled the skin at all his visual
112
+ image of the nail going through his boot
113
+ gave him the feeling the legitimate
114
+ feeling that he was experiencing the
115
+ pain of a nail going through his foot
116
+ which is incredible because it speaks to
117
+ the power of the Mind in this pain
118
+ scenario and it also speaks to the power
119
+ of the specificity it's not like he
120
+ thought that his foot was on fire he
121
+ thought because he saw a nail going
122
+ through his foot what it was going
123
+ through his boot but he thought it was
124
+ going through his foot that it was sharp
125
+ pain of the sort that a nail would
126
+ produce it really speaks to the
127
+ incredible capacity that these top down
128
+ these you know higher level cognitive
129
+ functions have in interpreting what
130
+ we're experiencing out in the periphery
131
+ even just on the basis of what we see so
132
+ why are we talking about pain during a
133
+ month on neuroplasticity Well turns out
134
+ that the pain system offers a a number
135
+ of different principles that we can
136
+ leverage to a ensure that if we are ever
137
+ injured we are able to understand the
138
+ difference between injury and pain
139
+ because there is a difference that if
140
+ we're ever in pain that we can
141
+ understand the difference between injury
142
+ and pain that we will be able to
143
+ interpret our pain and during the course
144
+ of today's podcast I'm going to cover
145
+ protocols that help eliminate pain from
146
+ both ends of the spectrum from the
147
+ periphery at the level of the injury and
148
+ through these top- down mental
149
+ mechanisms believe it or not we're going
150
+ to talk about love a colleague of mine
151
+ at Stanford who runs a major pain clinic
152
+ um is working on and has published
153
+ quality peer- rreview data on the role
154
+ of love in modulating the pain response
155
+ so what we're talking about today is
156
+ plasticity of perception which has
157
+ direct bearing on emotional pain and has
158
+ direct bearing on trauma so let's get
159
+ started in thinking about what happens
160
+ with pain and I will tell you just now
161
+ that there is a mutation a genetic
162
+ mutation in a particular sodium Channel
163
+ a sodium channel is uh one of these
164
+ little holes in neurons that allows them
165
+ to fire Action potentials it's important
166
+ to the function of the neuron it's also
167
+ important for the development of certain
168
+ neurons and there's a particular
169
+ mutation there are kids that are born
170
+ without this sodium Channel 1.7 if you
171
+ want to look it up those kids experience
172
+ no pain no pain whatsoever and it is a
173
+ terrible situation um they don't tend to
174
+ live very long due to accidents it's a
175
+ really terrible and unfortunate
176
+ circumstance in fact it's
177
+ reasonable to speculate that one of the
178
+ reasons not all but one of the reasons
179
+ why people might differ in their
180
+ sensitivity to pain is by way of genetic
181
+ variation in how many of these sorts of
182
+ receptors that they express people who
183
+ make too much of this receptor
184
+ experience extreme pain from even subtle
185
+ stimul
186
+ so let's talk about some of the features
187
+ of how we're built physically and how
188
+ that relates to pain and how we can
189
+ recover from injury so first of all we
190
+ have maps of our body surface in our
191
+ brain it's called a homunculus that
192
+ representation is scaled in a way that
193
+ matches sensitivity so the areas of your
194
+ body that are most sensitive have a lot
195
+ more brain real estate devoted to them
196
+ your back is an enormous piece of tissue
197
+ compared to your finger finger tip but
198
+ your back has fewer receptors devoted to
199
+ it and the representation of your back
200
+ in your brain is actually pretty small
201
+ whereas the representation of your
202
+ finger is enormous so the how big a
203
+ brain area is devoted to a given body
204
+ part is directly related to the density
205
+ of receptors in that body part not the
206
+ size of the body part you can actually
207
+ know how sensitive a given body part is
208
+ and how much brain area is devoted to it
209
+ through what's called twoo
210
+ discrimination you can do this
211
+ experiment if you want I think I've
212
+ described this once or twice before but
213
+ basically if you have someone put um
214
+ maybe take two pens and put them maybe 6
215
+ Ines apart on your back and and touch
216
+ while you're facing away and you they'll
217
+ ask you how many points they're touching
218
+ you and you say um two but if they move
219
+ those closer together say 3 in you're
220
+ likely to experience it as one point of
221
+ contact whereas on your finger you could
222
+ do play that game all day and as long as
223
+ there's a millimeter or so spacing you
224
+ will know that it's two points as
225
+ opposed to one and that's because
226
+ there's more pixels more density of
227
+ receptors this has direct bearing to
228
+ pain because it says that areas of the
229
+ body that have denser receptors are
230
+ going to be more sensitive to pain than
231
+ to others so just as a rule of thumb
232
+ areas of your body that are injured that
233
+ are large areas that have low
234
+ sensitivity before injury likely are
235
+ going to experience less pain
236
+ and the literature shows will heal more
237
+ slowly because they don't have as many
238
+ cells around to produce inflammation and
239
+ you might say wait I thought
240
+ inflammation is bad well one of the
241
+ things I really want to get across today
242
+ is that inflammation is not bad
243
+ inflammation out of control is bad but
244
+ inflammation is wonderful inflammation
245
+ is the tissue repair response I thought
246
+ it might be a nice time to just think
247
+ about the relationship between the
248
+ periphery and the central maps in a way
249
+ that many of you have probably heard
250
+ about before which will frame the
251
+ discussion a little bit better which is
252
+ Phantom limb pain now some of you are
253
+ probably familiar with this but for
254
+ people that have an arm or a leg or a
255
+ finger or some other portion of their
256
+ body amputated it's not uncommon for
257
+ those people to feel as if they still
258
+ have that limb or appendage or piece of
259
+ their body Inta and typically
260
+ unfortunately the sensation of that limb
261
+ is not one of the limb being nice and
262
+ relaxed and and you know and just there
263
+ the sensation is that the limb is
264
+ experiencing pain or is contorted in the
265
+ specific orientation that it was around
266
+ the time of the injury so if someone has
267
+ a you know a blunt force to the hand and
268
+ they end up having their hand amputated
269
+ typically they will continue to feel
270
+ pain in their Phantom hand which is
271
+ pretty wild and that's because the
272
+ representation of that hand is still
273
+ intact in the cortex in the brain
274
+ and it's trying to balance its levels of
275
+ activity normally it's getting what's
276
+ called proprioceptive feedback
277
+ proprioception is just our knowledge of
278
+ where our limbs are in space it's an
279
+ extremely important aspect of our somata
280
+ sensory system and there's no appropri
281
+ receptive feedback and so a lot of the
282
+ circuits start to ramp up their levels
283
+ of activity and they become very
284
+ conscious of the Phantom limb now um
285
+ before my lab was at Stanford I was at
286
+ UC San Diego and one of my colleagues
287
+ was a guy everyone just calls him by his
288
+ lap last name ramachandran who is famous
289
+ for understanding this Phantom limb
290
+ phenomenon and developing a very simple
291
+ but very powerful solution to it that
292
+ speaks to the incredible capacity of
293
+ top- down modulation and top- down
294
+ modulation the ability to use one's
295
+ brain cognition and senses to control
296
+ pain in the body is something that
297
+ everyone not just people missing limbs
298
+ or in chronic pain could learn to
299
+ benefit from because it is a way to tap
300
+ into the our ability to use our mind to
301
+ control perceptions of what's happening
302
+ in our body so what did ramachandran do
303
+ ramachandran had people who were missing
304
+ a limb put their intact limb into a box
305
+ that had mirrors in it such that when
306
+ they looked in the box and they moved
307
+ their intact limb the opposite limb
308
+ which was a reflection of the intact
309
+ limb because they're missing the
310
+ opposite limb they would see it as if it
311
+ was intact and as they would move their
312
+ intact limb they would visualize with
313
+ their eyes the the limb that's in the
314
+ place of the absent limb so this is all
315
+ by mirrors moving around and they would
316
+ feel immediate relief from the phantom
317
+ pain and he would tell them and they
318
+ would direct their hand toward a
319
+ orientation that felt comfortable to
320
+ them then they would exit the mirror box
321
+ they would take their their their hand
322
+ out and and they would feel as if the
323
+ hand was now in its relaxed normal
324
+ position so you could get real time in
325
+ moments remapping of the representation
326
+ of the hand now that's amazing this is
327
+ the kind of thing that all of us would
328
+ like to be able to do if we are in pain
329
+ because if you do anything for long
330
+ enough including live you're going to
331
+ experience pain of some sort and this
332
+ again I just want to remind you isn't
333
+ just about physical injuries and pain
334
+ this has direct relevance to emotional
335
+ pain as well which we of course we'll
336
+ talk talk about so the ramachandran
337
+ studies were really profound because
338
+ they said a couple of things one
339
+ plasticity can be very fast that it can
340
+ be driven by the experience of something
341
+ just the visual experience and so this
342
+ may come as a shock to some of you and
343
+ by no means it might trying to be
344
+ insensitive but pain is a perceptual
345
+ thing as much as it's a physical thing
346
+ it's a belief system about what you're
347
+ experiencing in your body and that has
348
+ important relevance for healing
349
+ different types of injury and the pain
350
+ associated with that injury now this
351
+ brings up another topic which is
352
+ definitely related to neuroplasticity
353
+ and injury but is a more General one
354
+ that I hear about a lot which is
355
+ traumatic brain injury many injuries are
356
+ not just about the limb and the the lack
357
+ of use of the limb but concussion and
358
+ head injury but I want to talk a little
359
+ bit about what is known about recovery
360
+ from concussion and this is very
361
+ important because it has implications
362
+ for just normal aging as well and offset
363
+ setting some of the cognitive decline
364
+ and physical decline that occurs with
365
+ normal aging typically after TBI there's
366
+ a constellation of symptoms that many
367
+ people if not all people with TBI report
368
+ which is headache photophobia that
369
+ lights become kind of aversive sleep
370
+ disruption trouble concentrating
371
+ sometimes mood issues there's you know a
372
+ huge range and of course the severity
373
+ will vary
374
+ Etc it's very clear that regardless of
375
+ whether or not there was a skull break
376
+ and regardless of when the TBI happened
377
+ and how many times it's happened that
378
+ the system that repairs the brain the
379
+ adult brain is mainly centered around
380
+ this lymphatic system that we call for
381
+ the brain the glymphatic system it's
382
+ sort of like a sewer system that clears
383
+ out the debris that surrounds neurons
384
+ especially injured neurons and the
385
+ glymphatic system is very active during
386
+ sleep and the glymphatic system is
387
+ something that you want very active
388
+ because it's going to clear away the
389
+ debris that sits between the neurons and
390
+ the cells that surround the connections
391
+ between the neurons called the glea
392
+ those cells are actively involved in
393
+ repairing the connections between
394
+ neurons when damaged so the glymphatic
395
+ system is so important that many people
396
+ if not all people who get TBI are told
397
+ get adequate rest you need to sleep and
398
+ that's kind of twofold advice on the one
399
+ hand it's telling you to get sleep
400
+ because all the good things happen in
401
+ sleep it's also about getting those
402
+ people to not continue to engage in
403
+ their activity fulltime or really try
404
+ and Hammer through it the glymphatic
405
+ system has been shown to be activated
406
+ further in two ways one is that sleeping
407
+ on one side not on back or stomach seems
408
+ to increase the amount of wash out or
409
+ wash through I should say of the
410
+ glymphatic system the other thing that
411
+ has been shown to improve the function
412
+ of the lymphatic system is a certain
413
+ form of exercise and I want to be very
414
+ very clear here I will never and I am
415
+ not suggesting that people exercise in
416
+ any way that aggravates their injury or
417
+ that goes against their Physician's
418
+ advice however there's some interesting
419
+ data that zone 2 cardio for 30 to 45
420
+ minutes three times a week seems to
421
+ improve the rates of clearance of some
422
+ of the
423
+ debris after injury and in general
424
+ injury or no to accelerate and improve
425
+ the rates of flow for the lymphatic
426
+ system it could be fast walking it could
427
+ be jogging if you can do that with your
428
+ injury safely could be cycling and this
429
+ is really interesting outside of TBI
430
+ because what we know from aging is that
431
+ aging is a nonlinear process it's not
432
+ like with every year of Life your brain
433
+ gets a little older it's a has sometimes
434
+ it follows what's more like a step
435
+ function you get these big jumps in in a
436
+ in markers of Aging I guess that we
437
+ could think of them as jumps down
438
+ because it's a negative thing for most
439
+ everybody would like to live longer and
440
+ be healthier in brain and body and so
441
+ the types of exercise I'm referring to
442
+ now are really more about brain
443
+ longevity and about keeping the brain
444
+ healthy than they are about physical
445
+ fitness so I think this is really
446
+ interesting and if some of you would
447
+ like to know the mechanism or at least
448
+ the hypothesize mechanism ISM there's a
449
+ a a molecule called aquaporin 4 that is
450
+ related to the gal system so Gia are the
451
+ it means glue and Latin are these are
452
+ these cells in the brain the most
453
+ numerous cells in the brain in fact that
454
+ in sheath synapses but they're very
455
+ Dynamic cells aquaporin 4 is mainly
456
+ expressed by the gal cell called the
457
+ astroy Astro looks like a little star
458
+ incredibly interesting cells and the the
459
+ thing to remember is that the asites
460
+ bridge the connection between the
461
+ neurons
462
+ the synapse the connections between them
463
+ and the vasculature the blood system and
464
+ the gimatic system so this glymphatic
465
+ system and the gal asroy system is a
466
+ system that we want chronically active
467
+ throughout the day as much as possible
468
+ so low-level walking Zone 2 cardio and
469
+ then at night during slow wave sleep is
470
+ then really when this lymphatic system
471
+ kicks in so that should hopefully be an
472
+ actionable takeaway provided that you
473
+ can do that kind of cardio safely
474
+ that I believe everybody should be doing
475
+ who cares about brain longevity not just
476
+ people who are trying to get over TBI
477
+ now I'd like to return a little bit to
478
+ some of the subjective aspects of pain
479
+ modulation because I think it's so
480
+ interesting and so actionable that
481
+ everyone should know about this our
482
+ interpretation our subjective
483
+ interpretation of a sensory event is
484
+ immensely powerful for dictating our
485
+ experience of the event the molecule
486
+ adrenaline when it's liberated into our
487
+ body truly blunts our experience of pain
488
+ we all know the stories of people you
489
+ know walking you know miles on stumped
490
+ legs um people doing all sorts of things
491
+ that were incredible
492
+ Feats that allowed them to move through
493
+ what would otherwise be pain and
494
+ afterward they do experience extreme
495
+ pain but during the event often times
496
+ they are not experiencing pain and
497
+ that's because of the pain blunting
498
+ effects of adrenaline adrenaline binding
499
+ to particular receptors actually shuts
500
+ down pain
501
+ Pathways people who anticipate an
502
+ injection of morphine immediately report
503
+ the feeling of loss of pain their pain
504
+ starts to diminish because they know
505
+ they're going to get pain relief and
506
+ it's a powerful effect now all of you
507
+ are probably saying placebo effect
508
+ Placebo effects are very real Placebo
509
+ effects and belief effects as they're
510
+ called have a profound effect on our
511
+ experience of noxious stimul like pain
512
+ and they can also have a profound effect
513
+ on positive stimuli and things that
514
+ we're looking forward to one study that
515
+ I think is particularly interesting here
516
+ from my colleague at Stanford Sean
517
+ Mackey they did a neuroimaging study
518
+ they subjected people to pain in this
519
+ case it was a a heat pain people have
520
+ very specific thresholds to heat at
521
+ which they cannot tolerate any more heat
522
+ but they explored the extent to which
523
+ looking at an image of somebody in this
524
+ case a romantic partner that the person
525
+ loved would allow them to adjust their
526
+ pain
527
+ response and it turns out it does they
528
+ could tolerate more pain and they
529
+ reported it as not as
530
+ painful that response that feeling of
531
+ Love internally can blunt the pain
532
+ experience to a significant degree these
533
+ are not small effects and not
534
+ surprisingly how early a relationship is
535
+ how new a relationship is directly
536
+ correlat with people's ability they
537
+ showed to use this love this internal
538
+ representation of love to blunt the pain
539
+ response so for those of you that have
540
+ been with your partners for many years
541
+ and you love them very much and you're
542
+ obsessed with them terrific you have a
543
+ pre-installed well I suppose it's not
544
+ pre-installed you had to do the work
545
+ because relationships are work but
546
+ you've got a installed mechanism for
547
+ blunting pain and again these are not
548
+ minor effects these are major effects
549
+ and it's all going to be through that
550
+ top down modulation that we talked about
551
+ not unlike the mirrorbox experiments
552
+ with Phantom limb that relieve phantom
553
+ pain or some other top- down modulation
554
+ in the opposite example is the nail
555
+ through the boot which is a visual image
556
+ that made the person think it was
557
+ painful when in fact it was painful even
558
+ though there was no tissue damage it was
559
+ all perceptual so the pain system is
560
+ really subject to these perceptual
561
+ influences which is remarkable because
562
+ really when we think about the somata
563
+ sensory system it has this cognitive
564
+ component it's got this peripheral
565
+ component but there's another component
566
+ which is the way in which our sensation
567
+ our somatos sensory system is woven in
568
+ with our autonomic nervous system
569
+ independent of love we're going to talk
570
+ about something quite different which is
571
+ putting needles and electricity in
572
+ different parts of the body so-called
573
+ acupuncture something that for many
574
+ people were it it's been viewed as a
575
+ kind of alternative medicine but now
576
+ there are excellent Laboratories
577
+ exploring what's called
578
+ electroacupuncture and acupuncture and I
579
+ think what you'll be interested in and
580
+ surprised to learn is that it does work
581
+ but sometimes it can exacerbate pain and
582
+ sometimes it can relieve pain and it all
583
+ does that through very discrete Pathways
584
+ for which we can really say this neuron
585
+ connects to that neuron connects to the
586
+ adrenals and we can tie this all back to
587
+ dopamine because in the end it's the
588
+ chemicals and neural circuits that are
589
+ giving rise to these perceptions or
590
+ these experiences rather of things that
591
+ we call pain love ET Etc there are
592
+ actually a lot of really good
593
+ peer-reviewed studies supporting the use
594
+ of acupuncture for in particular GI trct
595
+ issues in recent years there's been an
596
+ emphasis on trying to understand the
597
+ mechanism of things like acupuncture and
598
+ acupuncture itself but as a way to try
599
+ and understand how these sorts of
600
+ practices might actually benefit people
601
+ who are experiencing pain or for
602
+ changing the nervous system or brain
603
+ body relationship in general what I want
604
+ to talk about in terms of acup puncture
605
+ is the incredible way in which
606
+ acupuncture
607
+ illuminates the cross talk between the
608
+ somata sensory system our ability to
609
+ feel stuff externally exteroception
610
+ internally
611
+ interoception and how that somata
612
+ sensory system is wired in with and
613
+ communicating with our autonomic nervous
614
+ system that regulates our levels of
615
+ alertness or
616
+ calmness so this takes us all back to
617
+ the homunculus we have this
618
+ representation of our body surface in
619
+ our
620
+ brain that representation is what we
621
+ call
622
+ somatotopic and what somatotopy is is it
623
+ just means that areas of your body that
624
+ are near one another are represented by
625
+ neurons that are nearby each other in
626
+ the brain the connections from those
627
+ brain neurons are sent into the body and
628
+ they are synchronized with meaning they
629
+ Crosswire with and and form synapses
630
+ with some of the input from the viscera
631
+ from our guts from our diaphragm from
632
+ our stomach from our spleen from our
633
+ heart our internal organs are sending
634
+ information up to this map in our brain
635
+ of the body surface but it's about
636
+ internal information what we call
637
+ interoception our ability to look inside
638
+ or imagine inside and feel what we're
639
+ feeling inside so the way to think about
640
+ this accurately is that our
641
+ representation of our self is a
642
+ represent ation of our internal workings
643
+ our viscera our guts everything inside
644
+ our skin and the surface of our skin and
645
+ the external World those three things
646
+ are always being combined in a very
647
+ interesting complex but very seamless
648
+ way acupuncture involves taking needles
649
+ and sometimes electricity Andor heat as
650
+ well and stimulating particular
651
+ locations on the body and if somebody
652
+ has a gastrointestinal issue like their
653
+ their guts are moving too quick they
654
+ have diarrhea you stimulate this area
655
+ and it'll slow their gut motility down
656
+ or if their gut motility is too slow
657
+ they're constipated you stimulate
658
+ someplace else and it accelerates it and
659
+ you know hearing about this of it sounds
660
+ kind of to a Westerner who's not
661
+ thinking about the underlying neural
662
+ circuitry it could sound kind of wacky
663
+ but when you look at the neural
664
+ circuitry the neuro Anatomy it really
665
+ starts to make sense intense stimulation
666
+ of the abdomen however with these
667
+ electroacupuncture has a very strong
668
+ effect of an increasing inflammation in
669
+ the body body and this is important to
670
+ understand because it's not just that
671
+ stimulating the the gut does this
672
+ because you're activating the gut area
673
+ it activates a particular nerve pathway
674
+ for the afficionados it's the splenic
675
+ spinal sympathetic axis if you really
676
+ want to know and it's pro-inflammatory
677
+ under most conditions if for instance
678
+ the person is dealing with a particular
679
+ bacterial infection that can be
680
+ beneficial and this goes back to a much
681
+ earlier discussion that we had on a
682
+ previous podcast that we'll revisit
683
+ again and again which is that the stress
684
+ response was designed to combat
685
+ infection so it turns out that there are
686
+ certain patterns of stimulation on the
687
+ abdomen that can actually liberate
688
+ immune cells from our immune organs like
689
+ our spleen and counter infection when
690
+ you stimulate these Pathways that
691
+ activate in particular the adrenals the
692
+ adrenal gland liberates norepinephrine
693
+ and epinephrine and the brain does as
694
+ well it binds to what are called the
695
+ beta noradrenergic receptor okay so this
696
+ is really getting kind of down into the
697
+ weeds but the beta nuragic receptors
698
+ activate the spleen which liberate cells
699
+ that combat infection that's the
700
+ short-term quick
701
+ response the more intense stimulation of
702
+ the abdomen and other areas can be
703
+ pro-inflammatory because of the ways
704
+ that they trigger certain Loops that go
705
+ back to the brain and Trigger the sort
706
+ of anxiety Pathways that exacerbates
707
+ pain so one pathway stimulates
708
+ norepinephrine and blunts PL the other
709
+ one doesn't what does all this mean how
710
+ are we supposed to put all this together
711
+ well there's a paper that was published
712
+ in nature medicine in 2014 this is an
713
+ excellent Journal that describes how
714
+ dopamine can activate the Vegas
715
+ peripherally and nor norepinephrine can
716
+ activate the Vegas peripherally and
717
+ reduce inflammation what this means is
718
+ that there are real maps of our body
719
+ surface that when
720
+ stimulated communicate with our
721
+ autonomic nervous system the system
722
+ system that controls alertness or
723
+ calmness and thereby releases either
724
+ molecules like norepinephrine and
725
+ dopamine which make us more alert and
726
+ blunt our response to pain and they
727
+ reduce
728
+ inflammation but there are yet other
729
+ Pathways that when stimulated are
730
+ pro-inflammatory one of the things that
731
+ bothers me so much these days and I'm
732
+ not easily irritated but what really
733
+ bothers me is when people are talking
734
+ about inflammation like inflammation is
735
+ bad inflammation is terrific
736
+ inflammation is the reason why cells are
737
+ called to the site of injury to clear it
738
+ out inflammation is what's going to
739
+ allow you to heal from any injury
740
+ chronic inflammation is bad but acute
741
+ inflammation is absolutely essential
742
+ remember those kids that we talked about
743
+ earlier that have mutations in these
744
+ receptors that for sensing pain they
745
+ never get inflammation and that's why
746
+ their joints literally disintegrate it's
747
+ really horrible because they don't
748
+ actually have the inflammation response
749
+ because it was never triggered by the
750
+ pain response so I think that the data
751
+ on acupuncture turning out to be very
752
+ interesting before I continue I just
753
+ thought I'd answer a question that I get
754
+ a lot uh which is what about Wim Hoff
755
+ breathing Wim Hoff also called AKA The
756
+ Iceman um has his breathing that's
757
+ similar to uh Tumo breathing as it was
758
+ originally called involves basically
759
+ hyperventilating and then doing some
760
+ exhales and some breath holds a number
761
+ of people have asked me about it in uh
762
+ in relation to pain management the
763
+ effect of doing that kind of breathing
764
+ it's not a mysterious effect it
765
+ liberates adrenaline from the adrenals
766
+ when you have adrenaline in your system
767
+ and when the spleen is very
768
+ active that response is used to counter
769
+ infection and stress counters infection
770
+ by liberating killer cells in the body
771
+ you don't want the stress response to
772
+ stay on indefinitely however things like
773
+ Wim Hoff breathing like ice baz anything
774
+ that releases adrenaline will counter
775
+ the infection but you want to regulate
776
+ the duration of that adrenaline response
777
+ today we've talked about a variety of
778
+ tools but I want to Center in on a
779
+ particular sequence of tools that
780
+ hopefully you won't need but presumably
781
+ if you're a human being and you're
782
+ active you will need at some point it's
783
+ about managing injury and recovering and
784
+ healing fast or at least as fast as
785
+ possible it includes removing the pain
786
+ it includes getting Mobility back and
787
+ getting back to a normal life whatever
788
+ that means for you
789
+ I want to emphasize that what I'm about
790
+ to talk about next was developed in
791
+ close consultation with Kelly starett
792
+ who many of you probably have heard of
793
+ before Kelly can be found at the ready
794
+ State he's a formally trained so degreed
795
+ and educated exercise physiologist he's
796
+ a world expert in movement and tissue
797
+ Rehabilitation so I asked Kelly I made
798
+ it really simple I said okay let's say I
799
+ were to sprain my ankle or break my arm
800
+ or injure my knee or ACL tear or
801
+ something like that or shoulder injury
802
+ what are the absolute necessary things
803
+ to do regardless of situation so the
804
+ first one is a very basic one that now
805
+ you have a lot of information to act on
806
+ which is sleep is essential and so we
807
+ both agreed 8 hours of sleep would be
808
+ ideal but if not at least 8 hours
809
+ inmobile so that's a
810
+ non-negotiable in terms of getting the
811
+ foundation for allowing for glymphatic
812
+ clearance and tissue clearance Etc the
813
+ other is if possible unless it's
814
+ absolutely excruciating when you just
815
+ can't do it a 10-minute walk per day of
816
+ course you don't want to exacerbate the
817
+ injury at least a 10-minute walk per day
818
+ and probably longer this is where it
819
+ gets interesting I was taught I learned
820
+ that when you injure yourself you're
821
+ supposed to ice something you're
822
+ supposed to put ice on it but I didn't
823
+ realize this but when speaking to
824
+ exercise physiologists and some
825
+ Physicians they said that the ice is
826
+ really more of a placebo it numbs the
827
+ the environment of the injury which is
828
+ not surprising and will eliminate the
829
+ pain for a short while but it has some
830
+ negative effects that perhaps offset its
831
+ use it actually can create some like
832
+ clotting and sludging of the of the
833
+ tissue and fluids which is bad because
834
+ you want the macras and the other cell
835
+ types phagocytosing eating up the debris
836
+ and and injury and moving it out of
837
+ there so that it can repair so that was
838
+ surprising to me which made me ask well
839
+ then what about heat well it turns out
840
+ heat is actually quite beneficial the
841
+ major effects seem to be explained by
842
+ heat improving the viscosity of the
843
+ tissues and the clearance and the
844
+ profusion of of fluid blood lymph and
845
+ other fluids out of the injury area so
846
+ all of this might sound just like Common
847
+ Sense knowledge I always just thought
848
+ it's ice it's non-steroid
849
+ anti-inflammatory drugs it's things that
850
+ block block prostag gland and so things
851
+ like aspirin ibuprofen acetam Menin
852
+ those things generally work by blocking
853
+ things like the the they're called Co
854
+ the Cox uh prostag gland in blockers and
855
+ things of that sort things in that
856
+ pathway those sorts of treatments which
857
+ reduce inflammation may not be so great
858
+ at the beginning when you want
859
+ inflammation they may be important for
860
+ limiting pain so people can be
861
+ functional at all but the things that I
862
+ talked about today really are anchored
863
+ in three principles one is that the
864
+ inflammation response is a good one it
865
+ calls to the to the sight of injury
866
+ things that are going to clean up the
867
+ injury in bad cells
868
+ then there are going to be things that
869
+ are going to improve profusion like the
870
+ glymphatic system getting deep sleep
871
+ feet elevated sleeping on one side
872
+ low-level Zone 2 cardio three times a
873
+ week many people ask me about platelet
874
+ rich plasma so-called PRP they take
875
+ blood they enrich for platelets and they
876
+ re-inject it back into people here's the
877
+ deal it has never been shown whether or
878
+ not the injection itself is what's
879
+ actually creating the effect the claims
880
+ that PRP actually contains stem cells
881
+ are very very feeble and when you look
882
+ at the literature and you talk to anyone
883
+ expert in the stem cell field they will
884
+ tell you that it's the number of stem
885
+ cells in PRP is infinim small stem cells
886
+ are an exciting area of Technology
887
+ however there's a clinic down in Florida
888
+ that was shut down a couple years ago
889
+ for injecting stem cells harvested from
890
+ patients into the eye for immaculate
891
+ degener ation these were people that
892
+ were suffering from um poor vision and
893
+ very shortly after injecting uh these
894
+ stem cells into the eyes they went
895
+ completely blind and I'm not here to
896
+ tell you that you should or shouldn't do
897
+ something but I do think that anything
898
+ involving stem cells one should be very
899
+ cautious of the major issue with stem
900
+ cells that I think is concerning is that
901
+ stem cells are cells that want to become
902
+ lots of different things not just the
903
+ tissue that you're interested in so if
904
+ you damage your knee and you you inject
905
+ stem cells into your knee you need to
906
+ molecularly restrict those stem cells so
907
+ that they don't become tumor cells right
908
+ a tumor is a collection of stem cells
909
+ one needs to approach this with Extreme
910
+ Caution even if it's your own blood or
911
+ stem cells that you're re-injecting so
912
+ I'm going to close there I've talked
913
+ about a lot of tools today I've talked a
914
+ lot about somea sensation about
915
+ plasticity about pain about
916
+ acupuncture some of the Nuance of
917
+ acupuncture inflammation stress we even
918
+ talked a little bit about high-intensity
919
+ breathing so as always we take kind of a
920
+ whirlwind tour through a given topic lay
921
+ down some tools as we go hopefully the
922
+ principles that relate to pain and
923
+ injury but also neuroplasticity in
924
+ general today in the context of the
925
+ somata sensory system will be of use to
926
+ all of you I don't wish injury on any of
927
+ you but I do hope that you'll take the
928
+ information do with it what you will
929
+ once again thanks so much for your time
930
+ and attention today and as always thank
931
+ you for your interest in science
932
+ [Music]
requirements.txt CHANGED
@@ -9,4 +9,5 @@ langchain_community
9
  chromadb
10
  pypdf
11
  flask
12
- flask_cors
 
 
9
  chromadb
10
  pypdf
11
  flask
12
+ flask_cors
13
+ chromadb