htm 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. checksums.yaml +7 -0
  2. data/.architecture/decisions/adrs/001-use-postgresql-timescaledb-storage.md +227 -0
  3. data/.architecture/decisions/adrs/002-two-tier-memory-architecture.md +322 -0
  4. data/.architecture/decisions/adrs/003-ollama-default-embedding-provider.md +339 -0
  5. data/.architecture/decisions/adrs/004-multi-robot-shared-memory-hive-mind.md +374 -0
  6. data/.architecture/decisions/adrs/005-rag-based-retrieval-with-hybrid-search.md +443 -0
  7. data/.architecture/decisions/adrs/006-context-assembly-strategies.md +444 -0
  8. data/.architecture/decisions/adrs/007-working-memory-eviction-strategy.md +461 -0
  9. data/.architecture/decisions/adrs/008-robot-identification-system.md +550 -0
  10. data/.architecture/decisions/adrs/009-never-forget-explicit-deletion-only.md +570 -0
  11. data/.architecture/decisions/adrs/010-redis-working-memory-rejected.md +323 -0
  12. data/.architecture/decisions/adrs/011-database-side-embedding-generation-with-pgai.md +585 -0
  13. data/.architecture/decisions/adrs/012-llm-driven-ontology-topic-extraction.md +583 -0
  14. data/.architecture/decisions/adrs/013-activerecord-orm-and-many-to-many-tagging.md +299 -0
  15. data/.architecture/decisions/adrs/014-client-side-embedding-generation-workflow.md +569 -0
  16. data/.architecture/decisions/adrs/015-hierarchical-tag-ontology-and-llm-extraction.md +701 -0
  17. data/.architecture/decisions/adrs/016-async-embedding-and-tag-generation.md +694 -0
  18. data/.architecture/members.yml +144 -0
  19. data/.architecture/reviews/2025-10-29-llm-configuration-and-async-processing-review.md +1137 -0
  20. data/.architecture/reviews/initial-system-analysis.md +330 -0
  21. data/.envrc +32 -0
  22. data/.irbrc +145 -0
  23. data/CHANGELOG.md +150 -0
  24. data/COMMITS.md +196 -0
  25. data/LICENSE +21 -0
  26. data/README.md +1347 -0
  27. data/Rakefile +51 -0
  28. data/SETUP.md +268 -0
  29. data/config/database.yml +67 -0
  30. data/db/migrate/20250101000001_enable_extensions.rb +14 -0
  31. data/db/migrate/20250101000002_create_robots.rb +14 -0
  32. data/db/migrate/20250101000003_create_nodes.rb +42 -0
  33. data/db/migrate/20250101000005_create_tags.rb +38 -0
  34. data/db/migrate/20250101000007_add_node_vector_indexes.rb +30 -0
  35. data/db/schema.sql +473 -0
  36. data/db/seed_data/README.md +100 -0
  37. data/db/seed_data/presidents.md +136 -0
  38. data/db/seed_data/states.md +151 -0
  39. data/db/seeds.rb +208 -0
  40. data/dbdoc/README.md +173 -0
  41. data/dbdoc/public.node_stats.md +48 -0
  42. data/dbdoc/public.node_stats.svg +41 -0
  43. data/dbdoc/public.node_tags.md +40 -0
  44. data/dbdoc/public.node_tags.svg +112 -0
  45. data/dbdoc/public.nodes.md +54 -0
  46. data/dbdoc/public.nodes.svg +118 -0
  47. data/dbdoc/public.nodes_tags.md +39 -0
  48. data/dbdoc/public.nodes_tags.svg +112 -0
  49. data/dbdoc/public.ontology_structure.md +48 -0
  50. data/dbdoc/public.ontology_structure.svg +38 -0
  51. data/dbdoc/public.operations_log.md +42 -0
  52. data/dbdoc/public.operations_log.svg +130 -0
  53. data/dbdoc/public.relationships.md +39 -0
  54. data/dbdoc/public.relationships.svg +41 -0
  55. data/dbdoc/public.robot_activity.md +46 -0
  56. data/dbdoc/public.robot_activity.svg +35 -0
  57. data/dbdoc/public.robots.md +35 -0
  58. data/dbdoc/public.robots.svg +90 -0
  59. data/dbdoc/public.schema_migrations.md +29 -0
  60. data/dbdoc/public.schema_migrations.svg +26 -0
  61. data/dbdoc/public.tags.md +35 -0
  62. data/dbdoc/public.tags.svg +60 -0
  63. data/dbdoc/public.topic_relationships.md +45 -0
  64. data/dbdoc/public.topic_relationships.svg +32 -0
  65. data/dbdoc/schema.json +1437 -0
  66. data/dbdoc/schema.svg +154 -0
  67. data/docs/api/database.md +806 -0
  68. data/docs/api/embedding-service.md +532 -0
  69. data/docs/api/htm.md +797 -0
  70. data/docs/api/index.md +259 -0
  71. data/docs/api/long-term-memory.md +1096 -0
  72. data/docs/api/working-memory.md +665 -0
  73. data/docs/architecture/adrs/001-postgresql-timescaledb.md +314 -0
  74. data/docs/architecture/adrs/002-two-tier-memory.md +411 -0
  75. data/docs/architecture/adrs/003-ollama-embeddings.md +421 -0
  76. data/docs/architecture/adrs/004-hive-mind.md +437 -0
  77. data/docs/architecture/adrs/005-rag-retrieval.md +531 -0
  78. data/docs/architecture/adrs/006-context-assembly.md +496 -0
  79. data/docs/architecture/adrs/007-eviction-strategy.md +645 -0
  80. data/docs/architecture/adrs/008-robot-identification.md +625 -0
  81. data/docs/architecture/adrs/009-never-forget.md +648 -0
  82. data/docs/architecture/adrs/010-redis-working-memory-rejected.md +323 -0
  83. data/docs/architecture/adrs/011-pgai-integration.md +494 -0
  84. data/docs/architecture/adrs/index.md +215 -0
  85. data/docs/architecture/hive-mind.md +736 -0
  86. data/docs/architecture/index.md +351 -0
  87. data/docs/architecture/overview.md +538 -0
  88. data/docs/architecture/two-tier-memory.md +873 -0
  89. data/docs/assets/css/custom.css +83 -0
  90. data/docs/assets/images/htm-core-components.svg +63 -0
  91. data/docs/assets/images/htm-database-schema.svg +93 -0
  92. data/docs/assets/images/htm-hive-mind-architecture.svg +125 -0
  93. data/docs/assets/images/htm-importance-scoring-framework.svg +83 -0
  94. data/docs/assets/images/htm-layered-architecture.svg +71 -0
  95. data/docs/assets/images/htm-long-term-memory-architecture.svg +115 -0
  96. data/docs/assets/images/htm-working-memory-architecture.svg +120 -0
  97. data/docs/assets/images/htm.jpg +0 -0
  98. data/docs/assets/images/htm_demo.gif +0 -0
  99. data/docs/assets/js/mathjax.js +18 -0
  100. data/docs/assets/videos/htm_video.mp4 +0 -0
  101. data/docs/database_rake_tasks.md +322 -0
  102. data/docs/development/contributing.md +787 -0
  103. data/docs/development/index.md +336 -0
  104. data/docs/development/schema.md +596 -0
  105. data/docs/development/setup.md +719 -0
  106. data/docs/development/testing.md +819 -0
  107. data/docs/guides/adding-memories.md +824 -0
  108. data/docs/guides/context-assembly.md +1009 -0
  109. data/docs/guides/getting-started.md +577 -0
  110. data/docs/guides/index.md +118 -0
  111. data/docs/guides/long-term-memory.md +941 -0
  112. data/docs/guides/multi-robot.md +866 -0
  113. data/docs/guides/recalling-memories.md +927 -0
  114. data/docs/guides/search-strategies.md +953 -0
  115. data/docs/guides/working-memory.md +717 -0
  116. data/docs/index.md +214 -0
  117. data/docs/installation.md +477 -0
  118. data/docs/multi_framework_support.md +519 -0
  119. data/docs/quick-start.md +655 -0
  120. data/docs/setup_local_database.md +302 -0
  121. data/docs/using_rake_tasks_in_your_app.md +383 -0
  122. data/examples/basic_usage.rb +93 -0
  123. data/examples/cli_app/README.md +317 -0
  124. data/examples/cli_app/htm_cli.rb +270 -0
  125. data/examples/custom_llm_configuration.rb +183 -0
  126. data/examples/example_app/Rakefile +71 -0
  127. data/examples/example_app/app.rb +206 -0
  128. data/examples/sinatra_app/Gemfile +21 -0
  129. data/examples/sinatra_app/app.rb +335 -0
  130. data/lib/htm/active_record_config.rb +113 -0
  131. data/lib/htm/configuration.rb +342 -0
  132. data/lib/htm/database.rb +594 -0
  133. data/lib/htm/embedding_service.rb +115 -0
  134. data/lib/htm/errors.rb +34 -0
  135. data/lib/htm/job_adapter.rb +154 -0
  136. data/lib/htm/jobs/generate_embedding_job.rb +65 -0
  137. data/lib/htm/jobs/generate_tags_job.rb +82 -0
  138. data/lib/htm/long_term_memory.rb +965 -0
  139. data/lib/htm/models/node.rb +109 -0
  140. data/lib/htm/models/node_tag.rb +33 -0
  141. data/lib/htm/models/robot.rb +52 -0
  142. data/lib/htm/models/tag.rb +76 -0
  143. data/lib/htm/railtie.rb +76 -0
  144. data/lib/htm/sinatra.rb +157 -0
  145. data/lib/htm/tag_service.rb +135 -0
  146. data/lib/htm/tasks.rb +38 -0
  147. data/lib/htm/version.rb +5 -0
  148. data/lib/htm/working_memory.rb +182 -0
  149. data/lib/htm.rb +400 -0
  150. data/lib/tasks/db.rake +19 -0
  151. data/lib/tasks/htm.rake +147 -0
  152. data/lib/tasks/jobs.rake +312 -0
  153. data/mkdocs.yml +190 -0
  154. data/scripts/install_local_database.sh +309 -0
  155. metadata +341 -0
