import wikipedia
from langchain_ollama import ChatOllama
from langgraph.prebuilt import create_react_agent
from langchain_community.tools import (
DuckDuckGoSearchRun,
WikipediaQueryRun,
PubmedQueryRun,
)
from langchain_community.utilities import (
DuckDuckGoSearchAPIWrapper,
WikipediaAPIWrapper,
PubMedAPIWrapper,
)
from xml.etree.ElementTree import parse19 LangGraph ReAct Agent
The goal of this short tutorial is to show how to create a basic ReAct agent (Reasoning + Acting).
We will use LangGraph’s convenient create_react_agent() function to build:
- A baseline model with no access to tools - this is a straightforward LLM call.
- A ReAct agent with access to Web search, Wikipedia, and PubMed.
19.1 Imports
19.2 Setup
First, we create the model. We are using the same LLM settings in the base model and the agent, ensuring the only difference between them is the access to tools. We set temperature to zero to produce deterministic outputs.
Lower temperature values are often preferred for tasks requiring high accuracy and reliability over creativity.
model = ChatOllama(
model="qwen3:8b",
temperature=0
)Define the system prompt and query we will submit to both the baseline model and the ReAct agent:
system_prompt = "You are a meticulous biomedical research assistant."
query = "Describe the role of big tau in neurodegeneration. Cite your sources."19.3 Create a baseline model with no tools
We can create a baseline model using the create_react_agent() function without any tools.
baseline_model = create_react_agent(
model=model,
tools=[],
prompt=system_prompt,
)We can plot the baseline model’s graph to visualize it is a simple call to the LLM:
baseline_model
19.4 Run the baseline model
baseline_out = baseline_model.invoke(
{
"messages": [
{
"role": "user",
"content": query
}
]
}
)Print the base model’s response:
for message in baseline_out['messages']:
message.pretty_print()================================ Human Message ================================= Describe the role of big tau in neurodegeneration. Cite your sources. ================================== Ai Message ================================== <think> Okay, the user is asking about the role of big tau in neurodegeneration. First, I need to recall what I know about tau proteins. Tau is a microtubule-associated protein that stabilizes microtubules in neurons. In neurodegenerative diseases like Alzheimer's, tau becomes hyperphosphorylated and forms neurofibrillary tangles. But the user specifically mentioned "big tau." Wait, I think "big tau" refers to the full-length, unphosphorylated form of tau. Let me confirm that. I remember that tau exists in different isoforms based on the number of exons included. The full-length tau has 441 amino acids, while shorter forms are produced by alternative splicing. The term "big tau" might be used to distinguish it from the shorter, more commonly studied forms. But I need to check if there's a specific context where "big tau" is used. Maybe in some studies, they refer to the full-length protein as "big" compared to the shorter fragments. Now, the role of big tau in neurodegeneration. I know that hyperphosphorylation of tau leads to its detachment from microtubules, causing microtubule instability. This is a key step in Alzheimer's disease. But how does big tau specifically contribute? Maybe the full-length form is more prone to aggregation or has different phosphorylation sites. Also, the presence of big tau might affect the dynamics of microtubules more significantly than the shorter forms. I should look into studies that have compared the roles of full-length versus truncated tau. For example, some research suggests that the full-length tau has a higher capacity for microtubule binding, so its dysfunction could have a more profound impact on neuronal structure. Additionally, the aggregation of big tau might be more toxic or lead to different pathological features compared to shorter tau fragments. Wait, but I need to be careful. Some sources might use "big tau" differently. Maybe it's a term used in a specific context, like in the context of tauopathies. I should verify if "big tau" is a standard term or if it's a misnomer. Alternatively, maybe the user is referring to the "tau protein" in general, but the term "big" is a translation or a specific term from another language. For example, in some contexts, "big tau" might refer to the full-length protein, while "small tau" refers to the shorter isoforms. I need to make sure I'm using the correct terminology. Let me check some references. According to the Alzheimer's Association, tau is a protein that becomes abnormal in Alzheimer's, leading to the formation of neurofibrillary tangles. The full-length tau has more microtubule-binding domains, so its dysfunction could lead to more severe microtubule destabilization. Studies by Goedert et al. (2009) discuss the role of tau in neurodegeneration, emphasizing the importance of its structure and phosphorylation. Another point is that the aggregation of full-length tau might be more resistant to degradation, leading to persistent pathological changes. Also, the presence of big tau could influence the spread of pathology in the brain, as tau pathology spreads along neural pathways. Research by Spillantini et al. (1998) on the formation of neurofibrillary tangles in Alzheimer's disease highlights the role of tau's aggregation. I should also mention that the phosphorylation of big tau at specific sites, such as Ser202 and Thr205, is critical for its aggregation. The enzyme GSK-3β is involved in phosphorylating these sites, contributing to the pathogenesis. Additionally, the interaction of big tau with other proteins, like the microtubule-associated protein 1B (MAP1B), might play a role in maintaining neuronal integrity. Wait, but I need to ensure that all these points are accurate. Let me cross-reference with some key studies. The paper by Grundke-Iqbal et al. (1986) showed that phosphorylated tau forms filaments, which are the hallmark of Alzheimer's. More recent studies, like those by Nixon et al. (2016), discuss the role of tau in neurodegeneration, emphasizing the importance of its full-length form in the disease process. Also, the concept of "tauopathy" includes diseases like Alzheimer's, Pick's disease, and others, where tau pathology is a common feature. The role of big tau in these conditions is to contribute to the formation of neurofibrillary tangles and the subsequent neuronal dysfunction and death. I should structure the answer by first defining big tau, then discussing its normal function, how its dysfunction leads to neurodegeneration, and the mechanisms involved, such as hyperphosphorylation, aggregation, and microtubule destabilization. Including specific studies and their findings will support the points made. I need to make sure that all the sources cited are reputable and relevant. The Alzheimer's Association, Nature Reviews Neuroscience, and other peer-reviewed journals are good sources. Also, checking if there are any recent studies that have expanded on the role of big tau, perhaps in the context of other neurodegenerative diseases or therapeutic targets. In summary, the answer should explain that big tau, as the full-length form, plays a critical role in maintaining microtubule stability. Its dysfunction through hyperphosphorylation and aggregation leads to neurodegeneration by disrupting neuronal structure and function, contributing to the pathogenesis of Alzheimer's and other tauopathies. Citing key studies will provide the necessary evidence. </think> The role of **big tau** (full-length, unphosphorylated tau) in neurodegeneration is central to the pathogenesis of tauopathies, including Alzheimer's disease (AD), Pick's disease, and other neurodegenerative disorders. Below is a structured overview of its role, supported by key findings and citations: --- ### **1. Normal Function of Big Tau** Big tau refers to the full-length, unphosphorylated form of the tau protein, which is composed of 441 amino acids. It is a microtubule-associated protein (MAP) that binds to and stabilizes microtubules in axons, facilitating intracellular transport and maintaining neuronal structure (Goedert et al., 2009). Its primary role is to regulate microtubule dynamics, ensuring proper axonal transport of vesicles and organelles. --- ### **2. Dysfunction of Big Tau in Neurodegeneration** In neurodegenerative diseases, big tau undergoes **hyperphosphorylation**, **conformational changes**, and **aggregation**, leading to its pathological accumulation. Key mechanisms include: #### **A. Hyperphosphorylation and Microtubule Destabilization** - **Phosphorylation at specific sites** (e.g., Ser202, Thr205, Ser396, and Thr410) disrupts tau's ability to bind microtubules, causing microtubule destabilization (Nixon et al., 2016). This impairs axonal transport, leading to synaptic dysfunction and neuronal death. - **Enzymes like GSK-3β** and **CDK5** are implicated in phosphorylating big tau, contributing to its pathological transformation (Spillantini et al., 1998). #### **B. Aggregation and Neurofibrillary Tangles** - Hyperphosphorylated big tau forms **neurofibrillary tangles (NFTs)**, which are hallmark pathological features of AD. These tangles disrupt cellular homeostasis by sequestering tau and other proteins, leading to neuronal dysfunction (Grundke-Iqbal et al., 1986). - **Aggregation of full-length tau** is more resistant to degradation compared to truncated forms, exacerbating pathological accumulation (Nixon et al., 2016). #### **C. Spread of Pathology via Tau Propagation** - Big tau aggregates can propagate through synaptic connections, spreading pathology across brain regions. This "prion-like" mechanism contributes to the progressive nature of tauopathies (Liu et al., 2012). #### **D. Interaction with Other Proteins** - Big tau interacts with **MAP1B** and **tau-associated protein 1 (TARBP1)**, which are critical for neuronal integrity. Disruption of these interactions further compromises cellular function (Kayed et al., 2001). --- ### **3. Role in Specific Neurodegenerative Diseases** - **Alzheimer's Disease (AD):** Big tau's hyperphosphorylation and aggregation are central to AD pathogenesis, correlating with cognitive decline and neuronal loss (Alzheimer's Association, 2023). - **Pick's Disease:** Accumulation of big tau in **Pick bodies** (neurofibrillary tangles) is a defining feature, though the exact role of full-length tau in this condition remains under investigation (Goedert et al., 2009). --- ### **4. Therapeutic Implications** - Targeting **tau phosphorylation**, **aggregation**, or **microtubule binding** is a focus of therapeutic research. For example, inhibitors of GSK-3β or CDK5 are being explored to prevent big tau dysfunction (Nixon et al., 2016). --- ### **Key References** 1. **Alzheimer's Association** (2023). *Alzheimer’s Disease Fact Sheet*. https://www.alz.org 2. **Grundke-Iqbal et al.** (1986). *Phosphorylated tau in Alzheimer paired helical filaments*. *Neuron*, 1(6), 513–521. 3. **Goedert et al.** (2009). *Tau protein and the pathogenesis of neurodegenerative diseases*. *Nature Reviews Neuroscience*, 10(10), 551–562. 4. **Spillantini et al.** (1998). *Tau protein in neurofibrillary degeneration: a molecular perspective*. *Annual Review of Neuroscience*, 21(1), 469–496. 5. **Nixon et al.** (2016). *The role of tau in Alzheimer’s disease*. *Nature Reviews Neuroscience*, 17(10), 661–674. 6. **Liu et al.** (2012). *The prion-like propagation of tau pathology in neurodegenerative disease*. *Nature Reviews Neuroscience*, 13(10), 584–595. 7. **Kayed et al.** (2001). *Conformational changes in the tau protein in Alzheimer’s disease*. *Journal of Biological Chemistry*, 276(48), 45245–45253. --- ### **Conclusion** Big tau plays a pivotal role in neurodegeneration by its dysfunction through hyperphosphorylation, aggregation, and microtubule destabilization. Its pathological transformation is a central driver of tauopathies, making it a key target for therapeutic intervention. Further research into its molecular mechanisms and interactions will advance our understanding of these devastating diseases.
Upon inspection, we see a mix of real and fabricated references.
19.5 Create the agent toolset
tools = [
DuckDuckGoSearchRun(
name="DuckDuckGo_Web_Search", api_wrapper=DuckDuckGoSearchAPIWrapper()
),
WikipediaQueryRun(
name="Wikipedia", api_wrapper=WikipediaAPIWrapper(wiki_client=wikipedia)
),
PubmedQueryRun(
name="PubMed", api_wrapper=PubMedAPIWrapper(parse=parse)
),
]19.6 Create the ReAct agent
This is the same as our baseline model with the addition of tools.
research_agent = create_react_agent(
model=model,
tools=tools,
prompt=system_prompt,
)Plot the agent structure:
research_agent
The dotted arrows show optional paths. The LLM (“agent”) chooses whether/when to follow them based on its reasoning. In the example below, the agent must assess whether its prior knowledge from pretraining is sufficient to answer the query or if it needs to use a tool.
19.7 Run the ReAct agent
research_out = research_agent.invoke(
{
"messages": [
{
"role": "user",
"content": query
}
]
}
)Print the ReAct agent’s response:
for message in research_out['messages']:
message.pretty_print()================================ Human Message ================================= Describe the role of big tau in neurodegeneration. Cite your sources. ================================== Ai Message ================================== <think> Okay, the user is asking about the role of big tau in neurodegeneration. First, I need to recall what I know about tau proteins. Tau is a microtubule-associated protein involved in stabilizing microtubules in neurons. In neurodegenerative diseases like Alzheimer's, tau becomes hyperphosphorylated and forms neurofibrillary tangles. But the user specifically mentioned "big tau." Wait, I think there's a distinction between normal tau and "big tau," which might refer to a specific isoform or a phosphorylated form. I should check if "big tau" is a standard term. Maybe it's a mistranslation or a term used in certain contexts. Let me think. In some studies, tau can undergo alternative splicing, leading to different isoforms. For example, the presence of exons 2 and 3 in tau results in longer isoforms, which are more prone to aggregation. Alternatively, "big tau" might refer to the phosphorylated form, which is more toxic. I need to verify this. Since I can't rely solely on memory, I should use the available tools. The user wants sources, so using PubMed would be appropriate here. Let me search PubMed for "big tau neurodegeneration" to find relevant studies. Alternatively, maybe the term is "hyperphosphorylated tau" or "phosphorylated tau." If the search doesn't yield results, I might need to use Wikipedia or DuckDuckGo. But given the biomedical nature, PubMed is the best bet. Wait, the user might be referring to the "big" tau as in the longer isoforms. Let me check. For example, tau with exons 2 and 3 included is called "tau-46" or "tau-44" depending on the exact exons. These longer isoforms are more likely to form aggregates. Alternatively, "big tau" could be a term used in some literature. I should perform a PubMed search with the query "big tau neurodegeneration" to see if there are any relevant articles. If there are, I can cite those. If not, maybe the term is not standard, and I should explain the role of tau isoforms or phosphorylated tau in neurodegeneration. Another possibility is that "big tau" refers to the tau protein in its aggregated form, such as in neurofibrillary tangles. In that case, the role is as a pathological hallmark of diseases like Alzheimer's. So, I'll start by using the PubMed function to search for "big tau neurodegeneration" and see what comes up. If there are results, I can reference them. If not, I'll have to explain the general role of tau in neurodegeneration, possibly mentioning isoforms and phosphorylation. </think> Tool Calls: PubMed (99c3f9ec-29c6-4312-b32f-4fb6b8c234b2) Call ID: 99c3f9ec-29c6-4312-b32f-4fb6b8c234b2 Args: query: big tau neurodegeneration ================================= Tool Message ================================= Name: PubMed Published: 2025-09-03 Title: Emerging roles for innate and adaptive immunity in tauopathies. Copyright Information: Copyright © 2025 The Author(s). Published by Elsevier Inc. All rights reserved. Summary:: Tauopathies encompass a large majority of dementia diagnoses and are characterized by toxic neuronal or glial inclusions of the microtubule-associated protein tau. Tau has a high propensity to induce prion-like spreading throughout the brain via a variety of mechanisms, making tauopathy a rapid and lethal form of neurodegeneration that currently lacks an effective therapy or cure. Tau aggregation and neuronal loss associated with this pathology are accompanied by robust neuroinflammation. Innate immune responses-particularly those involving microglial activation, altered lipid metabolism, and type I interferon signaling-have emerged as key drivers of tau hyperphosphorylation and aggregation. Recent advances also point to a significant role for the adaptive immune system in shaping tauopathy progression. This review examines the current understanding of innate immunity in tauopathies and highlights emerging evidence linking T cell responses to tauopathy progression. Last, we conclude with a discussion of potential ways in which the immune system can be harnessed to treat tauopathy. Published: 2025-08-28 Title: Glycogen synthase kinase-3: the master switch driving neurodegeneration in Alzheimer's disease and Parkinson's disease. Copyright Information: © 2025. The Author(s), under exclusive licence to Springer-Verlag GmbH Germany, part of Springer Nature. Summary:: 3 Glycogen synthase kinase-3 (GSK-3) is a critical serine/threonine kinase that plays a central role in regulating various cellular processes. In the nervous system, GSK-3 is particularly implicated in the pathogenesis of neurodegenerative diseases such as Alzheimer's disease and Parkinson's disease. Recent studies have demonstrated that GSK-3 modulates multiple pathological mechanisms through diverse sig ================================== Ai Message ================================== <think> Okay, the user asked about the role of "big tau" in neurodegeneration. I need to make sure I understand what "big tau" refers to. From my initial thought, maybe it's a term for hyperphosphorylated tau or a specific isoform. The PubMed search results didn't mention "big tau" directly, but the first article talks about tauopathies and prion-like spreading. The second article mentions GSK-3's role in Alzheimer's and Parkinson's, which are tau-related diseases. Since "big tau" isn't a standard term in the search results, I should explain the general role of tau in neurodegeneration. Tau proteins, when hyperphosphorylated, form neurofibrillary tangles, which are a hallmark of Alzheimer's. The prion-like spreading of tau aggregates contributes to the progressive neurodegeneration. The first article also mentions innate immunity's role in exacerbating tau pathology. I should clarify that "big tau" might not be a recognized term but could refer to these pathological forms. I'll cite the PubMed articles to support the role of tau in neurodegenerative diseases, even if the exact term isn't found. It's important to mention the mechanisms like hyperphosphorylation, aggregation, and immune system involvement as per the sources. </think> The term "big tau" is not a standard nomenclature in neurodegenerative disease research, but it may refer to **hyperphosphorylated tau** or **pathological tau aggregates** (e.g., neurofibrillary tangles) that drive neurodegeneration. Below is a synthesis of its role based on current biomedical evidence: --- ### **Role of Pathological Tau in Neurodegeneration** 1. **Hyperphosphorylation and Aggregation** Tau proteins, when hyperphosphorylated, lose their ability to stabilize microtubules and instead form insoluble fibrillary aggregates (neurofibrillary tangles). This process is central to diseases like Alzheimer's disease (AD) and other tauopathies (e.g., Pick's disease, progressive supranuclear palsy). - **Mechanism**: Hyperphosphorylation disrupts tau's interaction with microtubules, leading to cytoskeletal destabilization and neuronal dysfunction. - **Source**: The article *"Emerging roles for innate and adaptive immunity in tauopathies"* (2025) highlights tau's prion-like spreading via extracellular release, exacerbating neurodegeneration. 2. **Prion-Like Propagation** Pathological tau can propagate between neurons, spreading as soluble oligomers that induce misfolding in neighboring cells. This self-propagation drives the progressive nature of tauopathies. - **Source**: The same 2025 review emphasizes tau's role in rapid, lethal neurodegeneration through this mechanism. 3. **Neuroinflammation and Immune System Involvement** Tau aggregation triggers neuroinflammation, with microglial activation and type I interferon signaling amplifying tau hyperphosphorylation and aggregation. Adaptive immune responses (e.g., T cells) may also modulate disease progression. - **Source**: The 2025 review on tauopathies links innate immunity to disease acceleration. 4. **GSK-3 and Tau Pathology** Glycogen synthase kinase-3 (GSK-3) is a key enzyme in tau hyperphosphorylation, contributing to neurodegeneration in AD and Parkinson's disease. - **Source**: The 2025 article on GSK-3 details its role in modulating tau pathology through signaling pathways. --- ### **Conclusion** While "big tau" is not a formal term, pathological forms of tau (hyperphosphorylated or aggregated) are central to neurodegeneration. Their role includes cytoskeletal disruption, prion-like spread, and immune system activation, as evidenced by recent studies. For precise mechanisms, further clarification on the term's context would be needed. **Sources**: 1. *Emerging roles for innate and adaptive immunity in tauopathies* (2025). 2. *Glycogen synthase kinase-3: the master switch driving neurodegeneration in Alzheimer's disease and Parkinson's disease* (2025).
The ReAct agent chose to use the PubMed tool and was able to provide only real references.
19.8 Learn more
Visit the LangGraph documentation to learn more about building agents with LangGraph.