This repository has been archived on 2026-04-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
apush-rag/notebooks/query.ipynb
2026-03-30 19:38:37 -05:00

773 lines
70 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "bb92b402",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/keshav/code/apush-rag/.venv/lib/python3.14/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
"import json\n",
"import re\n",
"from pathlib import Path\n",
"from sentence_transformers import SentenceTransformer\n",
"from qdrant_client import QdrantClient\n",
"from openai import OpenAI\n",
"from rich.console import Console\n",
"from rich.panel import Panel\n",
"from rich.text import Text\n",
"from rich import print as rprint"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c889967b",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n",
"<All keys matched successfully>\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"All loaded ✓\n"
]
}
],
"source": [
"project_root = Path().resolve().parent\n",
"\n",
"# Embedding model\n",
"model = SentenceTransformer(\"nomic-ai/nomic-embed-text-v1.5\", trust_remote_code=True)\n",
"\n",
"# Qdrant\n",
"qdrant = QdrantClient(path=str(project_root / \"data\" / \"qdrant_local\"))\n",
"COLLECTION = \"apush_chunks\"\n",
"\n",
"# Parent lookup\n",
"with open(project_root / \"data\" / \"processed\" / \"parent_lookup.json\") as f:\n",
" parent_lookup = json.load(f)\n",
"\n",
"# Local Qwen via llama-server\n",
"llm = OpenAI(\n",
" base_url=\"http://127.0.0.1:11434/v1\",\n",
" api_key=\"not-needed\",\n",
")\n",
"\n",
"console = Console()\n",
"print(\"All loaded ✓\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "863a7515",
"metadata": {},
"outputs": [],
"source": [
"def embed_query(query: str) -> list[float]:\n",
" return model.encode(\n",
" f\"search_query: {query}\",\n",
" normalize_embeddings=True,\n",
" ).tolist()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "b90a4761",
"metadata": {},
"outputs": [],
"source": [
"TOP_K = 5 # fetch more, re-rank by score\n",
"\n",
"def retrieve(query: str) -> dict:\n",
" hits = qdrant.query_points(\n",
" collection_name=COLLECTION,\n",
" query=embed_query(query),\n",
" limit=TOP_K,\n",
" ).points\n",
"\n",
" # Confidence tiers based on top score\n",
" top_score = hits[0].score if hits else 0\n",
" if top_score >= 0.82:\n",
" confidence = \"HIGH\"\n",
" conf_color = \"green\"\n",
" elif top_score >= 0.62:\n",
" confidence = \"MEDIUM\"\n",
" conf_color = \"yellow\"\n",
" else:\n",
" confidence = \"LOW\"\n",
" conf_color = \"red\"\n",
"\n",
" # Deduplicate by parent_id — no point fetching same section twice\n",
" seen_parents = set()\n",
" unique_hits = []\n",
" for h in hits:\n",
" pid = h.payload[\"parent_id\"]\n",
" if pid not in seen_parents:\n",
" seen_parents.add(pid)\n",
" unique_hits.append(h)\n",
"\n",
" # Fetch full parent text for each unique hit\n",
" sources = []\n",
" for h in unique_hits:\n",
" pid = h.payload[\"parent_id\"]\n",
" parts = parent_lookup.get(pid, [])\n",
" full_text = \"\\n\\n\".join(p[\"text\"] for p in parts)\n",
"\n",
" sources.append({\n",
" \"score\": h.score,\n",
" \"chapter_num\": h.payload[\"chapter_num\"],\n",
" \"chapter_title\": h.payload[\"chapter_title\"],\n",
" \"section_title\": h.payload[\"section_title\"],\n",
" \"textbook_page\": h.payload[\"textbook_page\"],\n",
" \"text\": full_text,\n",
" })\n",
"\n",
" return {\n",
" \"query\": query,\n",
" \"confidence\": confidence,\n",
" \"conf_color\": conf_color,\n",
" \"top_score\": top_score,\n",
" \"sources\": sources,\n",
" }"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "98205255",
"metadata": {},
"outputs": [],
"source": [
"SYSTEM_PROMPT = SYSTEM_PROMPT = \"\"\"You are an expert AP US History tutor. Do not think before answering. Answer immediately and directly.\n",
"Answer the student's question using ONLY the textbook passages provided...if u use outside info state it explicitly\n",
"Rules:\n",
"- Be accurate and specific — cite section and page number inline like (Ch5, p.153)\n",
"- If the passages don't fully answer the question, say so clearly\n",
"- Never invent facts not present in the passages\n",
"- If you don't know or you think something about the question is wrong don't reinforce...admit it\n",
"- Questions outside the textbook should be answered fast but with a disclaimer that it isn't in the textbook\n",
"- Don't yap for too long...keep it direct and correct yet lenghty enough to be very very detailed and a great response\n",
"- Asnwer in a format that suits the detail needed to answer the question (e.g. a full very long essay for LEQ, 1 pagaraph detailed response for SAQ, one word if one wrod, etc....answer normally bnut with great details)\n",
"- ANSWER ASAP, and keep answers lss than 8192 tokens if you don't know anwer very very brielfy in like 1 workd\n",
"\"\"\"\n",
"\n",
"def synthesize(retrieved: dict) -> str:\n",
" context_parts = []\n",
" for s in retrieved[\"sources\"]:\n",
" context_parts.append(\n",
" f\"[Ch{s['chapter_num']} {s['section_title']} p.{s['textbook_page']}]\\n{s['text']}\"\n",
" )\n",
" context = \"\\n\\n---\\n\\n\".join(context_parts)\n",
"\n",
" user_message = f\"<|im_start|>user\\n/no_think\\n\\nTEXTBOOK PASSAGES:\\n{context}\\n\\nQUESTION: {retrieved['query']}<|im_end|>\\n<|im_start|>assistant\\n\"\n",
" messages = [\n",
" {\"role\": \"system\", \"content\": SYSTEM_PROMPT},\n",
" {\"role\": \"user\", \"content\": user_message},\n",
" ]\n",
"\n",
" response = llm.chat.completions.create(\n",
" model=\"qwen3.5-9b\",\n",
" messages=messages,\n",
" max_tokens=2048,\n",
" temperature=0.1,\n",
" extra_body={\"thinking\": False}, # hard disable at llama.cpp level\n",
" )\n",
" print(\"RAW:\", repr(response.choices[0].message.content))\n",
"\n",
" content = response.choices[0].message.content\n",
"\n",
" # Strip any leftover think tags just in case\n",
" if content:\n",
" content = re.sub(r\"<think>.*?</think>\", \"\", content, flags=re.DOTALL).strip()\n",
"\n",
" # If still empty, model ignored /no_think — extract from reasoning_content\n",
" if not content:\n",
" raw = getattr(response.choices[0].message, \"reasoning_content\", \"\") or \"\"\n",
" if \"</think>\" in raw:\n",
" content = raw.split(\"</think>\")[-1].strip()\n",
"\n",
" return content or \"⚠ Model returned empty response\""
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "2515b025",
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display, Markdown\n",
"\n",
"def display_answer(retrieved: dict, answer: str):\n",
" conf = retrieved[\"confidence\"]\n",
" score = retrieved[\"top_score\"]\n",
" colors = {\"HIGH\": \"🟢\", \"MEDIUM\": \"🟡\", \"LOW\": \"🔴\"}\n",
" icon = colors[conf]\n",
"\n",
" md = f\"\"\"\n",
"{icon} **CONFIDENCE: {conf}** (score: {score:.3f})\n",
"\n",
"---\n",
"\n",
"### Q: {retrieved['query']}\n",
"\n",
"{answer}\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\"\"\"\n",
" for i, s in enumerate(retrieved[\"sources\"], 1):\n",
" snippet = s[\"text\"][:200].replace(\"\\n\", \" \")\n",
" md += f\"\\n**[{i}]** Ch{s['chapter_num']} {s['section_title']} p.{s['textbook_page']} *(score: {s['score']:.3f})*\\n> {snippet}...\\n\"\n",
"\n",
" display(Markdown(md))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "e1cfea1b",
"metadata": {},
"outputs": [],
"source": [
"def ask(query: str):\n",
" retrieved = retrieve(query)\n",
" answer = synthesize(retrieved)\n",
" display_answer(retrieved, answer)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "d38bd0bd",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: 'Based on the provided textbook passages, **Martin Luther King Jr. did not agree with Malcolm X.** In fact, the texts describe their philosophies as fundamentally opposed.\\n\\nThe passages explicitly state that Malcolm X was a \"sharp critic of the ideas of integration and nonviolence, and of Kings practice of appealing to American values.\" Malcolm X proclaimed, \"I don\\'t see any American dream. I see an American nightmare,\" and called for Black self-defense against violence, whereas King advocated for nonviolent resistance and a \"revolution in values\" to create a better distribution of wealth for \"all God\\'s children.\"\\n\\nHowever, the texts do note a point of convergence regarding **economic justice and the failure of the federal government to address poverty**, which eventually led King to adopt more radical language similar to Malcolm X\\'s earlier critiques:\\n\\n1. **Shared Focus on Economic Grievances:** Both leaders recognized that civil rights legislation (voting rights, desegregation) did not solve the material deprivation of Black Americans. King declared that \"voting rights... could not be eaten or made into clothing and shelter.\" He called for a \"Bill of Rights for the Disadvantaged\" and a \"revolution in values\" to address wealth distribution, moving beyond the movement\\'s initial focus on legal equality.\\n2. **Critique of the Status Quo:** Malcolm X criticized the \"American nightmare\" and the failure of the federal government to protect Black citizens. Similarly, King\\'s later rhetoric became more radical as he confronted the \"entrenched power\" of white political machines (like Mayor Daley in Chicago) and the inability of nonviolent tactics to achieve economic goals in the North.\\n3. **Divergent Methods:** Despite these shared frustrations, their methods remained distinct. Malcolm X advocated for Black nationalism, self-defense, and separation from white society (symbolized by dropping his surname to \"X\"). King maintained a commitment to nonviolence and integration, even as his language became more militant.\\n\\nThe texts do not provide evidence of agreement between the two; rather, they highlight Malcolm X\\'s role as an intellectual father of the Black Power movement that emerged as a reaction to the perceived limitations of the integrationist civil rights movement led by King.'\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.642)\n",
"\n",
"---\n",
"\n",
"### Q: why did mlk agree with malcomx so much\n",
"\n",
"Based on the provided textbook passages, **Martin Luther King Jr. did not agree with Malcolm X.** In fact, the texts describe their philosophies as fundamentally opposed.\n",
"\n",
"The passages explicitly state that Malcolm X was a \"sharp critic of the ideas of integration and nonviolence, and of Kings practice of appealing to American values.\" Malcolm X proclaimed, \"I don't see any American dream. I see an American nightmare,\" and called for Black self-defense against violence, whereas King advocated for nonviolent resistance and a \"revolution in values\" to create a better distribution of wealth for \"all God's children.\"\n",
"\n",
"However, the texts do note a point of convergence regarding **economic justice and the failure of the federal government to address poverty**, which eventually led King to adopt more radical language similar to Malcolm X's earlier critiques:\n",
"\n",
"1. **Shared Focus on Economic Grievances:** Both leaders recognized that civil rights legislation (voting rights, desegregation) did not solve the material deprivation of Black Americans. King declared that \"voting rights... could not be eaten or made into clothing and shelter.\" He called for a \"Bill of Rights for the Disadvantaged\" and a \"revolution in values\" to address wealth distribution, moving beyond the movement's initial focus on legal equality.\n",
"2. **Critique of the Status Quo:** Malcolm X criticized the \"American nightmare\" and the failure of the federal government to protect Black citizens. Similarly, King's later rhetoric became more radical as he confronted the \"entrenched power\" of white political machines (like Mayor Daley in Chicago) and the inability of nonviolent tactics to achieve economic goals in the North.\n",
"3. **Divergent Methods:** Despite these shared frustrations, their methods remained distinct. Malcolm X advocated for Black nationalism, self-defense, and separation from white society (symbolized by dropping his surname to \"X\"). King maintained a commitment to nonviolence and integration, even as his language became more militant.\n",
"\n",
"The texts do not provide evidence of agreement between the two; rather, they highlight Malcolm X's role as an intellectual father of the Black Power movement that emerged as a reaction to the perceived limitations of the integrationist civil rights movement led by King.\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch25 The Changing Black Movement p.826 *(score: 0.642)*\n",
"> Even at its moment of triumph, the civil rights movement confronted a crisis as it sought to move from access to schools, public accommodations, and the voting booth to the economic divide separating ...\n",
"\n",
"**[2]** Ch25 The Civil Rights Revolution p.816 *(score: 0.641)*\n",
"> With the sit-ins, college students for the first time stepped onto the stage of American history as the leading force for social change. In April 1960, Ella Baker, a longtime civil rights organizer, c...\n",
"\n",
"**[3]** Ch13 Fruits of Manifest Destiny p.385 *(score: 0.638)*\n",
"> In the 1840s, slavery moved to the center stage of American politics. It did so not in the moral language or with the immediatist program of abolitionism, but as a result of the nations territorial e...\n",
"\n",
"**[4]** Ch25 1968 p.844 *(score: 0.637)*\n",
"> The Sixties reached their climax in 1968, a year when momentous events succeeded each other so rapidly that the foundations of society seemed to be dissolving. Late January 1968 saw the Tet offensive,...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"why did mlk agree with malcomx so much\")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "c9047e77",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: 'Based on the provided textbook passages, the premise of your question is incorrect. The U.S. government did **not** treat Japanese Americans well during World War II; it subjected them to one of the most severe violations of civil liberties in American history.\\n\\nAccording to the text, the government treated Japanese Americans poorly for the following reasons:\\n\\n* **Mass Internment:** In February 1942, President Roosevelt issued **Executive Order 9066**, which ordered the removal of all persons of Japanese descent from the West Coast. This resulted in the forced relocation of more than **110,000 men, women, and children**, nearly two-thirds of whom were **American citizens** (nisei). They were moved to internment camps behind barbed-wire fences, often living in makeshift shacks or former horse stables (Ch22, p.729).\\n* **Lack of Due Process:** The text states there were \"no court hearings, no due process, and no writs of habeas corpus.\" The Supreme Court upheld this policy in *Korematsu v. United States* (1944), with Justice Hugo Black insisting the order was not based on race but on military necessity, though Justice Jackson\\'s dissent argued it was a \"subtle blow to liberty\" and that guilt should not be inheritable (Ch22, p.729).\\n* **Racial Prejudice and Propaganda:** The text notes that long-standing prejudices combined with the attack on Pearl Harbor produced \"unprecedented hatred of Japan.\" Propaganda portrayed Japanese Americans as potential spies, rats, dogs, and snakes, blaming aggression on a \"violent racial or national character\" rather than tyrannical rulers (Ch22, p.729).\\n* **Harsh Conditions:** Internees were subjected to \"quasi-military discipline,\" including early roll calls, armed guards, and searchlights shining all night. Privacy was difficult, and medical facilities were often nonexistent (Ch22, p.729).\\n* **Contrast with Other Groups:** The text explicitly contrasts this treatment with German and Italian Americans, noting the government \"bent over backward to include\" them, arresting only a handful of nationals while viewing every person of Japanese ethnicity as a potential spy (Ch22, p.729).\\n\\nWhile the government did market war bonds to internees and established a loyalty oath program, the text describes the internment as the \"largest violation of American civil liberties in the twentieth century\" and notes that the Supreme Court later repudiated the *Korematsu* decision in 2018, calling it \"gravely wrong\" (Ch22, p.729).'\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.771)\n",
"\n",
"---\n",
"\n",
"### Q: why did the us govt treat japanese americans so well in ww2\n",
"\n",
"Based on the provided textbook passages, the premise of your question is incorrect. The U.S. government did **not** treat Japanese Americans well during World War II; it subjected them to one of the most severe violations of civil liberties in American history.\n",
"\n",
"According to the text, the government treated Japanese Americans poorly for the following reasons:\n",
"\n",
"* **Mass Internment:** In February 1942, President Roosevelt issued **Executive Order 9066**, which ordered the removal of all persons of Japanese descent from the West Coast. This resulted in the forced relocation of more than **110,000 men, women, and children**, nearly two-thirds of whom were **American citizens** (nisei). They were moved to internment camps behind barbed-wire fences, often living in makeshift shacks or former horse stables (Ch22, p.729).\n",
"* **Lack of Due Process:** The text states there were \"no court hearings, no due process, and no writs of habeas corpus.\" The Supreme Court upheld this policy in *Korematsu v. United States* (1944), with Justice Hugo Black insisting the order was not based on race but on military necessity, though Justice Jackson's dissent argued it was a \"subtle blow to liberty\" and that guilt should not be inheritable (Ch22, p.729).\n",
"* **Racial Prejudice and Propaganda:** The text notes that long-standing prejudices combined with the attack on Pearl Harbor produced \"unprecedented hatred of Japan.\" Propaganda portrayed Japanese Americans as potential spies, rats, dogs, and snakes, blaming aggression on a \"violent racial or national character\" rather than tyrannical rulers (Ch22, p.729).\n",
"* **Harsh Conditions:** Internees were subjected to \"quasi-military discipline,\" including early roll calls, armed guards, and searchlights shining all night. Privacy was difficult, and medical facilities were often nonexistent (Ch22, p.729).\n",
"* **Contrast with Other Groups:** The text explicitly contrasts this treatment with German and Italian Americans, noting the government \"bent over backward to include\" them, arresting only a handful of nationals while viewing every person of Japanese ethnicity as a potential spy (Ch22, p.729).\n",
"\n",
"While the government did market war bonds to internees and established a loyalty oath program, the text describes the internment as the \"largest violation of American civil liberties in the twentieth century\" and notes that the Supreme Court later repudiated the *Korematsu* decision in 2018, calling it \"gravely wrong\" (Ch22, p.729).\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch22 The American Dilemma p.729 *(score: 0.771)*\n",
"> The unprecedented attention to freedom as the defining characteristic of American life had implications that went far beyond wartime mobilization. World War II reshaped Americans understanding of the...\n",
"\n",
"**[2]** Ch22 Chapter 22: Fighting for the Four Freedoms: World War II, 1941⠍1945 p.712 *(score: 0.770)*\n",
"> What steps led to American participation in World War II? How did the United States mobilize economic resources and promote popular support for the war effort? What visions of Americas postwar role b...\n",
"\n",
"**[3]** Ch22 Chapter Review p.746 *(score: 0.749)*\n",
"> 1. Why did most Americans support isolationism in the 1930s? 2. What factors after 1939 led to U.S. involvement in World War II? 3. How did government, business, and labor work together to promote wa...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"why did the us govt treat japanese americans so well in ww2\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "ea66da95",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: 'Here are specific New Deal policies with dates and detailed evidence from the provided textbook passages, organized for use in an LEQ (Long Essay Question):\\n\\n**1. Financial Stabilization and Banking Reform (1933)**\\n* **Emergency Banking Act (March 1933):** Declared a \"bank holiday\" to halt all bank operations, then provided funds to shore up threatened institutions (Ch21, p.680).\\n* **Glass-Steagall Act (1933):** Barred commercial banks from buying/selling stocks and established the **Federal Deposit Insurance Corporation (FDIC)** to insure individual depositor accounts (Ch21, p.680).\\n* **Taking off the Gold Standard (1933):** Severed the link between currency and gold reserves to allow issuance of more money to stimulate business activity (Ch21, p.680).\\n\\n**2. Public Works and Regional Development (19331934)**\\n* **Civilian Conservation Corps (CCC) (March 1933):** Employed unemployed young men on forest preservation, flood control, and park improvement projects; paid $30/month; over 3 million passed through camps by 1942 (Ch21, p.680).\\n* **Public Works Administration (PWA) (1933):** Directed by Harold Ickes; contracted with private construction companies to build roads, schools, hospitals, and public facilities (e.g., Triborough Bridge, Overseas Highway); appropriated $3.3 billion (Ch21, p.680).\\n* **Civil Works Administration (CWA) (November 1933):** Directly hired workers for construction projects (highways, tunnels, airports); employed over 4 million by January 1934 before being dissolved due to spiraling costs (Ch21, p.680).\\n* **Tennessee Valley Authority (TVA) (1933):** Built dams to prevent floods/deforestation and provide cheap electric power in a seven-state region; put the federal government in the business of selling electricity in competition with private companies (Ch21, p.680).\\n* **Grand Coulee Dam (1941 operation):** Largest man-made structure in world history; produced >40% of nations hydroelectric power; created thousands of jobs but caused environmental costs (salmon extinction) and displaced Colville tribes (Ch21, p.678).\\n\\n**3. Agricultural Relief (1933)**\\n* **Agricultural Adjustment Act (AAA) (1933):** Authorized government to set production quotas and pay farmers to plant less to raise prices; ordered 6+ million pigs slaughtered in 1933 (Ch21, p.680).\\n* **Impact:** Raised farm prices/incomes but ignored landless workers; encouraged eviction of tenants/sharecroppers; failed to help Dust Bowl victims (Ch21, p.680).\\n\\n**4. Labor Rights and Unionization (19331935)**\\n* **National Industrial Recovery Act (NRA) (1933):** Established industry codes for output, prices, and working conditions; Section 7a recognized workers right to organize unions (Ch21, p.680).\\n* **Wagner Act (National Labor Relations Act of 1935):** Established the **National Labor Relations Board (NLRB)** to regulate employment/bargaining practices and facilitate unionization (Ch21, p.708).\\n* **Congress of Industrial Organizations (CIO) (1935):** Umbrella organization of semiskilled industrial unions formed as Committee for Industrial Organization, renamed in 1938 (Ch21, p.708).\\n* **Sit-down Strikes (mid-1930s):** Tactic where workers refused to leave factories, making production impossible; proved effective for CIO organizing drives (Ch21, p.708).\\n\\n**5. Social Welfare and Housing (19331935)**\\n* **Federal Emergency Relief Administration (FERA) (May 1933):** Made grants to local agencies to aid impoverished citizens (Ch21, p.680).\\n* **Social Security Act (1935):** Created Social Security system with retirement pensions, unemployment insurance, disability insurance, and public assistance (welfare) (Ch21, p.708).\\n* **Home Owners Loan Corporation (1933) & Federal Housing Administration (FHA) (19331934):** Insured long-term mortgages to protect homeowners from foreclosure and stimulate construction; FHA guaranteed mortgages with low down payments (Ch21, p.680).\\n* **Resettlement Administration (1934):** Relocated rural/urban families to federally planned communities (e.g., Greenbelt near Washington, D.C.) (Ch21, p.680).\\n\\n**6. Communication and Cultural Reform (1933)**\\n* **Federal Communications Commission (FCC) (1933):** Established to oversee broadcast airwaves and telephone communications (Ch21, p.680).\\n* **Securities and Exchange Commission (SEC) (1933):** Created to regulate stock and bond markets (Ch21, p.680).\\n* **Works Progress Administration (WPA) (Second New Deal):** Provided jobs for millions on construction and arts projects (Ch21, p.708).\\n\\n**7. Native American Policy (1934)**\\n* **Indian Reorganization Act (1934):** Increased access for Native Americans to land and self-governance; part of the \"Indian New Deal\" (Ch21, p.708).\\n\\n**8. Prohibition Repeal (1933)**\\n* **Twenty-first Amendment (1933):** Ratified to repeal the Eighteenth Amendment, legalizing manufacture/transportation/sale of alcoholic beverages (Ch21, p.680).\\n\\n**9. Postwar Economic Vision (19421944)**\\n* **National Resources Planning Board (NRPB) Reports (19421943):** Proposed \"full-employment economy,\" expanded welfare state, and \"new bill of rights\" including education, healthcare, housing, and jobs (Ch22, p.727).\\n* **Economic Bill of Rights (1944):** FDRs proposal for full employment, adequate income, medical care, education, and decent home for all Americans (Ch22, p.727).\\n* **GI Bill of Rights (Servicemens Readjustment Act of 1944):** Provided unemployment pay, scholarships, low-cost mortgages, pensions, and job training to veterans; by 1946, 1 million attended college, 4 million received home mortgages (Ch22, p.727).\\n* **Full Employment Bill (19451946):** Attempted to establish \"right to employment\" for all Americans; passed in 1946 only after \"Full\" was removed and commitment to government job creation eliminated (Ch22, p.727).'\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.692)\n",
"\n",
"---\n",
"\n",
"### Q: which are some new deal policies bullet point evidences with dates in great detail i can use for my LEQ\n",
"\n",
"Here are specific New Deal policies with dates and detailed evidence from the provided textbook passages, organized for use in an LEQ (Long Essay Question):\n",
"\n",
"**1. Financial Stabilization and Banking Reform (1933)**\n",
"* **Emergency Banking Act (March 1933):** Declared a \"bank holiday\" to halt all bank operations, then provided funds to shore up threatened institutions (Ch21, p.680).\n",
"* **Glass-Steagall Act (1933):** Barred commercial banks from buying/selling stocks and established the **Federal Deposit Insurance Corporation (FDIC)** to insure individual depositor accounts (Ch21, p.680).\n",
"* **Taking off the Gold Standard (1933):** Severed the link between currency and gold reserves to allow issuance of more money to stimulate business activity (Ch21, p.680).\n",
"\n",
"**2. Public Works and Regional Development (19331934)**\n",
"* **Civilian Conservation Corps (CCC) (March 1933):** Employed unemployed young men on forest preservation, flood control, and park improvement projects; paid $30/month; over 3 million passed through camps by 1942 (Ch21, p.680).\n",
"* **Public Works Administration (PWA) (1933):** Directed by Harold Ickes; contracted with private construction companies to build roads, schools, hospitals, and public facilities (e.g., Triborough Bridge, Overseas Highway); appropriated $3.3 billion (Ch21, p.680).\n",
"* **Civil Works Administration (CWA) (November 1933):** Directly hired workers for construction projects (highways, tunnels, airports); employed over 4 million by January 1934 before being dissolved due to spiraling costs (Ch21, p.680).\n",
"* **Tennessee Valley Authority (TVA) (1933):** Built dams to prevent floods/deforestation and provide cheap electric power in a seven-state region; put the federal government in the business of selling electricity in competition with private companies (Ch21, p.680).\n",
"* **Grand Coulee Dam (1941 operation):** Largest man-made structure in world history; produced >40% of nations hydroelectric power; created thousands of jobs but caused environmental costs (salmon extinction) and displaced Colville tribes (Ch21, p.678).\n",
"\n",
"**3. Agricultural Relief (1933)**\n",
"* **Agricultural Adjustment Act (AAA) (1933):** Authorized government to set production quotas and pay farmers to plant less to raise prices; ordered 6+ million pigs slaughtered in 1933 (Ch21, p.680).\n",
"* **Impact:** Raised farm prices/incomes but ignored landless workers; encouraged eviction of tenants/sharecroppers; failed to help Dust Bowl victims (Ch21, p.680).\n",
"\n",
"**4. Labor Rights and Unionization (19331935)**\n",
"* **National Industrial Recovery Act (NRA) (1933):** Established industry codes for output, prices, and working conditions; Section 7a recognized workers right to organize unions (Ch21, p.680).\n",
"* **Wagner Act (National Labor Relations Act of 1935):** Established the **National Labor Relations Board (NLRB)** to regulate employment/bargaining practices and facilitate unionization (Ch21, p.708).\n",
"* **Congress of Industrial Organizations (CIO) (1935):** Umbrella organization of semiskilled industrial unions formed as Committee for Industrial Organization, renamed in 1938 (Ch21, p.708).\n",
"* **Sit-down Strikes (mid-1930s):** Tactic where workers refused to leave factories, making production impossible; proved effective for CIO organizing drives (Ch21, p.708).\n",
"\n",
"**5. Social Welfare and Housing (19331935)**\n",
"* **Federal Emergency Relief Administration (FERA) (May 1933):** Made grants to local agencies to aid impoverished citizens (Ch21, p.680).\n",
"* **Social Security Act (1935):** Created Social Security system with retirement pensions, unemployment insurance, disability insurance, and public assistance (welfare) (Ch21, p.708).\n",
"* **Home Owners Loan Corporation (1933) & Federal Housing Administration (FHA) (19331934):** Insured long-term mortgages to protect homeowners from foreclosure and stimulate construction; FHA guaranteed mortgages with low down payments (Ch21, p.680).\n",
"* **Resettlement Administration (1934):** Relocated rural/urban families to federally planned communities (e.g., Greenbelt near Washington, D.C.) (Ch21, p.680).\n",
"\n",
"**6. Communication and Cultural Reform (1933)**\n",
"* **Federal Communications Commission (FCC) (1933):** Established to oversee broadcast airwaves and telephone communications (Ch21, p.680).\n",
"* **Securities and Exchange Commission (SEC) (1933):** Created to regulate stock and bond markets (Ch21, p.680).\n",
"* **Works Progress Administration (WPA) (Second New Deal):** Provided jobs for millions on construction and arts projects (Ch21, p.708).\n",
"\n",
"**7. Native American Policy (1934)**\n",
"* **Indian Reorganization Act (1934):** Increased access for Native Americans to land and self-governance; part of the \"Indian New Deal\" (Ch21, p.708).\n",
"\n",
"**8. Prohibition Repeal (1933)**\n",
"* **Twenty-first Amendment (1933):** Ratified to repeal the Eighteenth Amendment, legalizing manufacture/transportation/sale of alcoholic beverages (Ch21, p.680).\n",
"\n",
"**9. Postwar Economic Vision (19421944)**\n",
"* **National Resources Planning Board (NRPB) Reports (19421943):** Proposed \"full-employment economy,\" expanded welfare state, and \"new bill of rights\" including education, healthcare, housing, and jobs (Ch22, p.727).\n",
"* **Economic Bill of Rights (1944):** FDRs proposal for full employment, adequate income, medical care, education, and decent home for all Americans (Ch22, p.727).\n",
"* **GI Bill of Rights (Servicemens Readjustment Act of 1944):** Provided unemployment pay, scholarships, low-cost mortgages, pensions, and job training to veterans; by 1946, 1 million attended college, 4 million received home mortgages (Ch22, p.727).\n",
"* **Full Employment Bill (19451946):** Attempted to establish \"right to employment\" for all Americans; passed in 1946 only after \"Full\" was removed and commitment to government job creation eliminated (Ch22, p.727).\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch22 Visions of Postwar Freedom p.727 *(score: 0.692)*\n",
"> The prospect of an affluent future provided a point of unity between New Dealers and conservatives, business and labor. And the promise of prosperity to some extent united two of the most celebrated b...\n",
"\n",
"**[2]** Ch21 Chapter 21: The New Deal, 1932⠍1940 p.678 *(score: 0.682)*\n",
"> What were the major policy initiatives of the New Deal in the Hundred Days? Who were the main proponents of economic justice in the 1930s, and what measures did they advocate? What were the major init...\n",
"\n",
"**[3]** Ch26 The Reagan Revolution p.877 *(score: 0.682)*\n",
"> Ronald Reagan followed a most unusual path to the presidency. Originally a New Deal Democrat and head of the Screen Actors Guild (the only union leader ever to reach the White House), he emerged in th...\n",
"\n",
"**[4]** Ch21 The First New Deal p.680 *(score: 0.675)*\n",
"> It is indeed paradoxical that Franklin D. Roosevelt, who had been raised in privilege on a New York country estate, came to be beloved as the symbolic representative of ordinary citizens. But like Lin...\n",
"\n",
"**[5]** Ch21 Chapter Review p.708 *(score: 0.675)*\n",
"> and the Columbia River project reflected broader changes in American life during the New Deal. 2. What actions did President Roosevelt and Congress take to help the banking system recover as well as ...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"which are some new deal policies bullet point evidences with dates in great detail i can use for my LEQ\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "4415fcca",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: 'The provided textbook passages do not contain information about who invented calculus or the centrifuge. Therefore, I cannot answer this question using only the text provided.\\n\\nHowever, based on general historical knowledge (outside the provided text):\\n\\n* **Calculus** was independently developed in the mid-17th century by **Isaac Newton** (England) and **Gottfried Wilhelm Leibniz** (Germany). Newton developed it first (around 16651666) but published later; Leibniz published his version first (1684) and developed the notation still used today.\\n* The **centrifuge** was invented in the 19th century. The first practical centrifuge was developed by **John Benjamin Dancer** in 1864, who created a machine to separate blood components. Earlier versions existed in the 18th century (e.g., by **Benjamin Franklin** for separating milk), but Dancer is credited with the first practical laboratory centrifuge.'\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.654)\n",
"\n",
"---\n",
"\n",
"### Q: Who invented caluclus and the cetntrifuge\n",
"\n",
"The provided textbook passages do not contain information about who invented calculus or the centrifuge. Therefore, I cannot answer this question using only the text provided.\n",
"\n",
"However, based on general historical knowledge (outside the provided text):\n",
"\n",
"* **Calculus** was independently developed in the mid-17th century by **Isaac Newton** (England) and **Gottfried Wilhelm Leibniz** (Germany). Newton developed it first (around 16651666) but published later; Leibniz published his version first (1684) and developed the notation still used today.\n",
"* The **centrifuge** was invented in the 19th century. The first practical centrifuge was developed by **John Benjamin Dancer** in 1864, who created a machine to separate blood components. Earlier versions existed in the 18th century (e.g., by **Benjamin Franklin** for separating milk), but Dancer is credited with the first practical laboratory centrifuge.\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch1 Contact p.13 *(score: 0.654)*\n",
"> At the beginning of the fifteenth century, one might have predicted that China would establish the worlds first global empire. Between 1405 and 1433, Admiral Zheng He led seven large naval expedition...\n",
"\n",
"**[2]** Ch9 Chapter Review p.288 *(score: 0.654)*\n",
"> explain how they influenced the market economy. 2. How did state and local governments promote the national economy in respond to competing territorial claims by European or Native nations? 4. How di...\n",
"\n",
"**[3]** Ch5 The Coming of Independence p.153 *(score: 0.630)*\n",
"> Opposition to the Intolerable Acts now spread to small towns and rural areas that had not participated actively in previous resistance. In September 1774, in the town of Worcester, Massachusetts, 4,60...\n",
"\n",
"**[4]** Ch16 Chapter 16: America⠒s Gilded Age, 1870⠍1890 p.500 *(score: 0.610)*\n",
"> What factors combined to make the United States a mature industrial society after the Civil War? How did the economic development of the Gilded Age affect American freedom? How did reformers of the pe...\n",
"\n",
"**[5]** Ch11 Resistance to Slavery p.342 *(score: 0.605)*\n",
"> Confronted with federal, state, and local authorities committed to preserving slavery, and outnumbered within the South as a whole by the white population, slaves could only rarely express their desir...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"Who invented caluclus and the cetntrifuge\")"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "1d5982bb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: 'The provided textbook passages **do not argue** that Martin Luther King Jr. was a \"better\" activist than Rosa Parks. In fact, the text presents both as essential, complementary figures with distinct but equally vital roles in the civil rights movement.\\n\\nHere is the detailed breakdown based **only** on the provided text:\\n\\n1. **Rosa Parks as the Catalyst and Symbol:**\\n * The text identifies Rosa Parks as the spark for the \"mass phase\" of the movement. Her arrest on December 1, 1955, \"sparked a yearlong Montgomery bus boycott\" (Ch24 The Freedom Movement p.799).\\n * She is described as the \"ideal person to become a symbol of the fight\" because she was \"dignified, accomplished,\" and a veteran of Black politics who had already tried to register to vote and served as a secretary to E.D. Nixon (Ch24 The Freedom Movement p.799).\\n * The text emphasizes her role as an \"ordinary Black\" representing the \"determination to resist the daily injustices and indignities of the Jim Crow South\" (Ch24 The Freedom Movement p.799).\\n * Time magazine named her one of the 100 most significant persons of the twentieth century (Ch24 The Freedom Movement p.799).\\n\\n2. **Martin Luther King Jr. as the National Symbol and Orator:**\\n * The text states that the Montgomery Bus Boycott \"marked the emergence of twenty-six-year-old Martin Luther King Jr.... as the movements national symbol\" (Ch24 The Freedom Movement p.799).\\n * King is credited with outlining the movement\\'s philosophy of \"peaceful civil disobedience\" and \"nonviolent resistance,\" drawing on Henry David Thoreau and Mahatma Gandhi (Ch24 The Freedom Movement p.799).\\n * He founded the Southern Christian Leadership Conference (SCLC) in 1956 to press for desegregation (Ch24 The Freedom Movement p.799).\\n * His speeches, such as \"I Have a Dream,\" merged the Black experience with the nation\\'s values and linked the American \"color line\" to the global struggle for freedom (Ch24 The Freedom Movement p.799).\\n\\n3. **The Text\\'s View on Their Relationship:**\\n * The text explicitly states that the civil rights revolution \"built on earlier struggles\" and that Parks\\'s life \"makes clear that the civil rights revolution built on earlier struggles\" (Ch24 The Freedom Movement p.799).\\n * It notes that Parks was a \"veteran of Black politics\" who had been active since the 1930s, implying her activism was foundational and long-standing, whereas King\\'s prominence emerged specifically during the Montgomery boycott (Ch24 The Freedom Movement p.799).\\n * The text does not rank them as \"better\" or \"worse.\" Instead, it portrays Parks as the catalyst who provided the \"symbol of ordinary Blacks determination\" and King as the leader who provided the \"national symbol,\" the philosophical framework, and the organizational structure (SCLC) to expand the movement beyond Montgomery (Ch24 The Freedom Movement p.799).\\n\\n**Conclusion:**\\nThe textbook does not argue that MLK was a better activist. It argues that they played different, necessary roles: Parks was the **catalyst and symbol of ordinary resistance**, while King was the **national leader and strategist** who articulated the movement\\'s philosophy and expanded its reach. The text suggests the movement required both the \"foot soldiers\" like Parks and the \"national symbol\" like King to succeed (Ch24 The Freedom Movement p.799).'\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.714)\n",
"\n",
"---\n",
"\n",
"### Q: why does the textbook argue that mlk was a better activist than rosa parks\n",
"\n",
"The provided textbook passages **do not argue** that Martin Luther King Jr. was a \"better\" activist than Rosa Parks. In fact, the text presents both as essential, complementary figures with distinct but equally vital roles in the civil rights movement.\n",
"\n",
"Here is the detailed breakdown based **only** on the provided text:\n",
"\n",
"1. **Rosa Parks as the Catalyst and Symbol:**\n",
" * The text identifies Rosa Parks as the spark for the \"mass phase\" of the movement. Her arrest on December 1, 1955, \"sparked a yearlong Montgomery bus boycott\" (Ch24 The Freedom Movement p.799).\n",
" * She is described as the \"ideal person to become a symbol of the fight\" because she was \"dignified, accomplished,\" and a veteran of Black politics who had already tried to register to vote and served as a secretary to E.D. Nixon (Ch24 The Freedom Movement p.799).\n",
" * The text emphasizes her role as an \"ordinary Black\" representing the \"determination to resist the daily injustices and indignities of the Jim Crow South\" (Ch24 The Freedom Movement p.799).\n",
" * Time magazine named her one of the 100 most significant persons of the twentieth century (Ch24 The Freedom Movement p.799).\n",
"\n",
"2. **Martin Luther King Jr. as the National Symbol and Orator:**\n",
" * The text states that the Montgomery Bus Boycott \"marked the emergence of twenty-six-year-old Martin Luther King Jr.... as the movements national symbol\" (Ch24 The Freedom Movement p.799).\n",
" * King is credited with outlining the movement's philosophy of \"peaceful civil disobedience\" and \"nonviolent resistance,\" drawing on Henry David Thoreau and Mahatma Gandhi (Ch24 The Freedom Movement p.799).\n",
" * He founded the Southern Christian Leadership Conference (SCLC) in 1956 to press for desegregation (Ch24 The Freedom Movement p.799).\n",
" * His speeches, such as \"I Have a Dream,\" merged the Black experience with the nation's values and linked the American \"color line\" to the global struggle for freedom (Ch24 The Freedom Movement p.799).\n",
"\n",
"3. **The Text's View on Their Relationship:**\n",
" * The text explicitly states that the civil rights revolution \"built on earlier struggles\" and that Parks's life \"makes clear that the civil rights revolution built on earlier struggles\" (Ch24 The Freedom Movement p.799).\n",
" * It notes that Parks was a \"veteran of Black politics\" who had been active since the 1930s, implying her activism was foundational and long-standing, whereas King's prominence emerged specifically during the Montgomery boycott (Ch24 The Freedom Movement p.799).\n",
" * The text does not rank them as \"better\" or \"worse.\" Instead, it portrays Parks as the catalyst who provided the \"symbol of ordinary Blacks determination\" and King as the leader who provided the \"national symbol,\" the philosophical framework, and the organizational structure (SCLC) to expand the movement beyond Montgomery (Ch24 The Freedom Movement p.799).\n",
"\n",
"**Conclusion:**\n",
"The textbook does not argue that MLK was a better activist. It argues that they played different, necessary roles: Parks was the **catalyst and symbol of ordinary resistance**, while King was the **national leader and strategist** who articulated the movement's philosophy and expanded its reach. The text suggests the movement required both the \"foot soldiers\" like Parks and the \"national symbol\" like King to succeed (Ch24 The Freedom Movement p.799).\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch24 Chapter Review p.810 *(score: 0.714)*\n",
"> transformed American life in the 1950s. 3. Identify the prescribed roles and aspirations for women during the patriotic act? 5. How did governmental policies, business practices, and individual choi...\n",
"\n",
"**[2]** Ch24 The Freedom Movement p.799 *(score: 0.711)*\n",
"> Not until the 1960s would young white rebels find their cause, as the seeds of dissent planted by the social critics and Beats flowered in an outpouring of political activism, new attitudes toward sex...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"why does the textbook argue that mlk was a better activist than rosa parks\")"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "8f00c9a7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: '**LEQ Response: The Impact of Salutary Neglect on the American Revolution**\\n\\n**Context:**\\nThe American Revolution was not merely a war for independence from Great Britain, but a profound transformation in the definition of freedom, citizenship, and economic liberty. While the immediate catalyst was taxation without representation, the intellectual and political foundations of the revolution were laid during the era of \"salutary neglect\" in the first half of the 18th century. This period, characterized by weak imperial authority and the self-governance of the colonies, allowed American elites to develop a distinct political culture that prioritized local autonomy and the rights of Englishmen. However, the revolution also had complex and often contradictory consequences for different groups, including Native Americans, enslaved people, and women, as the new nation grappled with the limits of its own ideals of liberty.\\n\\n**Thesis:**\\nThe era of salutary neglect contributed to the American Revolution by fostering a political culture rooted in local self-government and a belief in the rights of Englishmen, which empowered colonial assemblies to challenge British authority; however, the revolution ultimately redefined freedom in ways that expanded political participation for white men while simultaneously diminishing the freedoms of Native Americans, Loyalists, and enslaved people, revealing the tension between the ideal of liberty and the reality of social hierarchy.\\n\\n**Line of Reasoning:**\\n\\nFirst, the era of salutary neglect, in which British governments largely left the colonies to govern themselves, allowed American elites to develop a robust tradition of self-rule that directly challenged British imperial control. During this period, colonial assemblies, dominated by wealthy landowners, merchants, and lawyers, increasingly asserted their power over appointed governors and councils. For example, in Pennsylvania, the assembly eliminated the governor\\'s council to create a unicameral legislature, wresting control of finance and the militia from the Penn family (Ch4, p.120). This experience of self-governance led Americans to view themselves as defenders of \"the people\\'s liberty\" and to believe that assemblies possessed the same rights as the British House of Commons (Ch4, p.120). When Britain attempted to reassert imperial authority through measures like the Stamp Act and the Townshend Acts, colonists interpreted these as violations of their long-held rights to self-determination. The expansion of the \"public sphere\" during this time, with the proliferation of newspapers, clubs, and taverns, further democratized political debate and allowed ordinary citizens to participate in discussions of public affairs, reinforcing the belief that the government should be accountable to the people (Ch4, p.120).\\n\\nSecond, the revolution redefined the concept of economic freedom, shifting from a traditional view that prioritized the public good over individual property rights to a new ideal of \"free labor\" and free trade. During the Revolution, economic dislocations such as inflation and shortages led to debates over price controls. While some advocated for government intervention to fix prices and wages in the name of the public good, the influence of Adam Smith\\'s *The Wealth of Nations* and the belief in the \"invisible hand\" of the market led to the ascendancy of free trade advocates who argued that unregulated economic freedom produced social harmony (Ch6, p.184). This shift sharpened the distinction between a northern economy relying on \"free labor\" and a southern economy dependent on enslaved labor, as the decline of indentured servitude and apprenticeship removed the \"halfway houses\" between slavery and freedom for white men (Ch6, p.184). However, this new economic freedom was built on the dispossession of Native Americans, whose land was necessary to fulfill the vision of widespread land ownership that leaders like Thomas Jefferson and Noah Webster believed was essential for national freedom (Ch6, p.184).\\n\\nThird, while the revolution expanded political participation for white men, it simultaneously diminished the freedoms of Native Americans, Loyalists, and enslaved people, demonstrating that the new nation\\'s definition of liberty was racially and gendered. The war brought destruction to Native Americans who fought on both sides, as British troops burned Catawba towns and American General John Sullivan led an expedition to destroy Haudenosaunee settlements, burning forty towns and destroying thousands of bushels of corn (Ch5, p.162). Although some Native nations like the Oneidas joined the Americans, most Native nations allied with the British to protect their lands from colonial encroachment, and the American victory ultimately led to the loss of Native independence (Ch5, p.162). Similarly, the revolution diminished the freedoms of Loyalists, who faced persecution and the seizure of property by local and state governments, despite the Treaty of Paris promising that they would not suffer persecution (Ch5, p.162). Finally, while the revolution inspired some enslaved people to seek freedom by fighting in the Continental army or fleeing to British lines, slavery became more deeply entrenched in the South, and the boundaries of full citizenship became more rigidly based on race and gender (Ch6, p.176).\\n\\nIn conclusion, the era of salutary neglect was a crucial precursor to the American Revolution, as it allowed colonial elites to cultivate a political culture of self-government and a belief in the rights of Englishmen that fueled resistance to British authority. However, the revolution itself was a complex process that redefined freedom in ways that expanded political and economic liberty for white men while marginalizing Native Americans, Loyalists, and enslaved people. The new nation\\'s commitment to liberty was thus paradoxical, as it sought to secure independence and equality for its citizens while simultaneously denying these rights to others, a tension that would continue to shape American history long after independence was achieved.'\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.705)\n",
"\n",
"---\n",
"\n",
"### Q: How did the era of salutrary neglect contribute to the American revolution...write a full length LEQ with a good context thesis and nuanced line of reasoning able to get full 6/6 on the APUSH LEQ\n",
"\n",
"**LEQ Response: The Impact of Salutary Neglect on the American Revolution**\n",
"\n",
"**Context:**\n",
"The American Revolution was not merely a war for independence from Great Britain, but a profound transformation in the definition of freedom, citizenship, and economic liberty. While the immediate catalyst was taxation without representation, the intellectual and political foundations of the revolution were laid during the era of \"salutary neglect\" in the first half of the 18th century. This period, characterized by weak imperial authority and the self-governance of the colonies, allowed American elites to develop a distinct political culture that prioritized local autonomy and the rights of Englishmen. However, the revolution also had complex and often contradictory consequences for different groups, including Native Americans, enslaved people, and women, as the new nation grappled with the limits of its own ideals of liberty.\n",
"\n",
"**Thesis:**\n",
"The era of salutary neglect contributed to the American Revolution by fostering a political culture rooted in local self-government and a belief in the rights of Englishmen, which empowered colonial assemblies to challenge British authority; however, the revolution ultimately redefined freedom in ways that expanded political participation for white men while simultaneously diminishing the freedoms of Native Americans, Loyalists, and enslaved people, revealing the tension between the ideal of liberty and the reality of social hierarchy.\n",
"\n",
"**Line of Reasoning:**\n",
"\n",
"First, the era of salutary neglect, in which British governments largely left the colonies to govern themselves, allowed American elites to develop a robust tradition of self-rule that directly challenged British imperial control. During this period, colonial assemblies, dominated by wealthy landowners, merchants, and lawyers, increasingly asserted their power over appointed governors and councils. For example, in Pennsylvania, the assembly eliminated the governor's council to create a unicameral legislature, wresting control of finance and the militia from the Penn family (Ch4, p.120). This experience of self-governance led Americans to view themselves as defenders of \"the people's liberty\" and to believe that assemblies possessed the same rights as the British House of Commons (Ch4, p.120). When Britain attempted to reassert imperial authority through measures like the Stamp Act and the Townshend Acts, colonists interpreted these as violations of their long-held rights to self-determination. The expansion of the \"public sphere\" during this time, with the proliferation of newspapers, clubs, and taverns, further democratized political debate and allowed ordinary citizens to participate in discussions of public affairs, reinforcing the belief that the government should be accountable to the people (Ch4, p.120).\n",
"\n",
"Second, the revolution redefined the concept of economic freedom, shifting from a traditional view that prioritized the public good over individual property rights to a new ideal of \"free labor\" and free trade. During the Revolution, economic dislocations such as inflation and shortages led to debates over price controls. While some advocated for government intervention to fix prices and wages in the name of the public good, the influence of Adam Smith's *The Wealth of Nations* and the belief in the \"invisible hand\" of the market led to the ascendancy of free trade advocates who argued that unregulated economic freedom produced social harmony (Ch6, p.184). This shift sharpened the distinction between a northern economy relying on \"free labor\" and a southern economy dependent on enslaved labor, as the decline of indentured servitude and apprenticeship removed the \"halfway houses\" between slavery and freedom for white men (Ch6, p.184). However, this new economic freedom was built on the dispossession of Native Americans, whose land was necessary to fulfill the vision of widespread land ownership that leaders like Thomas Jefferson and Noah Webster believed was essential for national freedom (Ch6, p.184).\n",
"\n",
"Third, while the revolution expanded political participation for white men, it simultaneously diminished the freedoms of Native Americans, Loyalists, and enslaved people, demonstrating that the new nation's definition of liberty was racially and gendered. The war brought destruction to Native Americans who fought on both sides, as British troops burned Catawba towns and American General John Sullivan led an expedition to destroy Haudenosaunee settlements, burning forty towns and destroying thousands of bushels of corn (Ch5, p.162). Although some Native nations like the Oneidas joined the Americans, most Native nations allied with the British to protect their lands from colonial encroachment, and the American victory ultimately led to the loss of Native independence (Ch5, p.162). Similarly, the revolution diminished the freedoms of Loyalists, who faced persecution and the seizure of property by local and state governments, despite the Treaty of Paris promising that they would not suffer persecution (Ch5, p.162). Finally, while the revolution inspired some enslaved people to seek freedom by fighting in the Continental army or fleeing to British lines, slavery became more deeply entrenched in the South, and the boundaries of full citizenship became more rigidly based on race and gender (Ch6, p.176).\n",
"\n",
"In conclusion, the era of salutary neglect was a crucial precursor to the American Revolution, as it allowed colonial elites to cultivate a political culture of self-government and a belief in the rights of Englishmen that fueled resistance to British authority. However, the revolution itself was a complex process that redefined freedom in ways that expanded political and economic liberty for white men while marginalizing Native Americans, Loyalists, and enslaved people. The new nation's commitment to liberty was thus paradoxical, as it sought to secure independence and equality for its citizens while simultaneously denying these rights to others, a tension that would continue to shape American history long after independence was achieved.\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch6 Defining Economic Freedom p.184 *(score: 0.705)*\n",
"> In economic as well as political and religious affairs, the Revolution rewrote the definition of freedom. In colonial America, slavery was one part of a broad spectrum of kinds of unfree labor. In the...\n",
"\n",
"**[2]** Ch5 Securing Independence p.162 *(score: 0.692)*\n",
"> Declaring Americans independent was one thing; winning independence another. The newly created American army confronted the greatest military power on earth. Viewing the Americans as traitors, Britain...\n",
"\n",
"**[3]** Ch6 Chapter 6: The Revolution Within p.176 *(score: 0.691)*\n",
"> How did equality become a stronger component of American freedom after the Revolution? How did the expansion of religious liberty after the Revolution reflect the new American ideal of freedom? How di...\n",
"\n",
"**[4]** Ch4 The Public Sphere p.120 *(score: 0.689)*\n",
"> Colonial politics for most of the eighteenth century was considerably less tempestuous than in the seventeenth, with its bitter struggles for power and frequent armed conflicts. Political stability in...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"How did the era of salutrary neglect contribute to the American revolution...write a full length LEQ with a good context thesis and nuanced line of reasoning able to get full 6/6 on the APUSH LEQ\")"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "56507669",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RAW: \"I cannot answer this question using the provided textbook passages because there is no information about the Harlem Renaissance in the texts. The passages cover early European colonization (French, Dutch, English, Spanish), the American Revolution, and the Adams presidency (1790s), but do not mention the Harlem Renaissance.\\n\\nIf you'd like, I can provide general information about the Harlem Renaissance outside the textbook, but please note this is not from the provided passages.\\n\\n**General Information (not from textbook):**\\nThe Harlem Renaissance was a cultural, social, and artistic explosion centered in Harlem, New York City, during the 1920s and 1930s. Key facts include:\\n\\n- **Time Period:** Roughly 19181937, peaking in the 1920s\\n- **Location:** Harlem, Manhattan, New York City\\n- **Key Figures:** Langston Hughes, Zora Neale Hurston, James Weldon Johnson, Countee Cullen, Duke Ellington, Louis Armstrong, Langston Hughes, W.E.B. Du Bois, Alain Locke\\n- **Themes:** African American identity, racial pride, jazz music, literature, visual arts, and political activism\\n- **Significance:** First major African American cultural movement; challenged racial stereotypes; influenced civil rights movement; produced enduring works in literature, music, and art\\n- **Context:** Great Migration (African Americans moving from rural South to urban North); post-WWI racial tensions; economic prosperity of the 1920s\\n- **Legacy:** Laid groundwork for Civil Rights Movement; established African American cultural institutions; influenced global perceptions of Black culture\\n\\nWould you like me to provide more specific details about any aspect of the Harlem Renaissance?\"\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"🟡 **CONFIDENCE: MEDIUM** (score: 0.621)\n",
"\n",
"---\n",
"\n",
"### Q: Spitball facts about teh harlmen reniassacnce\n",
"\n",
"I cannot answer this question using the provided textbook passages because there is no information about the Harlem Renaissance in the texts. The passages cover early European colonization (French, Dutch, English, Spanish), the American Revolution, and the Adams presidency (1790s), but do not mention the Harlem Renaissance.\n",
"\n",
"If you'd like, I can provide general information about the Harlem Renaissance outside the textbook, but please note this is not from the provided passages.\n",
"\n",
"**General Information (not from textbook):**\n",
"The Harlem Renaissance was a cultural, social, and artistic explosion centered in Harlem, New York City, during the 1920s and 1930s. Key facts include:\n",
"\n",
"- **Time Period:** Roughly 19181937, peaking in the 1920s\n",
"- **Location:** Harlem, Manhattan, New York City\n",
"- **Key Figures:** Langston Hughes, Zora Neale Hurston, James Weldon Johnson, Countee Cullen, Duke Ellington, Louis Armstrong, Langston Hughes, W.E.B. Du Bois, Alain Locke\n",
"- **Themes:** African American identity, racial pride, jazz music, literature, visual arts, and political activism\n",
"- **Significance:** First major African American cultural movement; challenged racial stereotypes; influenced civil rights movement; produced enduring works in literature, music, and art\n",
"- **Context:** Great Migration (African Americans moving from rural South to urban North); post-WWI racial tensions; economic prosperity of the 1920s\n",
"- **Legacy:** Laid groundwork for Civil Rights Movement; established African American cultural institutions; influenced global perceptions of Black culture\n",
"\n",
"Would you like me to provide more specific details about any aspect of the Harlem Renaissance?\n",
"\n",
"---\n",
"\n",
"**Sources:**\n",
"\n",
"**[1]** Ch1 The French and Dutch Empires p.27 *(score: 0.621)*\n",
"> If the Black Legend inspired a sense of superiority among Spains European rivals, the precious metals that poured from the Americas into the Spanish treasury aroused the desire to try to match Spain...\n",
"\n",
"**[2]** Ch8 The Adams Presidency p.237 *(score: 0.612)*\n",
"> In 1792, Washington won unanimous reelection. Four years later, he decided to retire from public life, in part to establish the precedent that the presidency is not a life office. In his Farewell Addr...\n",
"\n",
"**[3]** Ch5 Securing Independence p.162 *(score: 0.612)*\n",
"> Declaring Americans independent was one thing; winning independence another. The newly created American army confronted the greatest military power on earth. Viewing the Americans as traitors, Britain...\n",
"\n",
"**[4]** Ch2 Chapter 2: European Colonies and Native Nations, 1600⠍1660 p.40 *(score: 0.611)*\n",
"> What were the main contours of English colonization in the seventeenth century? What drew English settlers to North America, and how did Native peoples respond to incoming colonists? What was the sign...\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ask(\"Spitball facts about teh harlmen reniassacnce\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}