@@ -0,0 +1,136 @@
1
+ # Interesting Facts About US Presidents
2
+
3
+ ## George Washington
4
+ George Washington, the first President of the United States, set numerous precedents that shaped the office for future generations, including the two-term limit tradition that lasted until Franklin D. Roosevelt. As commander of the Continental Army during the Revolutionary War, he led the colonies to victory against the British Empire despite facing severe disadvantages in resources and training. Washington voluntarily relinquished power after two terms, a remarkable act in an era when most leaders held power for life, and his Farewell Address warned against political parties and foreign entanglements, advice that resonates in American politics to this day.
5
+
6
+ ## John Adams
7
+ John Adams served as the second President and was a key architect of American independence, having been instrumental in drafting the Declaration of Independence and securing crucial foreign support during the Revolutionary War. He was the first president to live in the White House and faced significant challenges including the Quasi-War with France and the controversial Alien and Sedition Acts, which tested the limits of free speech in the young republic. Adams and Thomas Jefferson, once close friends who became political rivals, both died on the same day—July 4, 1826—exactly 50 years after the Declaration of Independence was adopted, a coincidence that seemed almost providential to many Americans.
8
+
9
+ ## Thomas Jefferson
10
+ Thomas Jefferson, the primary author of the Declaration of Independence, dramatically expanded the United States through the Louisiana Purchase in 1803, doubling the nation's size for approximately 15 million dollars and opening vast territories for westward expansion. A polymath who was an accomplished architect, inventor, scientist, and founder of the University of Virginia, Jefferson embodied Enlightenment ideals while paradoxically owning over 600 enslaved people during his lifetime. He commissioned the Lewis and Clark Expedition to explore the newly acquired western territories and sponsored numerous scientific endeavors, though his presidency was also marked by the controversial Embargo Act and ongoing tensions with Britain that would eventually lead to the War of 1812.
11
+
12
+ ## James Madison
13
+ James Madison, known as the "Father of the Constitution," was the principal architect of the U.S. Constitution and the Bill of Rights, earning him recognition as one of the most influential Founding Fathers in shaping American government. His presidency was dominated by the War of 1812, during which British forces burned Washington D.C. and forced Madison and his wife Dolley to flee the White House, though the conflict ended with a renewed sense of American nationalism and international respect. Standing only 5 feet 4 inches tall and weighing about 100 pounds, Madison was the smallest president in U.S. history, yet his intellectual contributions to American democracy were enormous, particularly through his writings in The Federalist Papers.
14
+
15
+ ## James Monroe
16
+ James Monroe's presidency is best remembered for the Monroe Doctrine of 1823, which declared that European powers should no longer colonize or interfere in the Americas, establishing a cornerstone of U.S. foreign policy that endures to this day. His presidency coincided with the "Era of Good Feelings," a period of relative political harmony and economic prosperity following the War of 1812, during which the United States gained Florida from Spain and saw westward expansion accelerate. Monroe was the last president who was a Founding Father and the last to wear the traditional knee breeches and powdered wig style of the Revolutionary generation, symbolically representing the transition from the founding era to a new generation of American leadership.
17
+
18
+ ## John Quincy Adams
19
+ John Quincy Adams, son of John Adams, was the only president whose father had also served as president until George W. Bush in 2001, and he was arguably one of the most accomplished diplomats in American history before his presidency. His election in 1824 was decided by the House of Representatives in what Andrew Jackson supporters called a "corrupt bargain," as Adams won despite receiving fewer popular and electoral votes than Jackson. After his single term as president, Adams served 17 years in the House of Representatives, where he became a fierce opponent of slavery and defender of civil liberties, arguing the Amistad case before the Supreme Court and suffering a fatal stroke on the House floor in 1848.
20
+
21
+ ## Andrew Jackson
22
+ Andrew Jackson, a polarizing figure who championed the "common man" against elite interests, was the first president from the western frontier and transformed the presidency into a more powerful and populist office. His presidency was marked by the forced removal of Native Americans along the Trail of Tears, resulting in thousands of deaths, as well as his battle against the Second Bank of the United States, which he viewed as a corrupt institution favoring the wealthy. Jackson survived an assassination attempt in 1835 when both of the would-be assassin's pistols misfired, and he was known for his violent temper, having participated in numerous duels and carrying bullets in his body from previous confrontations throughout his presidency.
23
+
24
+ ## Martin Van Buren
25
+ Martin Van Buren was the first president born as an American citizen rather than a British subject, coming from a Dutch-speaking family in New York and rising to power through his mastery of political organization and party-building. His presidency was dominated by the Panic of 1837, a severe economic depression that devastated his popularity and led to his defeat in 1840, despite his efforts to establish an independent treasury system. Van Buren was a key architect of the Democratic Party and earned the nickname "The Little Magician" for his political skills, though his refusal to annex Texas and his later opposition to slavery expansion cost him support and led to his unsuccessful Free Soil Party presidential run in 1848.
26
+
27
+ ## William Henry Harrison
28
+ William Henry Harrison holds the unfortunate distinction of serving the shortest presidency in American history, dying just 31 days after his inauguration from pneumonia, possibly contracted after delivering the longest inaugural address ever given—nearly two hours in cold, wet weather without a coat or hat. A military hero known for his victory at the Battle of Tippecanoe against Tecumseh's confederation, Harrison ran the first modern presidential campaign with the slogan "Tippecanoe and Tyler Too," featuring log cabin imagery despite his aristocratic background. His death created a constitutional crisis regarding presidential succession that was resolved when Vice President John Tyler assumed the full powers and title of the presidency, establishing a precedent that was later codified in the 25th Amendment.
29
+
30
+ ## John Tyler
31
+ John Tyler became the first vice president to assume the presidency due to the death of a sitting president, and his assertion of full presidential powers despite some who wanted him to be merely an "acting president" set a crucial precedent for succession. His presidency was marked by significant accomplishments including the annexation of Texas and the Webster-Ashburton Treaty with Britain, but he became so estranged from both major parties that he was expelled from the Whig Party and faced an impeachment attempt. Tyler had 15 children, more than any other president, and remarkably, as of 2024, he still has living grandchildren despite being born in 1790, due to his sons having children late in life who also had children late in life.
32
+
33
+ ## James K. Polk
34
+ James K. Polk is often ranked among the most effective presidents despite serving only one term, as he accomplished all of his major campaign promises including acquiring California and much of the Southwest through the Mexican-American War and settling the Oregon boundary dispute with Britain. His presidency saw the United States expand to the Pacific Ocean, fulfilling the concept of Manifest Destiny and nearly completing the continental United States as we know it today, though these territorial gains intensified the slavery debate that would lead to the Civil War. Polk died just three months after leaving office at age 53, having worked himself to exhaustion during his presidency, never taking a single day off and maintaining detailed daily records of his activities in a comprehensive diary.
35
+
36
+ ## Zachary Taylor
37
+ Zachary Taylor, nicknamed "Old Rough and Ready," was a career military officer with no political experience before becoming president, having gained national fame for his victories in the Mexican-American War. Despite being a Louisiana slaveholder, Taylor opposed the expansion of slavery into the new western territories and threatened to use military force against Southern states if they attempted secession, potentially preventing the Civil War had he lived. Taylor died suddenly after just 16 months in office from acute gastroenteritis, possibly caused by consuming contaminated cherries and milk at a Fourth of July celebration, though conspiracy theories about poisoning persisted until his body was exhumed and tested in 1991, finding no evidence of foul play.
38
+
39
+ ## Millard Fillmore
40
+ Millard Fillmore assumed the presidency after Zachary Taylor's death and immediately reversed Taylor's policies by supporting the Compromise of 1850, which included the controversial Fugitive Slave Act requiring Northern states to return escaped slaves to their owners. He sent Commodore Matthew Perry to open trade relations with Japan, ending over 200 years of Japanese isolation and beginning the transformation of Japan into a modern power. Fillmore was the last Whig president and later ran unsuccessfully as the Know-Nothing Party candidate in 1856, and after his presidency he installed the first bathtub in the White House and co-founded the University at Buffalo.
41
+
42
+ ## Franklin Pierce
43
+ Franklin Pierce, one of the most handsome presidents according to contemporaries, saw his presidency unravel due to his support for the Kansas-Nebraska Act, which effectively repealed the Missouri Compromise and led to violent conflict known as "Bleeding Kansas" between pro-slavery and anti-slavery settlers. Personal tragedy haunted Pierce, as he and his wife witnessed their 11-year-old son Bennie die in a train accident just two months before his inauguration, an event from which his wife Jane never recovered and which contributed to Pierce's heavy drinking throughout his presidency. Pierce is consistently ranked among the worst presidents for his failure to address the slavery crisis and his policies that accelerated the nation's march toward civil war, and he was the only elected president whose party denied him renomination.
44
+
45
+ ## James Buchanan
46
+ James Buchanan, the only bachelor president in American history, presided over the nation as it descended into civil war, and his indecisive leadership and Southern sympathies during the secession crisis earned him a reputation as one of the worst presidents. He believed that while secession was illegal, the federal government had no constitutional authority to prevent states from seceding, a position that effectively paralyzed the government during the critical months before Lincoln's inauguration. Buchanan's administration was plagued by corruption scandals, economic depression, and the Dred Scott decision, which he had secretly influenced, and he left office with the nation in crisis, later defending his presidency in his memoirs while most historians condemned his failure to prevent the Civil War.
47
+
48
+ ## Abraham Lincoln
49
+ Abraham Lincoln led the nation through its greatest crisis, the Civil War, preserving the Union and ending slavery through the Emancipation Proclamation and the 13th Amendment, transforming America from a slaveholding republic into a nation dedicated to the proposition that all men are created equal. Despite having only about one year of formal education, Lincoln became one of America's greatest writers and orators, with speeches like the Gettysburg Address and Second Inaugural Address standing among the most profound expressions of American ideals. Lincoln was assassinated by John Wilkes Booth at Ford's Theatre on April 14, 1865, just days after the Confederate surrender at Appomattox, making him a martyr whose death enshrined his legacy as the savior of the Union and the Great Emancipator.
50
+
51
+ ## Andrew Johnson
52
+ Andrew Johnson, a Tennessee Democrat who remained loyal to the Union, became president after Lincoln's assassination and immediately clashed with Congressional Republicans over Reconstruction policy, favoring lenient treatment of the former Confederate states. He was the first president to be impeached, surviving removal from office by a single Senate vote, after he violated the Tenure of Office Act by dismissing Secretary of War Edwin Stanton, who was allied with his Congressional opponents. Johnson's opposition to civil rights for freed slaves and his vetoes of Reconstruction legislation led to Republican supermajorities overriding his policies and implementing more radical Reconstruction measures, though his narrow escape from conviction left the presidency weakened and the impeachment process politically tainted.
53
+
54
+ ## Ulysses S. Grant
55
+ Ulysses S. Grant, the Union's greatest Civil War general who accepted Robert E. Lee's surrender at Appomattox, brought military efficiency to the presidency and vigorously defended the rights of freed slaves through the Enforcement Acts and military intervention against the Ku Klux Klan. Despite his personal honesty and integrity, Grant's presidency was marred by numerous corruption scandals involving his appointees, including the Whiskey Ring and Crédit Mobilier affairs, though Grant himself was never implicated in financial wrongdoing. After leaving office, Grant lost all his money to a fraudulent investment scheme and, while dying of throat cancer, wrote his memoirs in a race against time to provide for his family, producing what is considered one of the finest military autobiographies ever written.
56
+
57
+ ## Rutherford B. Hayes
58
+ Rutherford B. Hayes became president through the Compromise of 1877, one of the most controversial elections in American history, in which he lost the popular vote but won the presidency after a special electoral commission awarded him disputed electoral votes from three Southern states in exchange for ending Reconstruction. Hayes kept his campaign promise to serve only one term and focused on civil service reform, appointing qualified professionals rather than political cronies and battling the spoils system that dominated government employment. His wife Lucy was nicknamed "Lemonade Lucy" because she banned alcohol from the White House, making the Hayes administration notable for its temperance stance and evangelical Christian values that influenced late 19th-century reform movements.
59
+
60
+ ## James A. Garfield
61
+ James A. Garfield, the last president born in a log cabin, was a classical scholar who could simultaneously write in Greek with one hand and Latin with the other, and he published an original proof of the Pythagorean theorem before entering politics. His presidency lasted only 200 days before he was shot by Charles Guiteau, a disappointed office-seeker, and Garfield lingered for 80 days with a bullet lodged near his spine while doctors' repeated probing with unsterilized instruments likely caused the infection that killed him. Garfield's assassination led to the passage of the Pendleton Civil Service Reform Act, which began dismantling the spoils system and established merit-based federal employment, making his death a catalyst for significant governmental reform.
62
+
63
+ ## Chester A. Arthur
64
+ Chester A. Arthur, who assumed the presidency after Garfield's assassination, surprised everyone by transforming from a machine politician and spoilsman into a champion of civil service reform, signing the Pendleton Act that his political allies had opposed. Known as "The Gentleman Boss" for his elegant appearance and refined tastes, Arthur oversaw the modernization of the U.S. Navy and prosecuted fraud in the Post Office despite having been part of the corrupt New York political machine before becoming president. Arthur concealed that he was suffering from Bright's disease during his presidency and died just two years after leaving office, having destroyed most of his personal papers to control his historical legacy.
65
+
66
+ ## Grover Cleveland
67
+ Grover Cleveland is the only president to serve two non-consecutive terms, serving as the 22nd and 24th president, and he was known for his honesty, integrity, and repeated use of the presidential veto—he vetoed more bills than all previous presidents combined. During his first term, Cleveland married Frances Folsom in the White House, becoming the only president to marry in the executive mansion, and she was 27 years younger than him, having been his ward after her father died. Cleveland's second term was dominated by the Panic of 1893, the worst economic depression the United States had experienced to that point, and his handling of the Pullman Strike and monetary policy alienated both labor and agrarian Democrats, though his principled stance on the gold standard and limited government earned him respect from conservative business interests.
68
+
69
+ ## Benjamin Harrison
70
+ Benjamin Harrison, grandson of President William Henry Harrison, was known as the "Centennial President" because his election in 1888 came 100 years after the Constitution was ratified, though he lost the popular vote to Grover Cleveland while winning the electoral college. His presidency saw the admission of six new states—North Dakota, South Dakota, Montana, Washington, Idaho, and Wyoming—more than any other president, as well as the passage of the Sherman Antitrust Act and the McKinley Tariff. Harrison was the first president to have his voice preserved on recording and the first to have electricity installed in the White House, though he and his wife were reportedly so afraid of being electrocuted that they often slept with the lights on rather than touch the switches.
71
+
72
+ ## William McKinley
73
+ William McKinley led the United States to victory in the Spanish-American War of 1898, which resulted in the acquisition of Puerto Rico, Guam, and the Philippines, transforming America into an overseas empire and global power. His presidency marked the beginning of the Progressive Era and saw the consolidation of American industrial power, with McKinley supporting high protective tariffs and the gold standard while maintaining close relationships with big business. McKinley was assassinated in 1901 by anarchist Leon Czolgosz while attending the Pan-American Exposition in Buffalo, making him the third president to be assassinated, and his death brought Theodore Roosevelt and a new generation of progressive reformers to power.
74
+
75
+ ## Theodore Roosevelt
76
+ Theodore Roosevelt, who became the youngest president at age 42 after McKinley's assassination, was a force of nature who embodied the Progressive Era's reform spirit, breaking up monopolistic trusts, conserving millions of acres of wilderness, and mediating international disputes including the Russo-Japanese War, for which he won the Nobel Peace Prize. His "Square Deal" domestic program championed consumer protection, regulated railroads, and broke the power of giant corporations, while his foreign policy was summarized by the phrase "speak softly and carry a big stick," as he expanded American naval power and influenced affairs in Latin America and Asia. Roosevelt was an avid outdoorsman, naturalist, historian, and author who wrote over 35 books, survived being shot during a campaign speech in 1912 (finishing the speech with a bullet in his chest), and led a disastrous expedition into the Amazon that nearly killed him.
77
+
78
+ ## William Howard Taft
79
+ William Howard Taft is the only person to have served as both President and Chief Justice of the Supreme Court, and he considered his later role as Chief Justice to be the greater honor and more suited to his judicial temperament. Despite continuing many of Roosevelt's progressive policies and actually breaking up more trusts than his predecessor, Taft's conservative approach and political missteps led to a bitter split with Roosevelt, who challenged him for the Republican nomination in 1912 and then ran as a third-party candidate. Weighing over 300 pounds, Taft got stuck in the White House bathtub and had to have a larger one installed, and he struggled with his weight throughout his life despite various attempts at dieting and exercise.
80
+
81
+ ## Woodrow Wilson
82
+ Woodrow Wilson, a former Princeton University president and political scientist, led the United States through World War I with the idealistic goal of making the world "safe for democracy" and proposed the Fourteen Points and League of Nations to prevent future wars. Despite his progressive domestic achievements including the Federal Reserve Act, Clayton Antitrust Act, and the first income tax under the 16th Amendment, Wilson was a Southern segregationist who reversed progress on racial integration in the federal government and screened the racist film "Birth of a Nation" in the White House. Wilson suffered a massive stroke in 1919 that left him partially paralyzed and largely incapacitated for the final 17 months of his presidency, during which his wife Edith effectively controlled access to the president and may have made some executive decisions herself.
83
+
84
+ ## Warren G. Harding
85
+ Warren G. Harding won the 1920 election in a landslide with his promise of a "return to normalcy" after World War I and the tumultuous Wilson years, but his presidency became synonymous with corruption due to scandals like Teapot Dome, the worst until Watergate. Despite the scandals involving his appointees, Harding himself was personally likable and popular during his lifetime, known for his gambling, drinking, and extramarital affairs, including one with Nan Britton that allegedly produced an illegitimate daughter. Harding died suddenly in 1923 from a heart attack during a western speaking tour, and rumors of poisoning by his wife Florence persisted for years, though the Teapot Dome and other scandals only became fully public after his death, devastating his historical reputation.
86
+
87
+ ## Calvin Coolidge
88
+ Calvin Coolidge, known as "Silent Cal" for his taciturn demeanor, assumed the presidency after Harding's death and was sworn in by his father, a notary public, by lamplight at the family homestead in Vermont at 2:47 AM, one of the most memorable inaugurations in American history. His presidency coincided with the "Roaring Twenties," a period of economic prosperity and cultural dynamism, and Coolidge's laissez-faire economic policies and tax cuts are credited by conservatives for the boom, though critics argue they contributed to the 1929 crash. Coolidge was devastated by the death of his 16-year-old son Calvin Jr. from blood poisoning in 1924, later writing, "When he went, the power and glory of the Presidency went with him," and he chose not to run for re-election in 1928, perhaps the only president who could have won but voluntarily declined.
89
+
90
+ ## Herbert Hoover
91
+ Herbert Hoover entered the presidency as one of the most qualified candidates ever, having earned an international reputation as a humanitarian for his relief work during and after World War I, feeding millions of starving people in Belgium and Russia. His presidency was defined by the Great Depression that began with the 1929 stock market crash, and despite his efforts to combat the economic catastrophe through public works and business cooperation, Hoover's belief in limited government intervention and his apparent lack of empathy for suffering Americans destroyed his reputation. Shantytowns of homeless people became known as "Hoovervilles," and Hoover suffered one of the worst electoral defeats in history in 1932, though he lived another 31 years after leaving office and rehabilitated his image through humanitarian work and writing, eventually being recognized for his earlier achievements.
92
+
93
+ ## Franklin D. Roosevelt
94
+ Franklin D. Roosevelt, elected to an unprecedented four terms, led the nation through two of its greatest crises—the Great Depression and World War II—fundamentally transforming the role of the federal government through his New Deal programs and wartime mobilization. Paralyzed from the waist down by polio in 1921, FDR concealed the extent of his disability from the public through careful media management and sheer force of personality, becoming a symbol of hope and resilience during America's darkest hours. His fireside chats pioneered the use of radio to communicate directly with citizens, his Social Security system created the modern welfare state, and his leadership of the Allied powers during World War II established the United States as the preeminent global superpower, though he died just weeks before Germany's surrender in April 1945.
95
+
96
+ ## Harry S. Truman
97
+ Harry S. Truman, who became president when FDR died, made some of the most momentous decisions in history, including dropping atomic bombs on Hiroshima and Nagasaki, implementing the Marshall Plan to rebuild Europe, establishing NATO, and intervening in the Korean War to contain communist expansion. Despite being vastly underestimated when he assumed office—some called him "the little man from Missouri"—Truman's decisive leadership, integration of the military by executive order, and dismissal of popular General Douglas MacArthur showed his willingness to make tough decisions regardless of political consequences. Truman left office deeply unpopular with approval ratings around 22%, but historians have increasingly recognized his achievements and leadership during the early Cold War, ranking him among the near-great presidents, and his famous sign "The Buck Stops Here" epitomized his acceptance of presidential responsibility.
98
+
99
+ ## Dwight D. Eisenhower
100
+ Dwight D. Eisenhower, the Supreme Allied Commander who led the D-Day invasion and defeated Nazi Germany, brought military efficiency and moderate Republicanism to the presidency during the prosperous 1950s. His administration oversaw the Interstate Highway System, the largest public works project in American history, ended the Korean War, and managed Cold War tensions while warning in his farewell address about the growing power of the "military-industrial complex." Despite his grandfatherly image and reputation for delegating authority, Eisenhower was a shrewd political operator who secretly authorized CIA operations that overthrew governments in Iran and Guatemala, resisted calls for military intervention in Vietnam, and used federal troops to enforce school desegregation in Little Rock, Arkansas.
101
+
102
+ ## John F. Kennedy
103
+ John F. Kennedy, the youngest elected president at 43 and the first Catholic president, inspired a generation with his vision of a "New Frontier" and famous call to "ask not what your country can do for you—ask what you can do for your country." His presidency faced major Cold War crises including the Bay of Pigs invasion fiasco, the Cuban Missile Crisis that brought the world to the brink of nuclear war, and escalating involvement in Vietnam, while domestically he championed the Space Race and proposed comprehensive civil rights legislation. Kennedy's assassination in Dallas on November 22, 1963, shocked the world and spawned countless conspiracy theories, though official investigations concluded that Lee Harvey Oswald acted alone, and his brief presidency became mythologized as "Camelot," a shining moment of youth, idealism, and promise cut tragically short.
104
+
105
+ ## Lyndon B. Johnson
106
+ Lyndon B. Johnson, who became president after Kennedy's assassination, passed the most comprehensive civil rights legislation since Reconstruction, including the Civil Rights Act of 1964 and Voting Rights Act of 1965, and launched the "Great Society" programs including Medicare, Medicaid, and the War on Poverty. A master legislator who knew how to cajole, threaten, and persuade members of Congress through what became known as the "Johnson Treatment," LBJ achieved domestic policy successes that rivaled FDR's New Deal in scope and impact. However, Johnson's presidency was ultimately consumed by the Vietnam War, which he dramatically escalated with American ground troops despite private doubts, and the war's unpopularity led him to announce he would not seek re-election in 1968, making him one of the few presidents to voluntarily decline to run for a term he was eligible for.
107
+
108
+ ## Richard Nixon
109
+ Richard Nixon achieved significant foreign policy successes including opening relations with Communist China, pursuing détente with the Soviet Union, and ending American involvement in Vietnam, though the war continued until 1975. His domestic policy was surprisingly progressive, establishing the Environmental Protection Agency, expanding affirmative action programs, and proposing a guaranteed minimum income plan, but his presidency became consumed by the Watergate scandal. Nixon became the only president to resign from office on August 9, 1974, facing certain impeachment for obstruction of justice, abuse of power, and contempt of Congress related to the cover-up of the 1972 break-in at Democratic National Committee headquarters, and his downfall permanently damaged public trust in government and added "-gate" to the American lexicon as a suffix for scandals.
110
+
111
+ ## Gerald Ford
112
+ Gerald Ford became the only president never elected as either president or vice president, having been appointed vice president under the 25th Amendment after Spiro Agnew's resignation, then ascending to the presidency when Nixon resigned. Ford's controversial pardon of Nixon for any crimes he may have committed while president was deeply unpopular and likely cost him the 1975 election, though Ford believed it was necessary to help the nation move past Watergate and later received a Profile in Courage Award for the decision. Despite being portrayed as clumsy after a few televised stumbles, Ford was actually one of the most athletic presidents, having played football at the University of Michigan and turned down offers from the NFL, and he survived two assassination attempts within 17 days in September 1975.
113
+
114
+ ## Jimmy Carter
115
+ Jimmy Carter, a peanut farmer and former Georgia governor, ran as a Washington outsider promising honesty and moral leadership after Watergate, and he brought a commitment to human rights and environmental conservation to the presidency. His greatest achievement was mediating the Camp David Accords between Israel and Egypt, the first peace treaty between Israel and an Arab nation, though his presidency was plagued by economic "stagflation," the Iran hostage crisis, and an energy crisis. After losing re-election to Ronald Reagan in 1980, Carter became the most active and admired ex-president in American history, winning the Nobel Peace Prize for his humanitarian work, monitoring elections worldwide, building houses with Habitat for Humanity, and writing over 30 books while living modestly in his hometown of Plains, Georgia.
116
+
117
+ ## Ronald Reagan
118
+ Ronald Reagan, a former Hollywood actor and California governor, won the presidency in 1980 promising to restore American confidence and strength, and his optimistic personality and communication skills earned him the nickname "The Great Communicator." His presidency featured major tax cuts, military buildup against the Soviet Union, and conservative appointments to the federal judiciary, while his challenge to Mikhail Gorbachev to "tear down this wall" became symbolic of the Cold War's end, though the Iran-Contra scandal tarnished his second term. Reagan survived an assassination attempt in 1981 by John Hinckley Jr., joking to doctors "I hope you're all Republicans" before surgery, and he left office enormously popular despite mounting federal deficits and the AIDS crisis that his administration largely ignored.
119
+
120
+ ## George H. W. Bush
121
+ George H. W. Bush brought vast foreign policy experience to the presidency, having served as CIA Director, Vice President, UN Ambassador, and China liaison, and he skillfully managed the end of the Cold War, German reunification, and assembled an international coalition to liberate Kuwait in the Gulf War. His presidency saw the fall of the Berlin Wall and collapse of the Soviet Union, ending the 40-year Cold War, while domestically he signed the Americans with Disabilities Act and Clean Air Act amendments, though his famous "read my lips: no new taxes" pledge and subsequent tax increase contributed to his 1992 defeat. Bush established a new model of post-presidential friendship with former opponent Bill Clinton, and the two collaborated on humanitarian relief efforts, while his son George W. Bush later became president, making them only the second father-son presidential pair after the Adamses.
122
+
123
+ ## Bill Clinton
124
+ Bill Clinton presided over the longest peacetime economic expansion in American history, erasing federal budget deficits and creating budget surpluses through a combination of tax increases, spending restraint, and a booming technology sector. His presidency featured major policy achievements including NAFTA, welfare reform, the Brady Bill gun control law, and the expansion of the Earned Income Tax Credit, as well as failed attempts to reform healthcare and successful intervention to stop ethnic cleansing in Bosnia and Kosovo. Clinton became only the second president to be impeached, charged with perjury and obstruction of justice related to his affair with White House intern Monica Lewinsky, though he was acquitted by the Senate and left office with high approval ratings despite the scandal.
125
+
126
+ ## George W. Bush
127
+ George W. Bush's presidency was defined by the September 11, 2001 terrorist attacks, which killed nearly 3,000 Americans and led to the War on Terror, including the invasion of Afghanistan to overthrow the Taliban and the controversial invasion of Iraq based on faulty intelligence about weapons of mass destruction. His administration passed major tax cuts, the No Child Left Behind education reform, Medicare prescription drug benefits, and the PEPFAR program that provided AIDS treatment to millions in Africa, while his emergency response to Hurricane Katrina was widely criticized as inadequate. Bush left office with low approval ratings due to the Iraq War and the 2008 financial crisis, though his reputation has improved somewhat as Americans reassess his genuine decency, his efforts to promote democracy and fight AIDS globally, and his gracious treatment of his successor Barack Obama.
128
+
129
+ ## Barack Obama
130
+ Barack Obama became the first African American president in 2008, a historic milestone that seemed impossible just years earlier, and his election represented a profound moment in American history that demonstrated the nation's capacity for change. His presidency featured the Affordable Care Act (Obamacare), which extended health insurance to tens of millions of Americans, the recovery from the Great Recession through stimulus spending and auto industry bailout, the killing of Osama bin Laden, and the Paris Climate Agreement, as well as the Iran nuclear deal and the normalization of relations with Cuba. Obama faced unprecedented partisan obstruction from Congressional Republicans, including the blocking of his Supreme Court nominee Merrick Garland, and while he was personally popular and maintained dignity in office, his presidency also saw the rise of the Tea Party movement and deepening political polarization that contributed to the election of his successor.
131
+
132
+ ## Donald Trump
133
+ Donald Trump, a billionaire real estate developer and reality TV star with no prior political or military experience, won the 2016 election in a stunning upset, becoming the oldest person elected to a first term as president at age 70. His presidency was marked by the appointment of three Supreme Court justices, tax cuts, criminal justice reform, and a confrontational approach to traditional alliances while pursuing unconventional diplomacy with North Korea and skepticism of international agreements. Trump became the first president to be impeached twice—first for pressuring Ukraine to investigate his political rival, and second for inciting the January 6, 2021 insurrection at the U.S. Capitol after refusing to accept his 2020 election loss—and his norm-breaking presidency deepened political divisions while commanding intense loyalty from his base of supporters who appreciated his outsider status and combative style.
134
+
135
+ ## Joe Biden
136
+ Joe Biden became the oldest person ever elected president at age 78, bringing nearly five decades of political experience including 36 years as a Delaware senator and eight years as Barack Obama's vice president. His presidency focused on combating the COVID-19 pandemic through mass vaccination campaigns, passing major infrastructure investment, rejoining the Paris Climate Agreement, and supporting NATO unity in response to Russia's invasion of Ukraine, while also presiding over high inflation that eroded his popularity. Biden's legislative achievements included the American Rescue Plan, Infrastructure Investment and Jobs Act, CHIPS Act to boost semiconductor manufacturing, and the Inflation Reduction Act addressing climate change and healthcare costs, though his approval ratings suffered from concerns about inflation, immigration, and questions about his age and mental acuity that led him to announce he would not seek re-election in 2024.
@@ -0,0 +1,151 @@
1
+ # Interesting Facts About US States
2
+
3
+ ## Alabama
4
+ Alabama played a pivotal role in the Civil Rights Movement, with Montgomery serving as the birthplace of the famous bus boycott led by Rosa Parks in 1955. The state is also home to the U.S. Space and Rocket Center in Huntsville, where NASA's Marshall Space Flight Center developed the Saturn V rocket that took astronauts to the moon. Alabama's Gulf Coast beaches attract millions of visitors annually, while the state's steel industry in Birmingham once earned it the nickname "The Pittsburgh of the South."
5
+
6
+ ## Alaska
7
+ Alaska is the largest state in the United States by area, yet has one of the smallest populations, with vast stretches of wilderness remaining untouched by human development. The state experiences extreme variations in daylight, with some areas experiencing nearly 24 hours of sunlight in summer and near-total darkness in winter. Alaska's economy heavily depends on oil production, fishing, and tourism, with visitors flocking to see glaciers, wildlife including grizzly bears and whales, and the spectacular Northern Lights that illuminate the winter sky.
8
+
9
+ ## Arizona
10
+ Arizona is home to the Grand Canyon, one of the Seven Natural Wonders of the World, carved over millions of years by the Colorado River and stretching 277 miles long and up to 18 miles wide. The state's unique desert climate supports distinctive ecosystems including the iconic saguaro cactus, which can live for over 200 years and grow up to 40 feet tall. Arizona also contains more Native American reservations than any other state, with 22 federally recognized tribes maintaining their cultural heritage and traditions across the state's diverse landscape.
11
+
12
+ ## Arkansas
13
+ Arkansas is known as "The Natural State" due to its abundant natural beauty, including Hot Springs National Park, the only national park centered around a city. The state is the world's leading producer of rice in the United States and hosts Walmart's headquarters in Bentonville, making it a center of retail innovation. Arkansas played a significant role in the Civil Rights Movement when the Little Rock Nine integrated Central High School in 1957, a pivotal moment that helped advance school desegregation across the nation.
14
+
15
+ ## California
16
+ California boasts the largest economy of any U.S. state and would rank as the world's fifth-largest economy if it were an independent country. The state is home to Silicon Valley, the global center of technology and innovation, as well as Hollywood, which dominates the global entertainment industry. California's diverse geography includes sandy beaches, towering redwood forests, the Sierra Nevada mountains, Death Valley (the hottest place in North America), and some of the most productive agricultural land in the world.
17
+
18
+ ## Colorado
19
+ Colorado is home to 58 peaks that exceed 14,000 feet in elevation, known as "fourteeners," making it a paradise for mountain climbers and outdoor enthusiasts. The state's Rocky Mountain region attracts millions of skiers and snowboarders each year to world-class resorts like Aspen and Vail. Colorado became the first state to legalize recreational marijuana in 2012, pioneering a new approach to cannabis regulation that has since been adopted by other states and generated billions in tax revenue.
20
+
21
+ ## Connecticut
22
+ Connecticut played a crucial role in America's industrial revolution, earning the nickname "The Arsenal of Democracy" for its manufacturing prowess during World War II. The state is home to Yale University, one of the oldest and most prestigious institutions of higher learning in the United States, founded in 1701. Despite being the third-smallest state by area, Connecticut has one of the highest per capita incomes in the nation and pioneered many innovations including the first American dictionary, hamburger, and lollipop.
23
+
24
+ ## Delaware
25
+ Delaware was the first state to ratify the U.S. Constitution on December 7, 1787, earning it the nickname "The First State." More than half of all publicly traded companies in the United States are incorporated in Delaware due to its business-friendly corporate laws and Court of Chancery, which specializes in corporate law. The state has no sales tax, making it a popular destination for shoppers, and its beaches along the Atlantic coast attract tourists seeking a more relaxed alternative to nearby resort areas.
26
+
27
+ ## Florida
28
+ Florida is known as the "Sunshine State" and attracts over 100 million visitors annually to destinations like Walt Disney World, Universal Studios, and its famous beaches. The state has a unique ecosystem in the Everglades, the largest subtropical wilderness in the United States, home to rare species like the American alligator and Florida panther. Florida's economy is heavily dependent on tourism, agriculture (especially citrus production), and its status as a major gateway for international trade with Latin America and the Caribbean.
29
+
30
+ ## Georgia
31
+ Georgia is known as the "Peach State" and is a major producer of peanuts, pecans, and vidalia onions, though it actually ranks third in peach production behind California and South Carolina. Atlanta, the state capital, hosted the 1996 Summer Olympics and has become a major hub for film and television production, often called "the Hollywood of the South." Georgia played a significant role in the Civil Rights Movement, being the birthplace of Dr. Martin Luther King Jr. and home to many historic sites related to the struggle for racial equality.
32
+
33
+ ## Hawaii
34
+ Hawaii is the only U.S. state made up entirely of islands, consisting of eight main islands and numerous smaller ones formed by volcanic activity over millions of years. The state is home to active volcanoes including Kilauea, one of the world's most active volcanoes, which has been erupting continuously since 1983. Hawaii's unique isolation has led to the evolution of species found nowhere else on Earth, and its Polynesian culture blends with American traditions to create a distinctive multicultural society where the aloha spirit embodies hospitality and respect.
35
+
36
+ ## Idaho
37
+ Idaho is known as the "Gem State" due to the abundance of rare minerals and gemstones found within its borders, including star garnets found in only two places on Earth. The state produces about one-third of all potatoes grown in the United States, with the iconic Idaho russet potato being a staple of American cuisine. Idaho's rugged landscape includes the Frank Church-River of No Return Wilderness, the largest contiguous wilderness area in the lower 48 states, offering some of the most pristine backcountry experiences in North America.
38
+
39
+ ## Illinois
40
+ Illinois is home to Chicago, the third-largest city in the United States, which revolutionized architecture with the development of the skyscraper and remains a global center of finance, commerce, and culture. The state was the political home of Abraham Lincoln, who practiced law in Springfield before becoming the 16th President of the United States. Illinois' fertile prairie soil makes it one of the nation's leading agricultural producers, particularly of corn and soybeans, while also hosting major manufacturing and transportation industries due to its central location.
41
+
42
+ ## Indiana
43
+ Indiana is known as the "Crossroads of America" due to its central location and extensive network of highways that make it a major transportation hub. The state is famous for the Indianapolis 500, the world's largest single-day sporting event, which has been held annually since 1911 at the Indianapolis Motor Speedway. Indiana has a strong manufacturing tradition, particularly in automotive production and steel manufacturing, and is also a leading producer of corn and soybeans in the United States.
44
+
45
+ ## Iowa
46
+ Iowa is the leading producer of corn and soybeans in the United States, with over 85% of its land dedicated to agriculture, earning it the nickname "The Food Capital of the World." The state hosts the Iowa Caucuses, the first major electoral event in the presidential nomination process, giving Iowa significant political influence despite its relatively small population. Iowa is also known for its covered bridges, immortalized in the novel and film "The Bridges of Madison County," and for being the birthplace of aviation pioneer Amelia Earhart.
47
+
48
+ ## Kansas
49
+ Kansas sits at the geographic center of the contiguous United States and has been called "The Wheat State" due to its vast golden wheat fields that produce enough grain to feed much of the nation. The state played a pivotal role in the events leading up to the Civil War, with violent conflicts over slavery earning it the nickname "Bleeding Kansas" in the 1850s. Kansas is located in "Tornado Alley" and experiences more tornadoes per square mile than almost any other state, a reality that inspired the setting for "The Wizard of Oz."
50
+
51
+ ## Kentucky
52
+ Kentucky is world-famous for its bourbon whiskey production, with 95% of the world's bourbon being produced in the state due to its ideal climate and limestone-filtered water. The state is home to the Kentucky Derby, the most prestigious horse race in America, held annually at Churchill Downs in Louisville since 1875. Kentucky's landscape features the world's longest known cave system, Mammoth Cave, with over 400 miles of surveyed passageways, and the state has a rich musical heritage as the birthplace of bluegrass music.
53
+
54
+ ## Louisiana
55
+ Louisiana is known for its unique Creole and Cajun culture, a distinctive blend of French, Spanish, African, and Native American influences that is reflected in its cuisine, music, and architecture. The state's Mardi Gras celebration in New Orleans is world-famous, drawing millions of visitors for the elaborate parades, costumes, and festivities that precede Lent each year. Louisiana's economy is heavily dependent on oil and gas production from the Gulf of Mexico, and the state's Mississippi River port system handles a significant portion of America's international trade.
56
+
57
+ ## Maine
58
+ Maine is the most northeastern state in the United States and is famous for its rocky coastline, picturesque lighthouses, and lobster industry, which produces about 90% of the nation's lobster supply. The state is also the most forested state in the country, with over 90% of its land covered in trees, supporting a significant timber and paper industry. Maine is known for its natural beauty, including Acadia National Park, and has a strong tradition of maritime heritage reflected in its shipbuilding history and coastal communities.
59
+
60
+ ## Maryland
61
+ Maryland is home to the Chesapeake Bay, the largest estuary in the United States, which is famous for its blue crabs and has played a crucial role in the state's economy and culture. The state contains a portion of Washington D.C.'s suburbs and is home to numerous federal agencies and installations, including the National Security Agency at Fort Meade. Maryland played a unique role in the Civil War as a border state that remained in the Union despite having significant Southern sympathies, and Baltimore was a major port city that witnessed the writing of "The Star-Spangled Banner."
62
+
63
+ ## Massachusetts
64
+ Massachusetts played a central role in the American Revolution, with events like the Boston Tea Party and the battles of Lexington and Concord marking the beginning of the war for independence. The state is home to numerous prestigious institutions of higher learning, including Harvard University (the oldest in the nation), MIT, and dozens of other colleges and universities that make it a global center of education and research. Massachusetts pioneered universal health care coverage in the United States and has a thriving economy based on technology, biotechnology, finance, and education.
65
+
66
+ ## Michigan
67
+ Michigan is surrounded by four of the five Great Lakes and has more coastline than any other state except Alaska, earning it the nickname "The Great Lakes State." The state is synonymous with the American automotive industry, with Detroit serving as the historic home of Ford, General Motors, and Chrysler, though the industry has faced significant challenges in recent decades. Michigan's Upper Peninsula is separated from the rest of the state by the Straits of Mackinac and features pristine wilderness, including Isle Royale National Park, one of the least-visited but most ecologically pristine national parks in the country.
68
+
69
+ ## Minnesota
70
+ Minnesota is known as the "Land of 10,000 Lakes," though it actually contains over 11,000 lakes of varying sizes, making it a paradise for fishing, boating, and water sports. The state is home to the headwaters of the Mississippi River at Lake Itasca, and the Twin Cities of Minneapolis and St. Paul form a major metropolitan area known for its vibrant arts scene and high quality of life. Minnesota has a strong Scandinavian heritage, particularly from Norwegian and Swedish immigrants, and is famous for its harsh winters, progressive politics, and the Mall of America, one of the largest shopping centers in the United States.
71
+
72
+ ## Mississippi
73
+ Mississippi is named after the mighty Mississippi River that forms its western border and has been crucial to the state's history and economy. The state is considered the birthplace of American blues music, with legendary musicians like B.B. King, Muddy Waters, and Robert Johnson emerging from the Mississippi Delta region. Mississippi has a complex history regarding civil rights, being the site of significant struggles and tragedies during the Civil Rights Movement, and today the state continues to grapple with its past while working toward a more inclusive future.
74
+
75
+ ## Missouri
76
+ Missouri is known as the "Show Me State" and is located at the geographic and cultural crossroads of America, blending Midwestern, Southern, and Western influences. The state's Gateway Arch in St. Louis stands as the tallest man-made monument in the United States at 630 feet, symbolizing the city's historic role as the "Gateway to the West" during westward expansion. Missouri is home to the Harry S. Truman Presidential Library and was the starting point for the Lewis and Clark Expedition, which explored the Louisiana Purchase and opened up the American West.
77
+
78
+ ## Montana
79
+ Montana is the fourth-largest state by area but one of the least populated, with vast expanses of wilderness including Glacier National Park and a significant portion of Yellowstone National Park. The state's nickname "Big Sky Country" reflects its expansive landscapes and wide-open spaces, while its economy has traditionally depended on agriculture, mining, and timber. Montana is home to several Native American reservations and has a strong Western heritage reflected in its ranching culture and the historic mining town of Butte, once known as "The Richest Hill on Earth."
80
+
81
+ ## Nebraska
82
+ Nebraska is a leading agricultural state, producing large quantities of corn, soybeans, and beef, with more cattle than people residing within its borders. The state is home to the largest complex of wetlands in the western United States, the Sandhills region, which covers about one-quarter of the state and supports unique ecosystems. Nebraska's unicameral (one-house) legislature is the only nonpartisan state legislature in the country, a unique political structure that sets it apart from all other states.
83
+
84
+ ## Nevada
85
+ Nevada is known for Las Vegas, the "Entertainment Capital of the World," where legalized gambling and world-class entertainment have created a unique city that attracts over 40 million visitors annually. The state is the driest in the nation, with most of its land consisting of desert, and is home to numerous military installations including the mysterious Area 51. Nevada's economy is heavily dependent on tourism and gaming, though in recent years it has diversified into technology and renewable energy, and the state has no personal income tax, making it attractive to businesses and retirees.
86
+
87
+ ## New Hampshire
88
+ New Hampshire holds the first presidential primary in the nation, giving its residents outsized influence in selecting presidential candidates despite its small population. The state is known for its libertarian motto "Live Free or Die" and has no general sales tax or income tax, funding government through property taxes and other sources. New Hampshire's natural beauty includes the White Mountains, excellent skiing, and stunning fall foliage that attracts tourists from around the world, while its proximity to Boston makes it an attractive location for businesses and families.
89
+
90
+ ## New Jersey
91
+ New Jersey is the most densely populated state in the nation, yet it is nicknamed "The Garden State" due to its significant agricultural production, particularly of tomatoes, blueberries, and cranberries. The state played a crucial role in the American Revolution, with over 100 battles fought on New Jersey soil, including the pivotal Battle of Trenton. New Jersey's location between New York City and Philadelphia has made it a major transportation and industrial hub, and its shore communities along the Atlantic coast are popular summer destinations for millions of visitors.
92
+
93
+ ## New Mexico
94
+ New Mexico has a rich multicultural heritage blending Native American, Spanish, Mexican, and Anglo-American influences, reflected in its architecture, cuisine, and traditions. The state is home to Los Alamos National Laboratory, where the first atomic bomb was developed during World War II as part of the Manhattan Project, and continues to be a center for scientific research. New Mexico's landscape includes stunning desert scenery, ancient Pueblo ruins, the Carlsbad Caverns, and White Sands National Park, featuring the world's largest gypsum dune field.
95
+
96
+ ## New York
97
+ New York is home to New York City, the most populous city in the United States and a global center of finance, culture, media, and fashion. The state contains Niagara Falls, one of the most powerful waterfalls in the world, and the Adirondack Park, the largest publicly protected area in the contiguous United States. New York's diverse economy includes Wall Street's financial services, a thriving technology sector, agriculture, manufacturing, and tourism, making it one of the most economically important states in the nation.
98
+
99
+ ## North Carolina
100
+ North Carolina is known as the "First in Flight" because the Wright Brothers achieved the first powered airplane flight at Kitty Hawk in 1903, marking the beginning of modern aviation. The state's Research Triangle, formed by Raleigh, Durham, and Chapel Hill, is a major center for technology and pharmaceutical research, hosting numerous universities and corporate headquarters. North Carolina's diverse geography includes the Great Smoky Mountains, the Outer Banks barrier islands, and the Piedmont region, while its economy has transitioned from tobacco and textiles to technology and finance.
101
+
102
+ ## North Dakota
103
+ North Dakota experienced an economic boom in the early 2000s due to hydraulic fracturing technology that enabled extraction of oil from the Bakken formation, transforming it into one of the nation's leading oil-producing states. The state has the largest Scandinavian-American population percentage in the country and celebrates this heritage through festivals and cultural institutions. North Dakota is one of the least-visited states but offers unique attractions like Theodore Roosevelt National Park, which preserves the badlands landscape that inspired the future president's conservation efforts.
104
+
105
+ ## Ohio
106
+ Ohio is known as the "Mother of Presidents" because eight U.S. presidents were born in the state, more than any other except Virginia. The state played a crucial role in American industrialization, with cities like Cleveland, Cincinnati, and Toledo becoming major manufacturing centers, though the economy has since diversified. Ohio is a crucial swing state in presidential elections, often reflecting the mood of the nation, and is home to the Rock and Roll Hall of Fame in Cleveland, honoring the genre's pioneers and legends.
107
+
108
+ ## Oklahoma
109
+ Oklahoma has a complex history shaped by the forced relocation of Native American tribes during the Trail of Tears in the 1830s, and today it has the second-largest Native American population of any state. The state's economy was historically based on oil and agriculture, with the 1930s Dust Bowl devastation immortalized in John Steinbeck's "The Grapes of Wrath." Oklahoma is located in "Tornado Alley" and experiences some of the most severe weather in the United States, while also being known for its country music heritage and rodeo culture.
110
+
111
+ ## Oregon
112
+ Oregon is known for its environmental consciousness and natural beauty, from the rugged Pacific coastline to the volcanic peaks of the Cascade Range, including Crater Lake, the deepest lake in the United States. The state has no sales tax and pioneered progressive policies including vote-by-mail, physician-assisted suicide, and legal recreational marijuana. Oregon's economy is diverse, including technology companies in the Portland area, significant timber production, agriculture, and a thriving craft beer industry with more breweries per capita than any other state.
113
+
114
+ ## Pennsylvania
115
+ Pennsylvania played a crucial role in American history, with Philadelphia serving as the nation's capital during the Revolutionary War and hosting the signing of both the Declaration of Independence and the Constitution. The state's industrial heritage includes steel production in Pittsburgh, coal mining, and manufacturing, though the economy has diversified into healthcare, education, and technology. Pennsylvania is home to significant Amish and Mennonite communities, particularly in Lancaster County, where traditional farming and crafts continue in contrast to the state's urban centers.
116
+
117
+ ## Rhode Island
118
+ Rhode Island is the smallest state by area but has over 400 miles of coastline and is known as the "Ocean State," with a rich maritime heritage including sailing, fishing, and naval history. The state was founded by Roger Williams as a haven for religious freedom and was the first of the original thirteen colonies to declare independence from Britain. Despite its small size, Rhode Island has significant cultural and educational institutions, including Brown University, the Rhode Island School of Design, and the historic mansions of Newport that showcase America's Gilded Age wealth.
119
+
120
+ ## South Carolina
121
+ South Carolina played a pivotal role in the Civil War, with the first shots fired at Fort Sumter in Charleston Harbor in 1861, beginning the conflict that would reshape the nation. The state's coastal areas, particularly Myrtle Beach and Hilton Head Island, attract millions of tourists annually to their beautiful beaches and golf courses. South Carolina has a rich cultural heritage including Gullah culture among African Americans in the Lowcountry, historic plantations, and Charleston, consistently ranked as one of America's most beautiful and hospitable cities.
122
+
123
+ ## South Dakota
124
+ South Dakota is home to Mount Rushmore, one of America's most iconic landmarks, featuring the carved faces of four presidents: Washington, Jefferson, Theodore Roosevelt, and Lincoln. The state contains the Badlands, a striking landscape of eroded rock formations, and is sacred to many Native American tribes, particularly the Black Hills, which were the subject of a Supreme Court case regarding broken treaties. South Dakota has no state income tax and has attracted financial companies and other businesses to Sioux Falls, while agriculture and tourism remain important economic drivers.
125
+
126
+ ## Tennessee
127
+ Tennessee is known as the birthplace of country music, with Nashville serving as "Music City USA" and home to the Grand Ole Opry and numerous recording studios. The state also gave birth to blues, rock and roll, and soul music in Memphis, where Elvis Presley's Graceland is one of the most-visited homes in America. Tennessee's diverse geography includes the Great Smoky Mountains National Park, the most-visited national park in the United States, and its economy includes automotive manufacturing, healthcare, and tourism.
128
+
129
+ ## Texas
130
+ Texas is the second-largest state by both area and population, with an economy so large that if it were an independent country, it would rank among the top ten in the world. The state has a unique history as an independent republic from 1836 to 1845 and maintains a strong sense of identity and pride in its heritage. Texas is a major producer of oil, natural gas, cattle, cotton, and technology, with cities like Houston, Dallas, Austin, and San Antonio each having distinct characters and contributing to the state's diverse economy.
131
+
132
+ ## Utah
133
+ Utah is home to five spectacular national parks known as the "Mighty Five," including Zion, Bryce Canyon, Arches, Canyonlands, and Capitol Reef, featuring some of the most stunning red rock landscapes in the world. The state was settled by Mormon pioneers in 1847 and remains the headquarters of The Church of Jesus Christ of Latter-day Saints, with about 60% of the population belonging to the faith. Utah hosted the 2002 Winter Olympics in Salt Lake City and is known for having "The Greatest Snow on Earth" at its numerous ski resorts in the Wasatch Mountains.
134
+
135
+ ## Vermont
136
+ Vermont is famous for its stunning fall foliage, covered bridges, and picturesque small towns that embody the charm of rural New England. The state is the largest producer of maple syrup in the United States, producing about 50% of the nation's supply, and has a strong tradition of environmental conservation and sustainable agriculture. Vermont was an independent republic from 1777 to 1791 and was the first state to abolish slavery in its constitution, reflecting a progressive tradition that continues with policies like universal healthcare initiatives.
137
+
138
+ ## Virginia
139
+ Virginia is known as the "Mother of Presidents" because eight U.S. presidents were born there, including four of the first five presidents, and played a central role in American history from colonial times through the Civil War. The state is home to numerous historic sites including Colonial Williamsburg, Monticello, Mount Vernon, and many Civil War battlefields that attract history enthusiasts from around the world. Virginia's economy has transitioned from tobacco agriculture to a diverse base including technology, federal contractors, military installations, and the headquarters of numerous corporations in the Northern Virginia suburbs of Washington, D.C.
140
+
141
+ ## Washington
142
+ Washington is home to several major technology companies including Microsoft, Amazon, and numerous startups, making the Seattle area a global center of innovation and commerce. The state's diverse geography includes the temperate rainforests of the Olympic Peninsula, the volcanic peaks of the Cascade Range including Mount Rainier, and the dry eastern region that produces significant agricultural products including apples and wheat. Washington has no state income tax and is known for its coffee culture, with Starbucks originating in Seattle, as well as its thriving aerospace industry anchored by Boeing.
143
+
144
+ ## West Virginia
145
+ West Virginia is the only state formed by seceding from a Confederate state during the Civil War, separating from Virginia in 1863 to remain loyal to the Union. The state's mountainous terrain has made it a center of coal mining for over a century, though the industry has declined significantly in recent decades, creating economic challenges. West Virginia offers stunning natural beauty including the New River Gorge, now designated as a national park, whitewater rafting, and some of the best rock climbing in the eastern United States.
146
+
147
+ ## Wisconsin
148
+ Wisconsin is known as "America's Dairyland" and produces more cheese than any other state, with a strong tradition of dairy farming and beer brewing brought by German and Scandinavian immigrants. The state has a progressive political tradition, being the first to implement workers' compensation, unemployment insurance, and other labor protections under Governor Robert La Follette in the early 1900s. Wisconsin's natural attractions include the Wisconsin Dells, thousands of lakes, and professional sports teams like the Green Bay Packers, the only community-owned team in major American professional sports.
149
+
150
+ ## Wyoming
151
+ Wyoming is the least populous state in the nation but was the first to grant women the right to vote in 1869, earning it the nickname "The Equality State." The state is home to Yellowstone National Park, the world's first national park established in 1872, and Grand Teton National Park, featuring some of the most dramatic mountain scenery in North America. Wyoming's economy is heavily dependent on mineral extraction, particularly coal, natural gas, and oil, and the state has no personal or corporate income tax, making it attractive to businesses despite its remote location and small population.
data/db/seeds.rb ADDED
@@ -0,0 +1,208 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Database seeding for HTM
4
+ #
5
+ # This file loads seed data from markdown files in db/seed_data/ directory
6
+ # and creates memory nodes with embeddings and tags.
7
+ #
8
+ # Configuration is read from environment variables:
9
+ # HTM_EMBEDDING_PROVIDER - Embedding provider (default: ollama)
10
+ # HTM_EMBEDDING_MODEL - Embedding model (default: nomic-embed-text)
11
+ # HTM_EMBEDDING_DIMENSIONS - Embedding dimensions (default: 768)
12
+ # HTM_TAG_PROVIDER - Tag extraction provider (default: ollama)
13
+ # HTM_TAG_MODEL - Tag extraction model (default: gemma3)
14
+ # OLLAMA_URL - Ollama server URL (default: http://localhost:11434)
15
+ # HTM_EMBEDDING_TIMEOUT - Embedding generation timeout in seconds (default: 120)
16
+ # HTM_TAG_TIMEOUT - Tag generation timeout in seconds (default: 180)
17
+ # HTM_CONNECTION_TIMEOUT - LLM connection timeout in seconds (default: 30)
18
+ # HTM_DBURL - Database connection URL
19
+ #
20
+ # Usage:
21
+ # rake htm:db:seed
22
+ # # or
23
+ # ruby -r ./lib/htm -e "load 'db/seeds.rb'"
24
+
25
+ require_relative '../lib/htm'
26
+
27
+ puts "=" * 80
28
+ puts "HTM Database Seeding"
29
+ puts "=" * 80
30
+ puts
31
+
32
+ # Configure HTM using environment variables or defaults
33
+ embedding_provider = (ENV['HTM_EMBEDDING_PROVIDER'] || 'ollama').to_sym
34
+ embedding_model = ENV['HTM_EMBEDDING_MODEL'] || 'nomic-embed-text'
35
+ embedding_dimensions = (ENV['HTM_EMBEDDING_DIMENSIONS'] || '768').to_i
36
+ tag_provider = (ENV['HTM_TAG_PROVIDER'] || 'ollama').to_sym
37
+ tag_model = ENV['HTM_TAG_MODEL'] || 'gemma3'
38
+ embedding_timeout = (ENV['HTM_EMBEDDING_TIMEOUT'] || '120').to_i
39
+ tag_timeout = (ENV['HTM_TAG_TIMEOUT'] || '180').to_i
40
+ connection_timeout = (ENV['HTM_CONNECTION_TIMEOUT'] || '30').to_i
41
+
42
+ puts "Configuration:"
43
+ puts " Embedding Provider: #{embedding_provider}"
44
+ puts " Embedding Model: #{embedding_model}"
45
+ puts " Embedding Dimensions: #{embedding_dimensions}"
46
+ puts " Tag Provider: #{tag_provider}"
47
+ puts " Tag Model: #{tag_model}"
48
+ puts " Timeouts: embedding=#{embedding_timeout}s, tag=#{tag_timeout}s, connection=#{connection_timeout}s"
49
+ puts
50
+
51
+ HTM.configure do |c|
52
+ c.embedding_provider = embedding_provider
53
+ c.embedding_model = embedding_model
54
+ c.embedding_dimensions = embedding_dimensions
55
+ c.tag_provider = tag_provider
56
+ c.tag_model = tag_model
57
+ c.embedding_timeout = embedding_timeout
58
+ c.tag_timeout = tag_timeout
59
+ c.connection_timeout = connection_timeout
60
+ c.ollama_url = ENV['OLLAMA_URL'] if ENV['OLLAMA_URL']
61
+ c.reset_to_defaults # Apply default implementations with configured settings
62
+ end
63
+
64
+ puts "✓ HTM configured"
65
+ puts
66
+
67
+ # Create HTM instance (uses default database config from ENV['HTM_DBURL'])
68
+ htm = HTM.new(robot_name: ENV['HTM_ROBOT_NAME'] || "Seed Robot")
69
+
70
+ # Add sample conversation messages
71
+ puts "Creating sample conversation..."
72
+
73
+ htm.remember(
74
+ "What is TimescaleDB good for?",
75
+ source: "user"
76
+ )
77
+
78
+ htm.remember(
79
+ "PostgreSQL with TimescaleDB provides efficient time-series data storage and querying capabilities.",
80
+ source: "assistant"
81
+ )
82
+
83
+ htm.remember(
84
+ "How much training data do ML models need?",
85
+ source: "user"
86
+ )
87
+
88
+ htm.remember(
89
+ "Machine learning models require large amounts of training data to achieve good performance.",
90
+ source: "assistant"
91
+ )
92
+
93
+ htm.remember(
94
+ "Tell me about Ruby on Rails",
95
+ source: "user"
96
+ )
97
+
98
+ htm.remember(
99
+ "Ruby on Rails is a web framework for building database-backed applications.",
100
+ source: "assistant"
101
+ )
102
+
103
+ puts "✓ Created 6 conversation messages (3 exchanges)"
104
+ puts
105
+
106
+ # Load and process all markdown files from seed_data directory
107
+ seed_data_dir = File.expand_path('../seed_data', __FILE__)
108
+ total_records = 6 # Start with conversation count
109
+
110
+ if Dir.exist?(seed_data_dir)
111
+ # Find all .md files in seed_data directory
112
+ md_files = Dir.glob(File.join(seed_data_dir, '*.md')).sort
113
+
114
+ if md_files.any?
115
+ puts "Found #{md_files.length} seed data files:"
116
+ md_files.each { |f| puts " - #{File.basename(f)}" }
117
+ puts
118
+
119
+ # Process each markdown file
120
+ md_files.each do |md_file|
121
+ filename = File.basename(md_file, '.md')
122
+ puts "Processing #{File.basename(md_file)}..."
123
+
124
+ content = File.read(md_file)
125
+ count = 0
126
+
127
+ # Parse markdown: find ## headers and their following paragraphs
128
+ current_section = nil
129
+ current_paragraph = []
130
+
131
+ content.each_line do |line|
132
+ line = line.strip
133
+
134
+ if line.start_with?('## ')
135
+ # Save previous section if we have one
136
+ if current_section && current_paragraph.any?
137
+ paragraph_text = current_paragraph.join(' ')
138
+ htm.remember(paragraph_text, source: filename)
139
+ count += 1
140
+ print "." if count % 10 == 0
141
+ end
142
+
143
+ # Start new section
144
+ current_section = line.sub(/^## /, '')
145
+ current_paragraph = []
146
+ elsif line.length > 0 && current_section
147
+ # Add to current paragraph
148
+ current_paragraph << line
149
+ end
150
+ end
151
+
152
+ # Don't forget the last section
153
+ if current_section && current_paragraph.any?
154
+ paragraph_text = current_paragraph.join(' ')
155
+ htm.remember(paragraph_text, source: filename)
156
+ count += 1
157
+ end
158
+
159
+ puts
160
+ puts "✓ Created #{count} memories from #{File.basename(md_file)}"
161
+ total_records += count
162
+ end
163
+ else
164
+ puts "⚠ No .md files found in #{seed_data_dir}"
165
+ end
166
+ else
167
+ puts "⚠ Seed data directory not found: #{seed_data_dir}"
168
+ end
169
+
170
+ puts
171
+ puts "=" * 80
172
+ puts "Summary"
173
+ puts "=" * 80
174
+ puts "✓ Database seeded with #{total_records} total nodes"
175
+ puts
176
+ puts "Waiting for background jobs to complete (embeddings and tags)..."
177
+ puts "This may take 2-3 minutes depending on your system and node count..."
178
+ puts
179
+
180
+ # Wait for background jobs to complete
181
+ # Estimate ~2 seconds per node for tags
182
+ wait_time = [total_records * 1.5, 30].max.to_i
183
+ puts "Waiting #{wait_time} seconds for background processing..."
184
+ sleep wait_time
185
+
186
+ puts
187
+ puts "Checking completion status..."
188
+
189
+ # Check completion status
190
+ nodes_with_embeddings = HTM::Models::Node.where.not(embedding: nil).count
191
+ puts " - Nodes with embeddings: #{nodes_with_embeddings}/#{total_records}"
192
+
193
+ total_tags = HTM::Models::NodeTag.count
194
+ puts " - Total tags generated: #{total_tags}"
195
+
196
+ unique_tags = HTM::Models::Tag.count
197
+ puts " - Unique tags in ontology: #{unique_tags}"
198
+
199
+ puts
200
+ if nodes_with_embeddings == total_records && total_tags > 0
201
+ puts "✓ All background jobs completed successfully!"
202
+ puts "=" * 80
203
+ else
204
+ puts "⚠ Some background jobs may still be running."
205
+ puts " Run this query to check progress:"
206
+ puts " HTM::Models::Node.where.not(embedding: nil).count"
207
+ puts "=" * 80
208
+ end