{ "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", "\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": "d9d8612e", "metadata": {}, "outputs": [], "source": [ "from autocorrect import Speller\n", "\n", "spell = Speller(lang='en')\n", "\n", "def clean_query(query: str) -> str:\n", " return spell(query)" ] }, { "cell_type": "code", "execution_count": 4, "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": 5, "id": "b90a4761", "metadata": {}, "outputs": [], "source": [ "TOP_K = 10 # fetch more, re-rank by score\n", "\n", "def retrieve(query: str) -> dict:\n", " corrected = clean_query(query)\n", " hits = qdrant.query_points(\n", " collection_name=COLLECTION,\n", " query=embed_query(corrected),\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.7:\n", " confidence = \"HIGH\"\n", " conf_color = \"green\"\n", " elif top_score >= 0.52:\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": 6, "id": "98205255", "metadata": {}, "outputs": [], "source": [ "SYSTEM_PROMPT = \"\"\" /no_think\n", "\n", "You are an expert AP US History tutor.\n", "\n", "Answer using the provided textbook passages. Cite inline like (Ch5, p.153).\n", "If the passages don't cover it, answer from your own knowledge and say \"Outside textbook:\".\n", "If the question has a false premise, correct it.\n", "\n", "Format your answer to match the question — one word, paragraph, or full essay as needed.\n", "Be detailed and accurate. Never invent citations.\"\"\"\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\"TEXTBOOK PASSAGES:\\n{context}\\n\\nQUESTION: {retrieved['query']}\"\n", " messages = [\n", " {\"role\": \"system\", \"content\": SYSTEM_PROMPT},\n", " {\"role\": \"user\", \"content\": user_message},\n", " ]\n", "\n", " stream = llm.chat.completions.create(\n", " model=\"qwen3.5-9b\",\n", " messages=messages,\n", " max_tokens=8192,\n", " temperature=0.1,\n", " stream=True,\n", " extra_body={\"chat_template_kwargs\": {\"enable_thinking\": False}}\n", " )\n", "\n", " full_content = \"\"\n", " in_think = False\n", "\n", " console.print(\"\\n[dim]💭 Thinking...[/dim]\")\n", "\n", " for chunk in stream:\n", " delta = chunk.choices[0].delta\n", " \n", " think_delta = getattr(delta, \"reasoning_content\", \"\") or \"\"\n", " answer_delta = delta.content or \"\"\n", " if think_delta:\n", " print(think_delta, end=\"\", flush=True)\n", "\n", " if answer_delta:\n", " if not full_content:\n", " print(\"\\n✍ Answer:\")\n", " full_content += answer_delta\n", " print(answer_delta, end=\"\", flush=True)\n", "\n", " if \"\" in full_content:\n", " answer = full_content.split(\"\", 1)[-1].strip()\n", " else:\n", " answer = full_content.strip()\n", "\n", " return answer" ] }, { "cell_type": "code", "execution_count": 7, "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": 8, "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": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "Based on the provided textbook passages, **Martin Luther King Jr. did not agree with Malcolm X.** In fact, the text presents them as holding fundamentally opposing views regarding race relations, strategy, and the nature of the American Dream.\n", "\n", "The passages highlight several key points of divergence:\n", "\n", "* **Integration vs. Separation:** King advocated for the \"full integration of Black Americans into the 'mainstream of American life'\" and appealed to American values and the conscience of white America (Ch25, p.826). Conversely, Malcolm X initially preached a message of \"white evil and Black self-discipline,\" calling for Black separation from their African ancestry and rejecting the \"American dream\" in favor of an \"American nightmare\" (Ch25, p.826).\n", "* **Nonviolence vs. Self-Defense:** King's philosophy was rooted in nonviolent resistance, drawing on the teachings of Gandhi and Thoreau, and he urged protesters to show \"love and goodwill\" even when struck (Ch24, p.799). Malcolm X, particularly during his time with the Nation of Islam, was a \"sharp critic of the ideas of integration and nonviolence\" and called for \"Black self-defense against violence perpetrated by whites\" (Ch25, p.826).\n", "* **Reliance on Government vs. Self-Reliance:** King sought federal legislation and government action to abolish economic deprivation, such as his proposal for a \"Bill of Rights for the Disadvantaged\" (Ch25, p.826). Malcolm X, however, insisted that Blacks must \"control the political and economic resources of their communities and rely on their own efforts rather than working with whites\" (Ch25, p.826).\n", "* **The American Dream:** King envisioned a future where the nation lived out the true meaning of its creed that \"all men are created equal\" (Ch25, p.816). Malcolm X famously declared, \"I don't see any American dream. I see an American nightmare,\" viewing the system as inherently oppressive rather than redeemable (Ch25, p.826).\n", "\n", "**Outside textbook:** While the text emphasizes their differences, historical context notes that Malcolm X's views evolved after his pilgrimage to Mecca in 1964, where he began to speak of \"interracial cooperation for radical change.\" He broke with the Nation of Islam and formed the Organization for Afro-American Unity, which softened his stance on integration, though he remained critical of the mainstream civil rights movement's approach. Even in this later phase, his focus on Black nationalism and self-determination remained distinct from King's broader coalition-building and integrationist goals." ] }, { "data": { "text/markdown": [ "\n", "🟢 **CONFIDENCE: HIGH** (score: 0.712)\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 text presents them as holding fundamentally opposing views regarding race relations, strategy, and the nature of the American Dream.\n", "\n", "The passages highlight several key points of divergence:\n", "\n", "* **Integration vs. Separation:** King advocated for the \"full integration of Black Americans into the 'mainstream of American life'\" and appealed to American values and the conscience of white America (Ch25, p.826). Conversely, Malcolm X initially preached a message of \"white evil and Black self-discipline,\" calling for Black separation from their African ancestry and rejecting the \"American dream\" in favor of an \"American nightmare\" (Ch25, p.826).\n", "* **Nonviolence vs. Self-Defense:** King's philosophy was rooted in nonviolent resistance, drawing on the teachings of Gandhi and Thoreau, and he urged protesters to show \"love and goodwill\" even when struck (Ch24, p.799). Malcolm X, particularly during his time with the Nation of Islam, was a \"sharp critic of the ideas of integration and nonviolence\" and called for \"Black self-defense against violence perpetrated by whites\" (Ch25, p.826).\n", "* **Reliance on Government vs. Self-Reliance:** King sought federal legislation and government action to abolish economic deprivation, such as his proposal for a \"Bill of Rights for the Disadvantaged\" (Ch25, p.826). Malcolm X, however, insisted that Blacks must \"control the political and economic resources of their communities and rely on their own efforts rather than working with whites\" (Ch25, p.826).\n", "* **The American Dream:** King envisioned a future where the nation lived out the true meaning of its creed that \"all men are created equal\" (Ch25, p.816). Malcolm X famously declared, \"I don't see any American dream. I see an American nightmare,\" viewing the system as inherently oppressive rather than redeemable (Ch25, p.826).\n", "\n", "**Outside textbook:** While the text emphasizes their differences, historical context notes that Malcolm X's views evolved after his pilgrimage to Mecca in 1964, where he began to speak of \"interracial cooperation for radical change.\" He broke with the Nation of Islam and formed the Organization for Afro-American Unity, which softened his stance on integration, though he remained critical of the mainstream civil rights movement's approach. Even in this later phase, his focus on Black nationalism and self-determination remained distinct from King's broader coalition-building and integrationist goals.\n", "\n", "---\n", "\n", "**Sources:**\n", "\n", "**[1]** Ch25 › The Changing Black Movement › p.826 *(score: 0.712)*\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 › 1968 › p.844 *(score: 0.673)*\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", "\n", "**[3]** Ch25 › The Civil Rights Revolution › p.816 *(score: 0.666)*\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", "**[4]** Ch28 › President Trump › p.953 *(score: 0.660)*\n", "> As the election year 2016 began, all signs pointed to a victory for Hillary Clinton. Most Democrats seemed to feel that she deserved the nomination that Obama had wrested from her eight years earlier....\n", "\n", "**[5]** Ch10 › Chapter Review › p.322 *(score: 0.655)*\n", "> key provisions? How does it show America’s growing international presence? 2. How did Andrew Jackson represent the major developments of the era: westward movement, the market revolution, and the exp...\n", "\n", "**[6]** Ch25 › Vietnam and the New Left › p.830 *(score: 0.651)*\n", "> To most Americans, the rise of a protest movement among white youth came as a complete surprise. For most of the century, colleges had been conservative institutions that drew their students from a pr...\n", "\n", "**[7]** Ch24 › The Freedom Movement › p.799 *(score: 0.650)*\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": [ "" ] }, "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": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "The premise of your question is incorrect: the U.S. government did **not** treat Japanese Americans well during World War II; in fact, it subjected them to one of the most severe violations of civil liberties in American history.\n", "\n", "According to the textbook passages, instead of treating Japanese Americans well, the government:\n", "\n", "- Issued **Executive Order 9066** in February 1942, which authorized the forced removal and internment of over **110,000 people of Japanese descent**, **nearly two-thirds of whom were U.S. citizens** (Ch22, p.729).\n", "- Removed them from their homes on the West Coast without due process, court hearings, or writs of habeas corpus (Ch22, p.729).\n", "- Confined them in **internment camps** behind barbed wire, where they lived in makeshift barracks, faced armed guards, and had their privacy and dignity stripped away (Ch22, p.729).\n", "- Justified this action based on **racial prejudice and wartime fear**, not evidence of disloyalty. As Justice Jackson noted in his dissent in *Korematsu v. United States*, the policy punished individuals for their ancestry rather than their actions: “an attempt to make an otherwise innocent act a crime merely because this prisoner is the son of parents… and belongs to a race from which there is no way to resign” (Ch22, p.729).\n", "- The Supreme Court upheld the internment in *Korematsu v. United States* (1944), a decision later repudiated in 2018 as “gravely wrong” (Ch22, p.729).\n", "\n", "While the government did encourage Japanese Americans to swear loyalty oaths and enlist in the military (about 20,000 served from the camps), this came **after** their forced removal and did not compensate for the injustice of internment (Ch22, p.729).\n", "\n", "In contrast, the government treated German and Italian Americans far more leniently—arresting only a handful of nationals despite similar wartime fears (Ch22, p.729).\n", "\n", "Thus, rather than treating Japanese Americans well, the U.S. government committed a profound injustice rooted in racism and wartime hysteria. It was not until 1988 that Congress apologized and provided $20,000 in compensation to each surviving victim (Ch22, p.729)." ] }, { "data": { "text/markdown": [ "\n", "🟢 **CONFIDENCE: HIGH** (score: 0.771)\n", "\n", "---\n", "\n", "### Q: why did the us govt treat japanese americans so well in ww2\n", "\n", "The premise of your question is incorrect: the U.S. government did **not** treat Japanese Americans well during World War II; in fact, it subjected them to one of the most severe violations of civil liberties in American history.\n", "\n", "According to the textbook passages, instead of treating Japanese Americans well, the government:\n", "\n", "- Issued **Executive Order 9066** in February 1942, which authorized the forced removal and internment of over **110,000 people of Japanese descent**, **nearly two-thirds of whom were U.S. citizens** (Ch22, p.729).\n", "- Removed them from their homes on the West Coast without due process, court hearings, or writs of habeas corpus (Ch22, p.729).\n", "- Confined them in **internment camps** behind barbed wire, where they lived in makeshift barracks, faced armed guards, and had their privacy and dignity stripped away (Ch22, p.729).\n", "- Justified this action based on **racial prejudice and wartime fear**, not evidence of disloyalty. As Justice Jackson noted in his dissent in *Korematsu v. United States*, the policy punished individuals for their ancestry rather than their actions: “an attempt to make an otherwise innocent act a crime merely because this prisoner is the son of parents… and belongs to a race from which there is no way to resign” (Ch22, p.729).\n", "- The Supreme Court upheld the internment in *Korematsu v. United States* (1944), a decision later repudiated in 2018 as “gravely wrong” (Ch22, p.729).\n", "\n", "While the government did encourage Japanese Americans to swear loyalty oaths and enlist in the military (about 20,000 served from the camps), this came **after** their forced removal and did not compensate for the injustice of internment (Ch22, p.729).\n", "\n", "In contrast, the government treated German and Italian Americans far more leniently—arresting only a handful of nationals despite similar wartime fears (Ch22, p.729).\n", "\n", "Thus, rather than treating Japanese Americans well, the U.S. government committed a profound injustice rooted in racism and wartime hysteria. It was not until 1988 that Congress apologized and provided $20,000 in compensation to each surviving victim (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 America’s 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", "\n", "**[4]** Ch22 › The End of the War › p.741 *(score: 0.738)*\n", "> As 1945 opened, Allied victory was assured. In December 1944, in a desperate gamble, Hitler launched a surprise counterattack in France that pushed Allied forces back fifty miles, creating a large bul...\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ask(\"why did the us govt treat japanese americans so well in ww2\")" ] }, { "cell_type": "code", "execution_count": 11, "id": "ea66da95", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "Here are detailed bullet points of New Deal policies with dates and evidence, organized by theme for your AP US History Long Essay Question (LEQ). These are drawn directly from the provided textbook passages.\n", "\n", "**1. Financial Stabilization and Banking Reform (First New Deal)**\n", "* **Emergency Banking Act (March 1933):** Declared a \"bank holiday\" to halt withdrawals, provided funds to shore up threatened institutions, and established the **Federal Deposit Insurance Corporation (FDIC)** to insure individual depositor accounts, restoring public confidence in the banking system.\n", "* **Glass-Steagall Act (1933):** Barred commercial banks from engaging in the buying and selling of stocks to prevent irresponsible practices that contributed to the crash; also took the U.S. off the **gold standard**, severing the link between currency and gold reserves to allow for money issuance to stimulate business.\n", "* **Securities and Exchange Commission (SEC):** Created to regulate the stock and bond markets, ensuring transparency and preventing future speculative frenzies.\n", "\n", "**2. Public Works and Regional Development**\n", "* **Civilian Conservation Corps (CCC) (March 1933):** Employed over **3 million young men** in forest preservation, flood control, and park improvement projects; provided wages of $30/month, enhancing the environment while offering relief.\n", "* **Public Works Administration (PWA) (1933):** Directed by Harold Ickes, it contracted with private construction companies to build **40,000 public buildings, 72,000 schools, 80,000 bridges, and 8,000 parks**, spending $3.3 billion on infrastructure like the Triborough Bridge and Overseas Highway.\n", "* **Tennessee Valley Authority (TVA) (1933):** Built a series of dams to prevent floods and deforestation, providing cheap electric power to a seven-state region; it was the first time the federal government competed with private companies by selling electricity, serving as a model for regional planning.\n", "* **Grand Coulee Dam (1941):** Part of the \"public works revolution,\" it became the largest man-made structure in world history, producing over 40% of the nation's hydroelectric power and spurring suburban housing and factory growth, though it caused environmental damage and displaced Native American tribes.\n", "\n", "**3. Agricultural Relief and Regulation**\n", "* **Agricultural Adjustment Act (AAA) (1933):** Authorized the government to set production quotas and pay farmers to plant less to raise prices; in 1933, it ordered the slaughter of **6 million pigs** to reduce supply. While it raised farm prices, it injured tenant farmers and sharecroppers by encouraging landowners to evict them to save on payments.\n", "* **Resettlement Administration (1934):** Sought to relocate rural and urban families suffering from the Depression and Dust Bowl to planned communities, including relief camps for migrant workers in California.\n", "\n", "**4. Labor Rights and Industrial Democracy (Second New Deal)**\n", "* **National Industrial Recovery Act (NRA) (1933):** Established industry codes to end \"cutthroat competition\" and included **Section 7a**, which recognized the workers' right to organize unions (a departure from the \"open shop\" policies of the 1920s). Although ruled unconstitutional in 1935, it helped undercut the sense that the government was doing nothing.\n", "* **Wagner Act / National Labor Relations Act (1935):** Established the **National Labor Relations Board (NLRB)** to regulate employment practices and facilitate unionization; it legitimized the **Congress of Industrial Organizations (CIO)**, which broke with the AFL to include Black workers and organized sit-down strikes.\n", "* **Fair Labor Standards Act (1938):** Banned goods produced by child labor from interstate commerce, set a national **minimum wage of 40 cents/hour**, and required overtime pay for hours exceeding 40 per week.\n", "\n", "**5. Social Security and Economic Security**\n", "* **Social Security Act (1935):** Created a comprehensive system including **retirement pensions, unemployment insurance, disability insurance, and public assistance (welfare)**; it was a landmark in establishing a federal safety net.\n", "* **Home Owners Loan Corporation (HOLC) and Federal Housing Administration (FHA) (1933–1934):** Insured millions of long-term mortgages, allowing lenders to offer 30-year loans with low down payments (usually 10%), making home ownership accessible to tens of millions of families and spurring a postwar suburban boom.\n", "* **GI Bill of Rights / Servicemen's Readjustment Act (1944):** Provided returning veterans with unemployment pay, scholarships (by 1946, over 1 million were attending college), low-cost mortgage loans, pensions, and job training; it profoundly shaped postwar society and fueled the suburban housing boom.\n", "\n", "**6. Civil Rights and Cultural Shifts**\n", "* **Indian Reorganization Act (1934):** Part of the \"Indian New Deal,\" it increased Native American access to education and self-governance, reversing previous policies of assimilation and land dispossession.\n", "* **Civil Liberties Expansion (1937–1939):** The Supreme Court shifted from striking down economic regulations to protecting civil liberties; in 1937, it overturned the conviction of **Angelo Herndon** (a Communist organizer) on free speech grounds and invalidated an Alabama law prohibiting labor picketing.\n", "* **Popular Front Culture (Mid-1930s):** The Communist Party and CIO promoted a vision of Americanism based on **ethnic and racial inclusiveness**, unionism, and social citizenship, challenging the status quo and advocating for the rights of minorities (e.g., the Scottsboro Boys case, where legal representation was expanded).\n", "\n", "**7. Opposition and Judicial Pushback**\n", "* **Supreme Court Challenges (1934–1936):** The Court declared the **NRA unconstitutional** (May 1935) for delegating legislative power and regulating local business, and struck down the **AAA** (January 1936) for overstepping congressional power over local economic activities.\n", "* **Taft-Hartley Act (1947):** Passed over Truman's veto, this law sought to reverse labor gains by authorizing an 80-day \"cooling-off period\" for strikes, banning sympathy strikes and secondary boycotts, outlawing the closed shop, and requiring union officials to swear they were not communists." ] }, { "data": { "text/markdown": [ "\n", "🟡 **CONFIDENCE: MEDIUM** (score: 0.696)\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 detailed bullet points of New Deal policies with dates and evidence, organized by theme for your AP US History Long Essay Question (LEQ). These are drawn directly from the provided textbook passages.\n", "\n", "**1. Financial Stabilization and Banking Reform (First New Deal)**\n", "* **Emergency Banking Act (March 1933):** Declared a \"bank holiday\" to halt withdrawals, provided funds to shore up threatened institutions, and established the **Federal Deposit Insurance Corporation (FDIC)** to insure individual depositor accounts, restoring public confidence in the banking system.\n", "* **Glass-Steagall Act (1933):** Barred commercial banks from engaging in the buying and selling of stocks to prevent irresponsible practices that contributed to the crash; also took the U.S. off the **gold standard**, severing the link between currency and gold reserves to allow for money issuance to stimulate business.\n", "* **Securities and Exchange Commission (SEC):** Created to regulate the stock and bond markets, ensuring transparency and preventing future speculative frenzies.\n", "\n", "**2. Public Works and Regional Development**\n", "* **Civilian Conservation Corps (CCC) (March 1933):** Employed over **3 million young men** in forest preservation, flood control, and park improvement projects; provided wages of $30/month, enhancing the environment while offering relief.\n", "* **Public Works Administration (PWA) (1933):** Directed by Harold Ickes, it contracted with private construction companies to build **40,000 public buildings, 72,000 schools, 80,000 bridges, and 8,000 parks**, spending $3.3 billion on infrastructure like the Triborough Bridge and Overseas Highway.\n", "* **Tennessee Valley Authority (TVA) (1933):** Built a series of dams to prevent floods and deforestation, providing cheap electric power to a seven-state region; it was the first time the federal government competed with private companies by selling electricity, serving as a model for regional planning.\n", "* **Grand Coulee Dam (1941):** Part of the \"public works revolution,\" it became the largest man-made structure in world history, producing over 40% of the nation's hydroelectric power and spurring suburban housing and factory growth, though it caused environmental damage and displaced Native American tribes.\n", "\n", "**3. Agricultural Relief and Regulation**\n", "* **Agricultural Adjustment Act (AAA) (1933):** Authorized the government to set production quotas and pay farmers to plant less to raise prices; in 1933, it ordered the slaughter of **6 million pigs** to reduce supply. While it raised farm prices, it injured tenant farmers and sharecroppers by encouraging landowners to evict them to save on payments.\n", "* **Resettlement Administration (1934):** Sought to relocate rural and urban families suffering from the Depression and Dust Bowl to planned communities, including relief camps for migrant workers in California.\n", "\n", "**4. Labor Rights and Industrial Democracy (Second New Deal)**\n", "* **National Industrial Recovery Act (NRA) (1933):** Established industry codes to end \"cutthroat competition\" and included **Section 7a**, which recognized the workers' right to organize unions (a departure from the \"open shop\" policies of the 1920s). Although ruled unconstitutional in 1935, it helped undercut the sense that the government was doing nothing.\n", "* **Wagner Act / National Labor Relations Act (1935):** Established the **National Labor Relations Board (NLRB)** to regulate employment practices and facilitate unionization; it legitimized the **Congress of Industrial Organizations (CIO)**, which broke with the AFL to include Black workers and organized sit-down strikes.\n", "* **Fair Labor Standards Act (1938):** Banned goods produced by child labor from interstate commerce, set a national **minimum wage of 40 cents/hour**, and required overtime pay for hours exceeding 40 per week.\n", "\n", "**5. Social Security and Economic Security**\n", "* **Social Security Act (1935):** Created a comprehensive system including **retirement pensions, unemployment insurance, disability insurance, and public assistance (welfare)**; it was a landmark in establishing a federal safety net.\n", "* **Home Owners Loan Corporation (HOLC) and Federal Housing Administration (FHA) (1933–1934):** Insured millions of long-term mortgages, allowing lenders to offer 30-year loans with low down payments (usually 10%), making home ownership accessible to tens of millions of families and spurring a postwar suburban boom.\n", "* **GI Bill of Rights / Servicemen's Readjustment Act (1944):** Provided returning veterans with unemployment pay, scholarships (by 1946, over 1 million were attending college), low-cost mortgage loans, pensions, and job training; it profoundly shaped postwar society and fueled the suburban housing boom.\n", "\n", "**6. Civil Rights and Cultural Shifts**\n", "* **Indian Reorganization Act (1934):** Part of the \"Indian New Deal,\" it increased Native American access to education and self-governance, reversing previous policies of assimilation and land dispossession.\n", "* **Civil Liberties Expansion (1937–1939):** The Supreme Court shifted from striking down economic regulations to protecting civil liberties; in 1937, it overturned the conviction of **Angelo Herndon** (a Communist organizer) on free speech grounds and invalidated an Alabama law prohibiting labor picketing.\n", "* **Popular Front Culture (Mid-1930s):** The Communist Party and CIO promoted a vision of Americanism based on **ethnic and racial inclusiveness**, unionism, and social citizenship, challenging the status quo and advocating for the rights of minorities (e.g., the Scottsboro Boys case, where legal representation was expanded).\n", "\n", "**7. Opposition and Judicial Pushback**\n", "* **Supreme Court Challenges (1934–1936):** The Court declared the **NRA unconstitutional** (May 1935) for delegating legislative power and regulating local business, and struck down the **AAA** (January 1936) for overstepping congressional power over local economic activities.\n", "* **Taft-Hartley Act (1947):** Passed over Truman's veto, this law sought to reverse labor gains by authorizing an 80-day \"cooling-off period\" for strikes, banning sympathy strikes and secondary boycotts, outlawing the closed shop, and requiring union officials to swear they were not communists.\n", "\n", "---\n", "\n", "**Sources:**\n", "\n", "**[1]** Ch22 › Visions of Postwar Freedom › p.727 *(score: 0.696)*\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.695)*\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.689)*\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 › A Reckoning With Liberty › p.693 *(score: 0.684)*\n", "> The Depression made inevitable, in the words of one writer, a “reckoning with liberty.” For too many Americans, Roosevelt proclaimed, “life was no longer free; liberty no longer real; men could no lon...\n", "\n", "**[5]** Ch21 › A New Conception of America › p.702 *(score: 0.683)*\n", "> If the New Deal failed to dismantle the barriers that barred non-whites from full participation in American life, the 1930s witnessed the absorption of other groups into the social mainstream. With Ca...\n", "\n", "**[6]** Ch23 › The Truman Presidency › p.765 *(score: 0.683)*\n", "> With the end of World War II, President Truman’s first domestic task was to preside over the transition from a wartime to a peacetime economy. More than 12 million men remained in uniform in August 19...\n", "\n", "**[7]** Ch21 › The First New Deal › p.680 *(score: 0.678)*\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", "**[8]** Ch21 › Chapter Review › p.708 *(score: 0.678)*\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", "\n", "**[9]** Ch25 › 1968 › p.844 *(score: 0.674)*\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": [ "" ] }, "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": 12, "id": "4415fcca", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "The provided textbook passages do not contain information about who invented calculus or the centrifuge.\n", "\n", "Outside textbook:\n", "**Calculus** was independently developed in the mid-17th century by **Isaac Newton** (who called it \"fluxions\") and **Gottfried Wilhelm Leibniz**. While Newton published his work first, Leibniz developed his notation (which is still used today) independently and published his findings before Newton.\n", "\n", "The **centrifuge** has a more complex history of development rather than a single inventor:\n", "* The concept dates back to ancient times, but the first practical machine resembling a centrifuge was built by **Benjamin Franklin** in 1768 to separate blood from serum.\n", "* However, the modern laboratory centrifuge was developed in the late 19th century. **John B. Reuleaux** is often credited with inventing the first practical centrifuge in 1864, and **Theodor Svedberg** later perfected the ultracentrifuge in the early 20th century, for which he won the Nobel Prize in Chemistry in 1926." ] }, { "data": { "text/markdown": [ "\n", "🟡 **CONFIDENCE: MEDIUM** (score: 0.677)\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.\n", "\n", "Outside textbook:\n", "**Calculus** was independently developed in the mid-17th century by **Isaac Newton** (who called it \"fluxions\") and **Gottfried Wilhelm Leibniz**. While Newton published his work first, Leibniz developed his notation (which is still used today) independently and published his findings before Newton.\n", "\n", "The **centrifuge** has a more complex history of development rather than a single inventor:\n", "* The concept dates back to ancient times, but the first practical machine resembling a centrifuge was built by **Benjamin Franklin** in 1768 to separate blood from serum.\n", "* However, the modern laboratory centrifuge was developed in the late 19th century. **John B. Reuleaux** is often credited with inventing the first practical centrifuge in 1864, and **Theodor Svedberg** later perfected the ultracentrifuge in the early 20th century, for which he won the Nobel Prize in Chemistry in 1926.\n", "\n", "---\n", "\n", "**Sources:**\n", "\n", "**[1]** Ch1 › Contact › p.13 *(score: 0.677)*\n", "> At the beginning of the fifteenth century, one might have predicted that China would establish the world’s first global empire. Between 1405 and 1433, Admiral Zheng He led seven large naval expedition...\n", "\n", "**[2]** Ch5 › The Coming of Independence › p.153 *(score: 0.649)*\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", "**[3]** Ch9 › Chapter Review › p.288 *(score: 0.645)*\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", "**[4]** Ch7 › “We the People” › p.219 *(score: 0.635)*\n", "> A nation, in one scholar’s famous phrase, is more than a political entity or a specific piece of territory—it is also “an imagined political community,” whose borders are as much intellectual as geogr...\n", "\n", "**[5]** Ch9 › A New Economy › p.262 *(score: 0.627)*\n", "> In the first half of the nineteenth century, an economic transformation known to historians as the market revolution swept over the United States. Its catalyst was a series of innovations in transport...\n", "\n", "**[6]** Ch10 › Chapter Review › p.322 *(score: 0.617)*\n", "> key provisions? How does it show America’s growing international presence? 2. How did Andrew Jackson represent the major developments of the era: westward movement, the market revolution, and the exp...\n", "\n", "**[7]** Ch10 › The Triumph of Democracy › p.295 *(score: 0.617)*\n", "> The market revolution and territorial expansion were intimately connected with a third central element of American freedom—political democracy. The challenge to property qualifications for voting, beg...\n", "\n", "**[8]** Ch16 › The Second Industrial Revolution › p.501 *(score: 0.610)*\n", "> Between the end of the Civil War and the early twentieth century, the United States underwent one of the most rapid and profound economic revolutions any country has ever experienced. There were numer...\n", "\n", "**[9]** Ch16 › Chapter 16: America⠒s Gilded Age, 1870⠍1890 › p.500 *(score: 0.608)*\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" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ask(\"Who invented caluclus and the cetntrifuge\")" ] }, { "cell_type": "code", "execution_count": 13, "id": "1d5982bb", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "The textbook does **not** argue that Martin Luther King Jr. was a \"better\" activist than Rosa Parks. Instead, it presents them as complementary figures who played distinct but equally vital roles in the civil rights movement, with Parks serving as the catalyst for mass action and King emerging as the movement's national symbol and strategist.\n", "\n", "According to the text (Ch24, p.799–800), Rosa Parks is remembered as a symbol of \"ordinary Blacks' determination to resist the daily injustices and indignities of the Jim Crow South.\" Her arrest on December 1, 1955, was the specific event that \"sparked a yearlong Montgomery bus boycott,\" which the text calls \"the beginning of the mass phase of the civil rights movement in the South.\" Parks was chosen specifically because she was a \"dignified, accomplished\" woman who could serve as an ideal symbol for the fight, unlike an earlier protester who was an unmarried pregnant teenager. The text emphasizes that her life \"makes clear that the civil rights revolution built on earlier struggles,\" noting her long history of political activism, including protesting the Scottsboro boys and serving as secretary to E.D. Nixon.\n", "\n", "Martin Luther King Jr., by contrast, is described as the movement's \"national symbol\" who emerged from the Montgomery boycott. The text highlights his role in formulating the philosophy of the movement. It notes that King had studied the writings of Henry David Thoreau and Mohandas Gandhi, and he \"outlined a philosophy of struggle in which evil must be met with good, hate with Christian love, and violence with peaceful demands for change.\" King's speeches, such as his call to action at the first protest meeting (\"We, the disinherited of this land... are tired of going through the long night of captivity\") and his later \"I Have a Dream\" speech, are credited with fusing the protesters' understandings of freedom into a \"coherent whole.\" The text states that King was a \"master at appealing to the deep sense of injustice among Blacks and to the conscience of white America,\" using a vocabulary that merged the Black experience with that of the nation.\n", "\n", "Therefore, the textbook portrays Parks as the essential figure who ignited the movement through her act of defiance and her status as a relatable symbol, while King is portrayed as the leader who provided the strategic direction, theological framework, and oratorical power that mobilized the nation and defined the movement's goals. Neither is presented as superior; rather, their contributions are shown as sequential and interdependent in launching the modern civil rights revolution." ] }, { "data": { "text/markdown": [ "\n", "🟢 **CONFIDENCE: HIGH** (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 textbook does **not** argue that Martin Luther King Jr. was a \"better\" activist than Rosa Parks. Instead, it presents them as complementary figures who played distinct but equally vital roles in the civil rights movement, with Parks serving as the catalyst for mass action and King emerging as the movement's national symbol and strategist.\n", "\n", "According to the text (Ch24, p.799–800), Rosa Parks is remembered as a symbol of \"ordinary Blacks' determination to resist the daily injustices and indignities of the Jim Crow South.\" Her arrest on December 1, 1955, was the specific event that \"sparked a yearlong Montgomery bus boycott,\" which the text calls \"the beginning of the mass phase of the civil rights movement in the South.\" Parks was chosen specifically because she was a \"dignified, accomplished\" woman who could serve as an ideal symbol for the fight, unlike an earlier protester who was an unmarried pregnant teenager. The text emphasizes that her life \"makes clear that the civil rights revolution built on earlier struggles,\" noting her long history of political activism, including protesting the Scottsboro boys and serving as secretary to E.D. Nixon.\n", "\n", "Martin Luther King Jr., by contrast, is described as the movement's \"national symbol\" who emerged from the Montgomery boycott. The text highlights his role in formulating the philosophy of the movement. It notes that King had studied the writings of Henry David Thoreau and Mohandas Gandhi, and he \"outlined a philosophy of struggle in which evil must be met with good, hate with Christian love, and violence with peaceful demands for change.\" King's speeches, such as his call to action at the first protest meeting (\"We, the disinherited of this land... are tired of going through the long night of captivity\") and his later \"I Have a Dream\" speech, are credited with fusing the protesters' understandings of freedom into a \"coherent whole.\" The text states that King was a \"master at appealing to the deep sense of injustice among Blacks and to the conscience of white America,\" using a vocabulary that merged the Black experience with that of the nation.\n", "\n", "Therefore, the textbook portrays Parks as the essential figure who ignited the movement through her act of defiance and her status as a relatable symbol, while King is portrayed as the leader who provided the strategic direction, theological framework, and oratorical power that mobilized the nation and defined the movement's goals. Neither is presented as superior; rather, their contributions are shown as sequential and interdependent in launching the modern civil rights revolution.\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", "\n", "**[3]** Ch22 › The American Dilemma › p.729 *(score: 0.678)*\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", "**[4]** Ch25 › 1968 › p.844 *(score: 0.666)*\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", "\n", "**[5]** Ch15 › The Making of Radical Reconstruction › p.473 *(score: 0.666)*\n", "> To Lincoln’s successor, Andrew Johnson, fell the task of overseeing the restoration of the Union. Born in poverty in North Carolina, as a youth Johnson worked as a tailor’s apprentice. After moving to...\n", "\n", "**[6]** Ch21 › A New Conception of America › p.702 *(score: 0.666)*\n", "> If the New Deal failed to dismantle the barriers that barred non-whites from full participation in American life, the 1930s witnessed the absorption of other groups into the social mainstream. With Ca...\n" ], "text/plain": [ "" ] }, "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": 14, "id": "8f00c9a7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "**Context:**\n", "In the decades leading up to the American Revolution, the British government largely ignored the colonies through a policy known as \"salutary neglect.\" As detailed in Chapter 4 (p.120), this policy allowed the colonies to govern themselves with minimal imperial interference, fostering a unique political culture where local elites dominated colonial assemblies and the \"public sphere\" expanded significantly. By the mid-18th century, the colonies had developed their own institutions, including elected assemblies that controlled finance and appointed officials, as well as a vibrant network of clubs, newspapers, and coffeehouses where political debate flourished. However, this autonomy was built on the assumption that Britain would continue to turn a blind eye to colonial self-rule. When Britain ended this policy in the 1760s to pay off war debts from the Seven Years' War, it shattered the colonial expectation of independence, leading to a crisis over the definition of liberty and the legitimacy of British authority.\n", "\n", "**Thesis:**\n", "The end of salutary neglect was the catalyst for the American Revolution because it transformed the colonies' long-standing political habits of self-governance into a revolutionary ideology; by abruptly imposing direct imperial control and taxation without representation, Britain violated the colonists' entrenched belief in their rights as Englishmen, thereby forcing them to redefine \"freedom\" not merely as the absence of British interference, but as a universal entitlement that demanded the dismantling of the very imperial system that had previously protected it.\n", "\n", "**Line of Reasoning:**\n", "First, the era of salutary neglect allowed the colonies to develop a distinct political identity centered on the power of elected assemblies and the principle of \"no taxation without representation.\" Under this policy, as noted in Chapter 4 (p.120), colonial assemblies grew increasingly assertive, using their control over revenue to negotiate with governors and effectively governing themselves. This experience created a \"political nation\" dominated by an elite that believed they represented the will of the people and possessed the same rights as the House of Commons in Britain. When Britain ended salutary neglect to raise revenue for the empire, it directly challenged this autonomy. The imposition of taxes like the Stamp Act and Townshend Acts was not seen merely as a financial burden but as a fundamental violation of the colonists' political liberty, proving that the British government viewed colonial subjects as property rather than partners in an empire.\n", "\n", "Second, the abrupt end of neglect forced a redefinition of freedom from a specific colonial privilege to a universal right, a shift that radicalized the revolutionary cause. Prior to the 1760s, the language of liberty was often used metaphorically to describe the denial of political rights by arbitrary government, as seen in debates over the Stamp Act where slavery was used as a shorthand for political bondage (Ch6, p.189). However, the direct confrontation with British authority after 1763 made the contradiction between British rule and American liberty undeniable. The British insistence on enforcing laws like the Proclamation of 1763 and the Intolerable Acts demonstrated that the empire sought to impose order and hierarchy, whereas the colonists, inspired by Enlightenment ideas and their own experience of self-rule, began to argue that liberty was a natural right belonging to all mankind. This is exemplified by the rhetoric of figures like James Otis and the broader public discourse that began to juxtapose freedom and slavery as \"the two extremes of happiness and misery,\" arguing that true liberty could not coexist with arbitrary power (Ch6, p.189).\n", "\n", "Finally, the collapse of salutary neglect unified the disparate colonies into a single revolutionary entity by exposing the fragility of their relationship with Britain. The policy had previously allowed local loyalties to outweigh national patriotism, with colonies often acting independently (Ch7, p.202). The British attempt to centralize authority and enforce uniform laws across the colonies revealed that the imperial system was incompatible with the diverse interests and local traditions of the thirteen colonies. The resulting resistance, which evolved from petitions to armed conflict, was driven by the realization that the only way to secure their hard-won political independence was to sever ties with the mother country entirely. Thus, the end of salutary neglect did not just spark a war for independence; it necessitated the creation of a new nation based on the radical principle that freedom required the active participation of the governed and the rejection of hereditary privilege and imperial domination." ] }, { "data": { "text/markdown": [ "\n", "🟢 **CONFIDENCE: HIGH** (score: 0.719)\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", "**Context:**\n", "In the decades leading up to the American Revolution, the British government largely ignored the colonies through a policy known as \"salutary neglect.\" As detailed in Chapter 4 (p.120), this policy allowed the colonies to govern themselves with minimal imperial interference, fostering a unique political culture where local elites dominated colonial assemblies and the \"public sphere\" expanded significantly. By the mid-18th century, the colonies had developed their own institutions, including elected assemblies that controlled finance and appointed officials, as well as a vibrant network of clubs, newspapers, and coffeehouses where political debate flourished. However, this autonomy was built on the assumption that Britain would continue to turn a blind eye to colonial self-rule. When Britain ended this policy in the 1760s to pay off war debts from the Seven Years' War, it shattered the colonial expectation of independence, leading to a crisis over the definition of liberty and the legitimacy of British authority.\n", "\n", "**Thesis:**\n", "The end of salutary neglect was the catalyst for the American Revolution because it transformed the colonies' long-standing political habits of self-governance into a revolutionary ideology; by abruptly imposing direct imperial control and taxation without representation, Britain violated the colonists' entrenched belief in their rights as Englishmen, thereby forcing them to redefine \"freedom\" not merely as the absence of British interference, but as a universal entitlement that demanded the dismantling of the very imperial system that had previously protected it.\n", "\n", "**Line of Reasoning:**\n", "First, the era of salutary neglect allowed the colonies to develop a distinct political identity centered on the power of elected assemblies and the principle of \"no taxation without representation.\" Under this policy, as noted in Chapter 4 (p.120), colonial assemblies grew increasingly assertive, using their control over revenue to negotiate with governors and effectively governing themselves. This experience created a \"political nation\" dominated by an elite that believed they represented the will of the people and possessed the same rights as the House of Commons in Britain. When Britain ended salutary neglect to raise revenue for the empire, it directly challenged this autonomy. The imposition of taxes like the Stamp Act and Townshend Acts was not seen merely as a financial burden but as a fundamental violation of the colonists' political liberty, proving that the British government viewed colonial subjects as property rather than partners in an empire.\n", "\n", "Second, the abrupt end of neglect forced a redefinition of freedom from a specific colonial privilege to a universal right, a shift that radicalized the revolutionary cause. Prior to the 1760s, the language of liberty was often used metaphorically to describe the denial of political rights by arbitrary government, as seen in debates over the Stamp Act where slavery was used as a shorthand for political bondage (Ch6, p.189). However, the direct confrontation with British authority after 1763 made the contradiction between British rule and American liberty undeniable. The British insistence on enforcing laws like the Proclamation of 1763 and the Intolerable Acts demonstrated that the empire sought to impose order and hierarchy, whereas the colonists, inspired by Enlightenment ideas and their own experience of self-rule, began to argue that liberty was a natural right belonging to all mankind. This is exemplified by the rhetoric of figures like James Otis and the broader public discourse that began to juxtapose freedom and slavery as \"the two extremes of happiness and misery,\" arguing that true liberty could not coexist with arbitrary power (Ch6, p.189).\n", "\n", "Finally, the collapse of salutary neglect unified the disparate colonies into a single revolutionary entity by exposing the fragility of their relationship with Britain. The policy had previously allowed local loyalties to outweigh national patriotism, with colonies often acting independently (Ch7, p.202). The British attempt to centralize authority and enforce uniform laws across the colonies revealed that the imperial system was incompatible with the diverse interests and local traditions of the thirteen colonies. The resulting resistance, which evolved from petitions to armed conflict, was driven by the realization that the only way to secure their hard-won political independence was to sever ties with the mother country entirely. Thus, the end of salutary neglect did not just spark a war for independence; it necessitated the creation of a new nation based on the radical principle that freedom required the active participation of the governed and the rejection of hereditary privilege and imperial domination.\n", "\n", "---\n", "\n", "**Sources:**\n", "\n", "**[1]** Ch4 › The Public Sphere › p.120 *(score: 0.719)*\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", "\n", "**[2]** Ch6 › Defining Economic Freedom › p.184 *(score: 0.718)*\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", "**[3]** Ch6 › Slavery and the Revolution › p.189 *(score: 0.711)*\n", "> While Native nations experienced American independence as a real threat to their own liberty, African Americans saw in the ideals of the Revolution and the reality of war an opportunity to claim freed...\n", "\n", "**[4]** Ch7 › Chapter 7: Founding a Nation, 1783⠍1791 › p.202 *(score: 0.709)*\n", "> What were the achievements and problems of the Confederation government? What major disagreements and compromises molded the final content of the Constitution? How did Anti-Federalist concerns raised ...\n", "\n", "**[5]** Ch13 › A Dose of Arsenic › p.395 *(score: 0.708)*\n", "> Victory over Mexico added more than 1 million square miles to the United States —an area larger than the Louisiana Purchase. But the acquisition of this vast territory raised the fatal issue that woul...\n", "\n", "**[6]** Ch6 › Chapter 6: The Revolution Within › p.176 *(score: 0.707)*\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", "**[7]** Ch6 › Democratizing Freedom › p.178 *(score: 0.705)*\n", "> The American Revolution took place at three levels simultaneously. It was a struggle for national independence, a phase in a century-long continental and global battle among multiple European empires ...\n", "\n", "**[8]** Ch4 › Battle for the Continent › p.130 *(score: 0.703)*\n", "> The Ohio Valley would be the flashpoint of both the French-British rivalry and struggles over Native sovereignty as those two empires pushed farther into Native lands. Earlier in the century, Shawnees...\n", "\n", "**[9]** Ch5 › Securing Independence › p.162 *(score: 0.703)*\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", "**[10]** Ch9 › The Free Individual › p.279 *(score: 0.702)*\n", "> By the 1830s, the market revolution and westward expansion had produced a society that amazed European visitors: energetic, materialistic, and seemingly in constant motion. Arriving in Chicago in 1835...\n" ], "text/plain": [ "" ] }, "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": 15, "id": "56507669", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "Based on the provided textbook passages, here are the key facts about the Harlem Renaissance:\n", "\n", "* **Location and Demographics:** It was a literary and artistic movement centered in New York City's Harlem neighborhood during the 1920s. Harlem became an international \"capital\" of Black America, attracting nearly 150,000 West Indian immigrants between 1900 and 1930, in addition to nearly 1 million African Americans who left the South during the 1920s as part of the Great Migration.\n", "* **Economic Reality vs. Cultural Vibrancy:** While Harlem was celebrated by whites for its exotic dance halls, jazz clubs, and speakeasies (\"slumming\"), the reality for Black residents was widespread poverty, low-wage jobs, and housing discrimination that forced them to pay exorbitant rents. Most businesses were owned by whites, and even the famous Cotton Club excluded Black customers.\n", "* **Cultural Output:** The movement produced significant literary and artistic works. Poets and novelists like Countee Cullen, Langston Hughes, and Claude McKay were befriended by white intellectuals and published by white presses. The theater also flourished, with Broadway presenting Black actors in serious dramatic roles and shows featuring entertainers like Florence Mills, Ethel Waters, and Bill Robinson.\n", "* **The \"New Negro\" Spirit:** The term \"New Negro\" signified a rejection of established stereotypes and a search for Black values rooted in Africa, the rural South's folk traditions, and the urban ghetto experience. This included a strong element of protest, exemplified by Claude McKay's poem \"If We Must Die,\" which affirmed that Blacks would no longer allow themselves to be murdered defenselessly.\n", "* **Institutional Support:** Unlike previous eras, the Harlem Renaissance saw Black writers and actors supported by white producers and intellectuals, and the theater flourished within Harlem itself, freeing Black artists from the constraints of white producers.\n", "* **Contrast with the South:** Unlike the southern newcomers who were mostly agricultural workers, many West Indian immigrants were well-educated professional and white-collar workers, though they still faced intense racism upon arrival." ] }, { "data": { "text/markdown": [ "\n", "🟡 **CONFIDENCE: MEDIUM** (score: 0.688)\n", "\n", "---\n", "\n", "### Q: Spitball facts about the Harlem Renaissance\n", "\n", "Based on the provided textbook passages, here are the key facts about the Harlem Renaissance:\n", "\n", "* **Location and Demographics:** It was a literary and artistic movement centered in New York City's Harlem neighborhood during the 1920s. Harlem became an international \"capital\" of Black America, attracting nearly 150,000 West Indian immigrants between 1900 and 1930, in addition to nearly 1 million African Americans who left the South during the 1920s as part of the Great Migration.\n", "* **Economic Reality vs. Cultural Vibrancy:** While Harlem was celebrated by whites for its exotic dance halls, jazz clubs, and speakeasies (\"slumming\"), the reality for Black residents was widespread poverty, low-wage jobs, and housing discrimination that forced them to pay exorbitant rents. Most businesses were owned by whites, and even the famous Cotton Club excluded Black customers.\n", "* **Cultural Output:** The movement produced significant literary and artistic works. Poets and novelists like Countee Cullen, Langston Hughes, and Claude McKay were befriended by white intellectuals and published by white presses. The theater also flourished, with Broadway presenting Black actors in serious dramatic roles and shows featuring entertainers like Florence Mills, Ethel Waters, and Bill Robinson.\n", "* **The \"New Negro\" Spirit:** The term \"New Negro\" signified a rejection of established stereotypes and a search for Black values rooted in Africa, the rural South's folk traditions, and the urban ghetto experience. This included a strong element of protest, exemplified by Claude McKay's poem \"If We Must Die,\" which affirmed that Blacks would no longer allow themselves to be murdered defenselessly.\n", "* **Institutional Support:** Unlike previous eras, the Harlem Renaissance saw Black writers and actors supported by white producers and intellectuals, and the theater flourished within Harlem itself, freeing Black artists from the constraints of white producers.\n", "* **Contrast with the South:** Unlike the southern newcomers who were mostly agricultural workers, many West Indian immigrants were well-educated professional and white-collar workers, though they still faced intense racism upon arrival.\n", "\n", "---\n", "\n", "**Sources:**\n", "\n", "**[1]** Ch20 › The Culture Wars › p.659 *(score: 0.688)*\n", "> Although many Americans embraced modern urban culture with its religious and ethnic pluralism, mass entertainment, and liberated sexual rules, others found it alarming. Many evangelical Protestants fe...\n", "\n", "**[2]** Ch18 › Chapter 18: The Progressive Era, 1900⠍1916 › p.576 *(score: 0.674)*\n", "> Why was the city such a central element in Progressive America? How did the labor and women’s movements challenge the nineteenth- century meanings of American freedom? In what ways did Progressivism i...\n", "\n", "**[3]** Ch20 › Chapter Review › p.674 *(score: 0.669)*\n", "> affect people’s understanding of American values, including the meaning of freedom, in the 1920s? 2. Which groups did not share in the prosperity of the 1920s and why? 3. How did business practices an...\n", "\n", "**[4]** Ch22 › The American Dilemma › p.729 *(score: 0.667)*\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", "**[5]** Ch12 › The Origins of Feminism › p.372 *(score: 0.662)*\n", "> “When the true history of the antislavery cause shall be written,” Frederick Douglass later recalled, “women will occupy a large space in its pages.” Much of the movement’s grassroots strength derived...\n", "\n", "**[6]** Ch18 › Varieties of Progressivism › p.583 *(score: 0.659)*\n", "> For most Americans, however, Patten’s “new civilization” lay far in the future. The more immediate task, in the Progressives’ view, was to humanize industrial capitalism and find common ground in a so...\n", "\n", "**[7]** Ch20 › The Business of America › p.648 *(score: 0.655)*\n", "> “The chief business of the American people,” said Calvin Coolidge, who became president after Warren G. Harding’s sudden death from a heart attack in 1923, “is business.” Rarely in American history ha...\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ask(\"Spitball facts about the Harlem Renaissance\")" ] }, { "cell_type": "code", "execution_count": null, "id": "d87d2add", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
       "💭 Thinking...\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[2m💭 Thinking\u001b[0m\u001b[2;33m...\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "✍ Answer:\n", "Langston Hughes was a prominent African American poet, novelist, and playwright who became a central figure in the Harlem Renaissance of the 1920s and 1930s. According to the textbook, he was among the key writers active in the Harlem Renaissance, a literary and artistic movement centered in New York City's Harlem neighborhood (Ch19, p.625). His work often explored the Black experience, including the struggles of African Americans during the Great Migration and the tensions of racial inequality in the United States.\n", "\n", "Hughes was also known for his critical perspective on American democracy and freedom. In the early 21st century, he was remembered for urging Americans to both celebrate their freedoms and recognize that freedom had always been incomplete in the United States (Ch28, p.967). He famously questioned whether the \"Freedom Train\" of the 1940s truly offered freedom to all Americans, asking, \"When it stops in Mississippi, will it be made plain / Everybody's got a right to board the Freedom Train?\" (Ch23, p.753). This reflected his lifelong commitment to racial justice and his belief that true freedom required the inclusion of African Americans in the full rights and opportunities of American society." ] }, { "data": { "text/markdown": [ "\n", "🟢 **CONFIDENCE: HIGH** (score: 0.732)\n", "\n", "---\n", "\n", "### Q: Who is Langston Hughes?\n", "\n", "Langston Hughes was a prominent African American poet, novelist, and playwright who became a central figure in the Harlem Renaissance of the 1920s and 1930s. According to the textbook, he was among the key writers active in the Harlem Renaissance, a literary and artistic movement centered in New York City's Harlem neighborhood (Ch19, p.625). His work often explored the Black experience, including the struggles of African Americans during the Great Migration and the tensions of racial inequality in the United States.\n", "\n", "Hughes was also known for his critical perspective on American democracy and freedom. In the early 21st century, he was remembered for urging Americans to both celebrate their freedoms and recognize that freedom had always been incomplete in the United States (Ch28, p.967). He famously questioned whether the \"Freedom Train\" of the 1940s truly offered freedom to all Americans, asking, \"When it stops in Mississippi, will it be made plain / Everybody's got a right to board the Freedom Train?\" (Ch23, p.753). This reflected his lifelong commitment to racial justice and his belief that true freedom required the inclusion of African Americans in the full rights and opportunities of American society.\n", "\n", "---\n", "\n", "**Sources:**\n", "\n", "**[1]** Ch28 › Freedom in the Twenty-First Century › p.967 *(score: 0.732)*\n", "> The century that ended in 2000 witnessed vast human progress and unimaginable human tragedy. It saw the decolonization of Asia and Africa, the emergence of women into full citizenship in most parts of...\n", "\n", "**[2]** Ch20 › Chapter Review › p.674 *(score: 0.580)*\n", "> affect people’s understanding of American values, including the meaning of freedom, in the 1920s? 2. Which groups did not share in the prosperity of the 1920s and why? 3. How did business practices an...\n", "\n", "**[3]** Ch23 › Chapter 23: The United States and the Cold War, 1945⠍1953 › p.753 *(score: 0.574)*\n", "> What series of events and ideological conflicts prompted the Cold War? How did the Cold War reshape ideas of American freedom? What major domestic policy initiatives did Truman undertake? What effects...\n", "\n", "**[4]** Ch21 › The Grassroots Revolt › p.687 *(score: 0.561)*\n", "> The most striking development of the mid-1930s was the mobilization of millions of workers in mass-production industries that had successfully resisted unionization. “Labor’s great upheaval,” as this ...\n", "\n", "**[5]** Ch13 › The Impending Crisis › p.413 *(score: 0.561)*\n", "> In the eyes of many white southerners, Lincoln’s victory placed their future at the mercy of a party avowedly hostile to their region’s values and interests. Those advocating secession did not believe...\n", "\n", "**[6]** Ch19 › Who Is an American? › p.625 *(score: 0.561)*\n", "> In many respects, Progressivism was a precursor to major developments of the twentieth century—the New Deal, the Great Society, the socially active state. But in accepting the idea of “race” as a perm...\n", "\n", "**[7]** Ch9 › Market Society › p.269 *(score: 0.559)*\n", "> Since cotton was produced solely for sale in national and international markets, the South was in some ways the most commercially oriented region of the United States. Yet rather than spurring economi...\n", "\n", "**[8]** Ch20 › The Culture Wars › p.659 *(score: 0.556)*\n", "> Although many Americans embraced modern urban culture with its religious and ethnic pluralism, mass entertainment, and liberated sexual rules, others found it alarming. Many evangelical Protestants fe...\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "ename": "", "evalue": "", "output_type": "error", "traceback": [ "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n", "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n", "\u001b[1;31mClick here for more info. \n", "\u001b[1;31mView Jupyter log for further details." ] } ], "source": [ "ask (\"Who is Langston Hughes?\")" ] } ], "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.4" } }, "nbformat": 4, "nbformat_minor": 5 }