fact_db 0.0.2 → 0.0.3

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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +2 -0
  3. data/.yardopts +5 -0
  4. data/CHANGELOG.md +64 -0
  5. data/README.md +107 -6
  6. data/Rakefile +243 -10
  7. data/db/migrate/001_enable_extensions.rb +1 -0
  8. data/db/migrate/002_create_sources.rb +49 -0
  9. data/db/migrate/003_create_entities.rb +27 -15
  10. data/db/migrate/004_create_entity_aliases.rb +20 -7
  11. data/db/migrate/005_create_facts.rb +37 -21
  12. data/db/migrate/006_create_entity_mentions.rb +14 -6
  13. data/db/migrate/007_create_fact_sources.rb +16 -8
  14. data/docs/api/extractors/index.md +5 -5
  15. data/docs/api/extractors/llm.md +17 -17
  16. data/docs/api/extractors/rule-based.md +14 -14
  17. data/docs/api/facts.md +20 -20
  18. data/docs/api/index.md +4 -4
  19. data/docs/api/models/entity.md +21 -21
  20. data/docs/api/models/fact.md +15 -15
  21. data/docs/api/models/index.md +7 -7
  22. data/docs/api/models/{content.md → source.md} +29 -29
  23. data/docs/api/pipeline/extraction.md +25 -25
  24. data/docs/api/pipeline/index.md +1 -1
  25. data/docs/api/pipeline/resolution.md +4 -4
  26. data/docs/api/services/entity-service.md +20 -20
  27. data/docs/api/services/fact-service.md +12 -12
  28. data/docs/api/services/index.md +5 -5
  29. data/docs/api/services/{content-service.md → source-service.md} +27 -27
  30. data/docs/architecture/database-schema.md +46 -46
  31. data/docs/architecture/entity-resolution.md +6 -6
  32. data/docs/architecture/index.md +10 -10
  33. data/docs/architecture/temporal-facts.md +5 -5
  34. data/docs/architecture/three-layer-model.md +17 -17
  35. data/docs/concepts.md +6 -6
  36. data/docs/examples/basic-usage.md +20 -20
  37. data/docs/examples/hr-onboarding.md +17 -17
  38. data/docs/examples/index.md +4 -4
  39. data/docs/examples/news-analysis.md +23 -23
  40. data/docs/getting-started/database-setup.md +28 -20
  41. data/docs/getting-started/index.md +3 -3
  42. data/docs/getting-started/quick-start.md +33 -30
  43. data/docs/guides/batch-processing.md +26 -26
  44. data/docs/guides/configuration.md +158 -77
  45. data/docs/guides/entity-management.md +14 -14
  46. data/docs/guides/extracting-facts.md +28 -28
  47. data/docs/guides/ingesting-content.md +14 -14
  48. data/docs/guides/llm-integration.md +40 -32
  49. data/docs/guides/temporal-queries.md +11 -11
  50. data/docs/index.md +6 -2
  51. data/examples/.envrc +4 -0
  52. data/examples/.gitignore +1 -0
  53. data/examples/001_configuration.rb +312 -0
  54. data/examples/{basic_usage.rb → 010_basic_usage.rb} +47 -56
  55. data/examples/{entity_management.rb → 020_entity_management.rb} +57 -72
  56. data/examples/{temporal_queries.rb → 030_temporal_queries.rb} +39 -59
  57. data/examples/040_output_formats.rb +177 -0
  58. data/examples/{rule_based_extraction.rb → 050_rule_based_extraction.rb} +39 -45
  59. data/examples/060_fluent_temporal_api.rb +217 -0
  60. data/examples/070_introspection.rb +252 -0
  61. data/examples/{hr_system.rb → 080_hr_system.rb} +56 -75
  62. data/examples/090_ingest_demo.rb +515 -0
  63. data/examples/100_query_context.rb +668 -0
  64. data/examples/110_prove_it.rb +204 -0
  65. data/examples/120_dump_database.rb +358 -0
  66. data/examples/130_rag_feedback_loop.rb +858 -0
  67. data/examples/README.md +229 -15
  68. data/examples/data/lincoln_associates.md +201 -0
  69. data/examples/data/lincoln_biography.md +66 -0
  70. data/examples/data/lincoln_cabinet.md +243 -0
  71. data/examples/data/lincoln_family.md +163 -0
  72. data/examples/data/lincoln_military.md +241 -0
  73. data/examples/data/lincoln_todd_family.md +136 -0
  74. data/examples/ingest_reporter.rb +335 -0
  75. data/examples/utilities.rb +182 -0
  76. data/lib/fact_db/config/defaults.yml +254 -0
  77. data/lib/fact_db/config.rb +94 -35
  78. data/lib/fact_db/database.rb +98 -8
  79. data/lib/fact_db/extractors/base.rb +106 -21
  80. data/lib/fact_db/extractors/llm_extractor.rb +35 -63
  81. data/lib/fact_db/extractors/manual_extractor.rb +46 -6
  82. data/lib/fact_db/extractors/rule_based_extractor.rb +136 -25
  83. data/lib/fact_db/llm/adapter.rb +3 -3
  84. data/lib/fact_db/models/entity.rb +94 -22
  85. data/lib/fact_db/models/entity_alias.rb +41 -7
  86. data/lib/fact_db/models/entity_mention.rb +34 -1
  87. data/lib/fact_db/models/fact.rb +259 -28
  88. data/lib/fact_db/models/fact_source.rb +43 -9
  89. data/lib/fact_db/models/source.rb +113 -0
  90. data/lib/fact_db/pipeline/extraction_pipeline.rb +35 -35
  91. data/lib/fact_db/pipeline/resolution_pipeline.rb +5 -5
  92. data/lib/fact_db/query_result.rb +202 -0
  93. data/lib/fact_db/resolution/entity_resolver.rb +139 -39
  94. data/lib/fact_db/resolution/fact_resolver.rb +86 -14
  95. data/lib/fact_db/services/entity_service.rb +246 -37
  96. data/lib/fact_db/services/fact_service.rb +254 -17
  97. data/lib/fact_db/services/source_service.rb +164 -0
  98. data/lib/fact_db/temporal/query.rb +71 -7
  99. data/lib/fact_db/temporal/query_builder.rb +69 -0
  100. data/lib/fact_db/temporal/timeline.rb +102 -11
  101. data/lib/fact_db/transformers/base.rb +77 -0
  102. data/lib/fact_db/transformers/cypher_transformer.rb +185 -0
  103. data/lib/fact_db/transformers/json_transformer.rb +17 -0
  104. data/lib/fact_db/transformers/raw_transformer.rb +35 -0
  105. data/lib/fact_db/transformers/text_transformer.rb +114 -0
  106. data/lib/fact_db/transformers/triple_transformer.rb +138 -0
  107. data/lib/fact_db/validation/alias_filter.rb +185 -0
  108. data/lib/fact_db/version.rb +1 -1
  109. data/lib/fact_db.rb +281 -30
  110. data/mkdocs.yml +2 -2
  111. metadata +60 -16
  112. data/db/migrate/002_create_contents.rb +0 -44
  113. data/lib/fact_db/models/content.rb +0 -62
  114. data/lib/fact_db/services/content_service.rb +0 -93
data/examples/README.md CHANGED
@@ -1,21 +1,39 @@
1
1
  # FactDb Examples
2
2
 
3
- This directory contains demonstration programs showcasing the capabilities of the FactDb gem.
3
+ This directory contains demonstration programs showcasing the capabilities of the FactDb gem. Files are numbered to indicate a progressive learning path from basic to advanced.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
7
  1. PostgreSQL database with pgvector extension
8
- 2. Set the `DATABASE_URL` environment variable or use the default `postgres://localhost/fact_db_demo`
8
+ 2. Set the `FDB_DATABASE__NAME` environment variable or use the default `fact_db_demo`
9
9
  3. Run migrations to set up the schema
10
10
 
11
11
  ```bash
12
12
  bundle install
13
- DATABASE_URL=postgres://localhost/fact_db_demo rake db:migrate
13
+ FDB_DATABASE__NAME=fact_db_demo rake db:migrate
14
14
  ```
15
15
 
16
16
  ## Examples
17
17
 
18
- ### basic_usage.rb
18
+ ### 001_configuration.rb
19
+
20
+ **Complete guide to FactDb configuration**
21
+
22
+ Demonstrates all configuration methods:
23
+ - Bundled defaults (shipped with the gem)
24
+ - Environment variables (FDB_*)
25
+ - XDG user config files (~/.config/fact_db/fact_db.yml)
26
+ - Project config files (./config/fact_db.yml)
27
+ - Local overrides (./config/fact_db.local.yml)
28
+ - Programmatic configuration blocks
29
+ - Database URL reconciliation
30
+ - Configuration validation
31
+
32
+ ```bash
33
+ ruby examples/001_configuration.rb
34
+ ```
35
+
36
+ ### 010_basic_usage.rb
19
37
 
20
38
  **Foundational introduction to FactDb**
21
39
 
@@ -28,26 +46,26 @@ Demonstrates:
28
46
  - Getting system statistics
29
47
 
30
48
  ```bash
31
- ruby examples/basic_usage.rb
49
+ ruby examples/010_basic_usage.rb
32
50
  ```
33
51
 
34
- ### entity_management.rb
52
+ ### 020_entity_management.rb
35
53
 
36
54
  **Deep dive into entity operations**
37
55
 
38
56
  Demonstrates:
39
- - Creating entities with multiple types (person, organization, place)
57
+ - Creating entities with multiple kinds (person, organization, place)
40
58
  - Managing aliases (names, emails, abbreviations)
41
59
  - Entity resolution using fuzzy matching
42
60
  - Merging duplicate entities
43
- - Searching entities by name and type
61
+ - Searching entities by name and kind
44
62
  - Building entity timelines
45
63
 
46
64
  ```bash
47
- ruby examples/entity_management.rb
65
+ ruby examples/020_entity_management.rb
48
66
  ```
49
67
 
50
- ### temporal_queries.rb
68
+ ### 030_temporal_queries.rb
51
69
 
52
70
  **Working with time-based data**
53
71
 
@@ -61,10 +79,26 @@ Demonstrates:
61
79
  - Querying facts by entity role
62
80
 
63
81
  ```bash
64
- ruby examples/temporal_queries.rb
82
+ ruby examples/030_temporal_queries.rb
83
+ ```
84
+
85
+ ### 040_output_formats.rb
86
+
87
+ **LLM-optimized output transformers**
88
+
89
+ Demonstrates the new output format system:
90
+ - JSON format (default) for structured data
91
+ - Triples format (Subject-Predicate-Object) for knowledge graphs
92
+ - Cypher format for graph database notation
93
+ - Text format for human-readable output
94
+ - Raw format for ActiveRecord access
95
+ - Using formats with queries
96
+
97
+ ```bash
98
+ ruby examples/040_output_formats.rb
65
99
  ```
66
100
 
67
- ### rule_based_extraction.rb
101
+ ### 050_rule_based_extraction.rb
68
102
 
69
103
  **Automatic fact extraction from text**
70
104
 
@@ -77,10 +111,43 @@ Demonstrates:
77
111
  - Testing individual extraction patterns
78
112
 
79
113
  ```bash
80
- ruby examples/rule_based_extraction.rb
114
+ ruby examples/050_rule_based_extraction.rb
115
+ ```
116
+
117
+ ### 060_fluent_temporal_api.rb
118
+
119
+ **Fluent query builder for temporal analysis**
120
+
121
+ Demonstrates the new chainable API:
122
+ - `facts.at(date)` - Query at a specific point in time
123
+ - `facts.at(date).facts_for(entity_id)` - Entity state at a date
124
+ - `facts.at(date).compare_to(other_date)` - Compare two dates
125
+ - `facts.diff(topic, from:, to:)` - Compute temporal diffs
126
+ - Career timeline snapshots across multiple dates
127
+
128
+ ```bash
129
+ ruby examples/060_fluent_temporal_api.rb
81
130
  ```
82
131
 
83
- ### hr_system.rb
132
+ ### 070_introspection.rb
133
+
134
+ **Schema and data introspection**
135
+
136
+ Demonstrates discovery capabilities:
137
+ - `facts.introspect()` - Discover system capabilities
138
+ - `facts.introspect(topic)` - Examine specific entities
139
+ - `facts.suggest_queries(topic)` - Get query suggestions
140
+ - `facts.suggest_strategies(query)` - Strategy recommendations
141
+ - `entity_service.relationship_types` - All relationship types
142
+ - `entity_service.timespan_for(id)` - Fact date range
143
+ - `fact_service.fact_stats(id)` - Fact status breakdown
144
+ - Building LLM context with introspection
145
+
146
+ ```bash
147
+ ruby examples/070_introspection.rb
148
+ ```
149
+
150
+ ### 080_hr_system.rb
84
151
 
85
152
  **Practical HR knowledge management system**
86
153
 
@@ -96,7 +163,107 @@ A comprehensive real-world example demonstrating:
96
163
  - HR statistics and reporting
97
164
 
98
165
  ```bash
99
- ruby examples/hr_system.rb
166
+ ruby examples/080_hr_system.rb
167
+ ```
168
+
169
+ ### 090_ingest_demo.rb
170
+
171
+ **Building a fact database from markdown files**
172
+
173
+ Demonstrates LLM-based ingestion:
174
+ - Parsing markdown files with optional YAML frontmatter
175
+ - Using LLM-based extraction to identify entities and facts
176
+ - Automatic entity resolution and deduplication
177
+ - Progressive entity discovery from text
178
+
179
+ ```bash
180
+ ruby examples/090_ingest_demo.rb <directory> # Build/update database
181
+ ruby examples/090_ingest_demo.rb <file.md> # Process single file
182
+ ruby examples/090_ingest_demo.rb <path> --rebuild # Drop and rebuild
183
+ ruby examples/090_ingest_demo.rb --stats # Show statistics only
184
+ ```
185
+
186
+ ### 100_query_context.rb
187
+
188
+ **Natural language query to context generation**
189
+
190
+ Takes a natural language query and generates context from the facts database suitable for LLM consumption. Features multi-signal relevance ranking with configurable weights.
191
+
192
+ Demonstrates:
193
+ - Extracting entity candidates from natural language queries
194
+ - Resolving entities from query text (proper nouns, possessives)
195
+ - Multi-strategy fact gathering (entity mentions, full-text search, semantic search)
196
+ - **Multi-signal relevance ranking** with PostgreSQL ts_rank, pgvector similarity, and heuristics
197
+ - Generating context in multiple output formats
198
+ - Building LLM-ready context from a facts database
199
+
200
+ ```bash
201
+ # Basic usage
202
+ ruby examples/100_query_context.rb "Who is Sapphira's husband?"
203
+
204
+ # With verbose output showing processing steps and signal breakdown
205
+ ruby examples/100_query_context.rb --verbose "What happened to Ananias?"
206
+
207
+ # Different output formats
208
+ ruby examples/100_query_context.rb --format triples "Tell me about Peter"
209
+ ruby examples/100_query_context.rb --format json "Who are the apostles?"
210
+ ruby examples/100_query_context.rb --format cypher "Where was Stephen martyred?"
211
+
212
+ # Disable ranking (return facts in database order)
213
+ ruby examples/100_query_context.rb --no-rank "Tell me about the apostles"
214
+ ```
215
+
216
+ **Ranking Signals** (configurable via FactDb.config.ranking):
217
+ | Signal | Default Weight | Description |
218
+ |--------|----------------|-------------|
219
+ | ts_rank | 0.25 | PostgreSQL full-text search relevance |
220
+ | vector_similarity | 0.25 | Semantic similarity via pgvector embeddings |
221
+ | entity_mentions | 0.15 | Facts mentioning query entities |
222
+ | direct_answer | 0.15 | Pattern match for query intent |
223
+ | term_overlap | 0.10 | Query word matches |
224
+ | relationship_match | 0.05 | Relationship words (husband, wife, etc.) |
225
+ | confidence | 0.05 | Fact's stored confidence score |
226
+
227
+ **Note:** Run `090_ingest_demo.rb acts_esv/` first to populate the database with biblical facts.
228
+
229
+ ## Utilities
230
+
231
+ ### 110_prove_it.rb
232
+
233
+ **Source evidence viewer**
234
+
235
+ Displays fact records along with their original source text evidence.
236
+
237
+ ```bash
238
+ ruby examples/110_prove_it.rb <fact_id> [fact_id...] # Show facts with evidence
239
+ ruby examples/110_prove_it.rb --last <n> # Show last n facts
240
+ ruby examples/110_prove_it.rb --search <term> # Search facts and show evidence
241
+ ```
242
+
243
+ ### 120_dump_database.rb
244
+
245
+ **Database export utility**
246
+
247
+ Dumps the contents of the fact_db database in a structured format for verification and inspection.
248
+
249
+ ```bash
250
+ ruby examples/120_dump_database.rb # Full dump
251
+ ruby examples/120_dump_database.rb --summary # Summary only
252
+ ruby examples/120_dump_database.rb --entities # Entities only
253
+ ruby examples/120_dump_database.rb --facts # Facts only
254
+ ruby examples/120_dump_database.rb --content # Content only
255
+ ruby examples/120_dump_database.rb --search TERM # Search facts/entities
256
+ ```
257
+
258
+ ### 130_cleanup_aliases.rb
259
+
260
+ **Alias maintenance utility**
261
+
262
+ Cleanup script to remove invalid aliases (pronouns, generic terms, etc.) from existing entities.
263
+
264
+ ```bash
265
+ ruby examples/130_cleanup_aliases.rb # Dry run
266
+ ruby examples/130_cleanup_aliases.rb --execute # Actually delete
100
267
  ```
101
268
 
102
269
  ## Key Concepts
@@ -128,3 +295,50 @@ All facts link back to source content:
128
295
  - Primary sources (direct evidence)
129
296
  - Supporting sources (additional evidence)
130
297
  - Corroborating sources (independent confirmation)
298
+
299
+ ### Output Formats
300
+
301
+ Facts can be transformed into multiple formats optimized for different consumers:
302
+ - `json` - Structured data with entities and metadata
303
+ - `triples` - Subject-Predicate-Object for semantic reasoning
304
+ - `cypher` - Graph notation for Neo4j-style visualization
305
+ - `text` - Human-readable markdown format
306
+ - `raw` - Direct ActiveRecord objects
307
+
308
+ ### Fluent Temporal API
309
+
310
+ The chainable `at()` method provides an intuitive way to query temporal data:
311
+ ```ruby
312
+ facts.at("2024-01-15").facts_for(entity_id) # What did we know?
313
+ facts.at("2024-01-15").compare_to("2024-06-15") # What changed?
314
+ facts.diff(nil, from: "2024-01", to: "2024-06") # Detailed diff
315
+ ```
316
+
317
+ ### Introspection
318
+
319
+ Discover what the system knows before querying:
320
+ ```ruby
321
+ facts.introspect # Schema, capabilities, statistics
322
+ facts.introspect("Paula") # Entity coverage, relationships
323
+ facts.suggest_queries("Paula") # What can I ask about Paula?
324
+ ```
325
+
326
+ ### Ranking Configuration
327
+
328
+ Tune relevance ranking weights for your use case:
329
+ ```ruby
330
+ FactDb.configure do |config|
331
+ # Boost semantic search for concept-heavy domains
332
+ config.ranking.vector_similarity_weight = 0.35
333
+ config.ranking.ts_rank_weight = 0.15
334
+
335
+ # Or boost entity mentions for person-centric queries
336
+ config.ranking.entity_mention_weight = 0.30
337
+ end
338
+ ```
339
+
340
+ Or via environment variables:
341
+ ```bash
342
+ export FDB_RANKING__VECTOR_SIMILARITY_WEIGHT=0.35
343
+ export FDB_RANKING__TS_RANK_WEIGHT=0.15
344
+ ```
@@ -0,0 +1,201 @@
1
+ # Abraham Lincoln's Associates, Friends, and Colleagues
2
+
3
+ ## Law Partners
4
+
5
+ ### John Todd Stuart (First Law Partner, 1837-1841)
6
+
7
+ | Field | Value |
8
+ |-------|-------|
9
+ | Full Name | John Todd Stuart |
10
+ | Partnership Period | 1837-1841 |
11
+ | Relationship | Cousin of Mary Todd Lincoln |
12
+ | Role | Senior partner |
13
+ | Political Office | U.S. Representative from Illinois |
14
+ | How They Met | Illinois militia during Black Hawk War |
15
+ | Contribution | Encouraged Lincoln to study law |
16
+
17
+ Stuart was Lincoln's first law partner and mentor. He encouraged Lincoln to pursue a legal career and lent him law books.
18
+
19
+ ### Stephen T. Logan (Second Law Partner, 1841-1844)
20
+
21
+ | Field | Value |
22
+ |-------|-------|
23
+ | Full Name | Stephen Trigg Logan |
24
+ | Partnership Period | 1841-1844 |
25
+ | Role | Senior partner |
26
+ | Reputation | One of the best lawyers in Illinois |
27
+ | Political Role | Member of "the Junto" political group |
28
+ | Impact | Helped refine Lincoln's legal skills |
29
+
30
+ ### William H. Herndon (Third and Final Law Partner, 1844-1865)
31
+
32
+ | Field | Value |
33
+ |-------|-------|
34
+ | Full Name | William Henry Herndon |
35
+ | Birth Date | December 25, 1818 |
36
+ | Birth Place | Green County, Kentucky |
37
+ | Partnership Period | 1844-1865 (until Lincoln's death) |
38
+ | How They Met | At Joshua Speed's store; debates and poetry readings |
39
+ | Lincoln's Quote | "He was my man always above all other men on the globe" |
40
+ | Political Role | Active in founding Republican Party in Illinois |
41
+ | Public Service | Mayor of Springfield (1855) |
42
+ | Later Work | Wrote "Herndon's Lincoln: The True Story of a Great Life" (1888, with Jesse Weik) |
43
+
44
+ Herndon was Lincoln's longest-serving and most loyal law partner. Their office was located in downtown Springfield on Sixth Street in the Tinsley building. Lincoln invited the younger Herndon to form a partnership in October 1844. Unlike Lincoln, Herndon did not travel the Eighth Judicial Circuit but argued cases in court while Lincoln rode the circuit. They split fees equally.
45
+
46
+ After Lincoln's assassination, Herndon spent nearly 20 years compiling histories and interviews for his biography of Lincoln.
47
+
48
+ ---
49
+
50
+ ## Close Friends
51
+
52
+ ### Joshua F. Speed
53
+
54
+ | Field | Value |
55
+ |-------|-------|
56
+ | Full Name | Joshua Fry Speed |
57
+ | Relationship | Close friend and roommate |
58
+ | Home State | Kentucky (transplant to Illinois) |
59
+ | Occupation | General store owner |
60
+ | Meeting | Lincoln roomed with Speed when first arriving in Springfield |
61
+ | Duration of Friendship | Lifelong |
62
+ | Significance | Perhaps Lincoln's closest personal friend |
63
+
64
+ Speed and Lincoln shared living quarters above Speed's store in Springfield. Their friendship is considered one of the closest of Lincoln's life.
65
+
66
+ ### Edward Dickinson Baker
67
+
68
+ | Field | Value |
69
+ |-------|-------|
70
+ | Full Name | Edward Dickinson Baker |
71
+ | Relationship | Close friend and political ally |
72
+ | Occupation | Politician, Lawyer, Military officer |
73
+ | Lincoln's Honor | Lincoln's son Edward ("Eddie") was named after him |
74
+ | Political Role | Member of "the Junto" political group |
75
+ | Death | Killed at Battle of Ball's Bluff (October 21, 1861) |
76
+ | Significance | Only sitting U.S. Senator to die in combat |
77
+
78
+ ---
79
+
80
+ ## Political Associates
81
+
82
+ ### "The Junto" Political Group
83
+
84
+ A political group in Springfield that included Lincoln and other prominent Whig politicians:
85
+
86
+ | Member | Role/Position |
87
+ |--------|---------------|
88
+ | Abraham Lincoln | Politician, Lawyer |
89
+ | Edward D. Baker | Politician, Lawyer |
90
+ | Stephen T. Logan | Lawyer, Politician |
91
+ | Ninian W. Edwards | Politician (brother-in-law of Lincoln) |
92
+
93
+ ### Stephen A. Douglas (Political Rival)
94
+
95
+ | Field | Value |
96
+ |-------|-------|
97
+ | Full Name | Stephen Arnold Douglas |
98
+ | Nickname | "The Little Giant" |
99
+ | Relationship | Political rival |
100
+ | Notable | Lincoln-Douglas Debates (1858) |
101
+ | 1858 Senate Race | Douglas defeated Lincoln |
102
+ | 1860 Presidential Race | Lincoln defeated Douglas |
103
+ | Death | June 3, 1861 |
104
+
105
+ Douglas and Lincoln debated slavery and popular sovereignty in the famous 1858 Senate race debates. Though rivals, Douglas ultimately supported Lincoln's efforts to preserve the Union.
106
+
107
+ ---
108
+
109
+ ## Springfield Connections
110
+
111
+ ### William Butler
112
+
113
+ | Field | Value |
114
+ |-------|-------|
115
+ | Full Name | William Butler |
116
+ | Occupation | Attorney |
117
+ | Relationship | Lincoln often took meals with the Butler family |
118
+
119
+ ### Ninian W. Edwards
120
+
121
+ | Field | Value |
122
+ |-------|-------|
123
+ | Full Name | Ninian Wirt Edwards |
124
+ | Relationship | Brother-in-law (married to Mary's sister Elizabeth) |
125
+ | Occupation | Politician, Lawyer |
126
+ | Political Role | Member of "the Junto" |
127
+ | Significance | Lincoln met Mary Todd at the Edwards home |
128
+
129
+ ---
130
+
131
+ ## Presidential Secretaries
132
+
133
+ ### John George Nicolay
134
+
135
+ | Field | Value |
136
+ |-------|-------|
137
+ | Full Name | John George Nicolay |
138
+ | Position | Private Secretary to President Lincoln |
139
+ | Term | 1861-1865 |
140
+ | Birth | Bavaria, Germany |
141
+ | Later Work | Co-authored "Abraham Lincoln: A History" (10 volumes) with Hay |
142
+
143
+ ### John Milton Hay
144
+
145
+ | Field | Value |
146
+ |-------|-------|
147
+ | Full Name | John Milton Hay |
148
+ | Position | Assistant Private Secretary to President Lincoln |
149
+ | Term | 1861-1865 |
150
+ | Later Career | U.S. Secretary of State (1898-1905) |
151
+ | Later Work | Co-authored "Abraham Lincoln: A History" with Nicolay |
152
+
153
+ Nicolay and Hay lived in the White House and worked closely with Lincoln throughout his presidency. They later co-authored the authoritative 10-volume biography of Lincoln.
154
+
155
+ ---
156
+
157
+ ## Military Associates
158
+
159
+ (See separate file: lincoln_military.md for detailed information)
160
+
161
+ Key military associates included:
162
+ - Ulysses S. Grant
163
+ - William T. Sherman
164
+ - George B. McClellan
165
+ - Edwin M. Stanton (Secretary of War)
166
+
167
+ ---
168
+
169
+ ## Legal Circuit Associates
170
+
171
+ Lincoln practiced on the Eighth Judicial Circuit in Illinois, where he developed relationships with other lawyers and judges:
172
+
173
+ ### David Davis
174
+
175
+ | Field | Value |
176
+ |-------|-------|
177
+ | Full Name | David Davis |
178
+ | Occupation | Judge, Politician |
179
+ | Role | Presiding judge on Eighth Judicial Circuit |
180
+ | 1860 Campaign | Managed Lincoln's presidential campaign |
181
+ | Later Position | U.S. Supreme Court Justice (appointed by Lincoln) |
182
+
183
+ ---
184
+
185
+ ## Key Relationships Summary
186
+
187
+ | Category | Notable Names |
188
+ |----------|---------------|
189
+ | Law Partners | Stuart, Logan, Herndon |
190
+ | Close Friends | Joshua Speed, Edward Baker |
191
+ | Political Allies | Davis, Baker, Edwards |
192
+ | Political Rivals | Stephen Douglas |
193
+ | Presidential Staff | Nicolay, Hay |
194
+ | Family Connections | Edwards (brother-in-law), Stuart (Mary's cousin) |
195
+
196
+ ## Sources
197
+
198
+ - Mr. Lincoln and Friends (mrlincolnandfriends.org)
199
+ - Abraham Lincoln's Classroom
200
+ - Illinois Historic Preservation Division
201
+ - Papers of Abraham Lincoln
@@ -0,0 +1,66 @@
1
+ # Abraham Lincoln - Biography
2
+
3
+ ## Basic Information
4
+
5
+ | Field | Value |
6
+ |-------|-------|
7
+ | Full Name | Abraham Lincoln |
8
+ | Birth Date | February 12, 1809 |
9
+ | Birth Place | Hardin County (now LaRue County), Kentucky |
10
+ | Birth Location | One-room log cabin on Sinking Spring Farm near Hodgenville |
11
+ | Death Date | April 15, 1865 |
12
+ | Death Place | Petersen House, Washington, D.C. |
13
+ | Cause of Death | Assassination (gunshot wound to the head) |
14
+ | Age at Death | 56 years |
15
+ | Height | 6 feet 4 inches |
16
+ | Occupation | Lawyer, Politician |
17
+ | Political Party | Whig (early career), Republican |
18
+ | Religion | No formal church membership; spiritual beliefs |
19
+ | Presidency | 16th President of the United States |
20
+ | Presidential Term | March 4, 1861 - April 15, 1865 |
21
+ | Burial Place | Oak Ridge Cemetery, Springfield, Illinois |
22
+
23
+ ## Physical Description
24
+
25
+ Abraham Lincoln was notably tall at 6 feet 4 inches, making him the tallest U.S. president. He was described as "tall and lanky" with distinctive features that made him stand out in any crowd.
26
+
27
+ ## Early Life Summary
28
+
29
+ Lincoln was born into humble circumstances on the Kentucky frontier. His family moved to Indiana when he was seven years old, and later to Illinois when he was twenty-one. Despite limited formal education (less than 12 months total), Lincoln was a voracious reader and self-taught himself law.
30
+
31
+ ## Career Progression
32
+
33
+ 1. **Farmer/Laborer** - Early years helping family on frontier farms
34
+ 2. **Rail Splitter** - Manual labor in his youth
35
+ 3. **Store Clerk** - New Salem, Illinois (1831)
36
+ 4. **Militia Captain** - Black Hawk War (1832)
37
+ 5. **Postmaster** - New Salem (1833-1836)
38
+ 6. **Surveyor** - Sangamon County
39
+ 7. **Illinois State Legislator** - Four terms (1834-1842)
40
+ 8. **Lawyer** - Springfield, Illinois (1836-1861)
41
+ 9. **U.S. Representative** - Illinois 7th District (1847-1849)
42
+ 10. **Presidential Candidate** - Lost Senate race to Douglas (1858)
43
+ 11. **President of the United States** - (1861-1865)
44
+
45
+ ## Key Accomplishments
46
+
47
+ - Preserved the Union during the Civil War
48
+ - Issued the Emancipation Proclamation (January 1, 1863)
49
+ - Delivered the Gettysburg Address (November 19, 1863)
50
+ - Promoted passage of the 13th Amendment abolishing slavery
51
+ - Strengthened the federal government
52
+ - Modernized the economy through the Homestead Act, transcontinental railroad, and national banking system
53
+
54
+ ## Famous Quotes
55
+
56
+ - "A house divided against itself cannot stand."
57
+ - "Four score and seven years ago..."
58
+ - "Government of the people, by the people, for the people, shall not perish from the earth."
59
+ - "With malice toward none, with charity for all..."
60
+
61
+ ## Sources
62
+
63
+ - White House Historical Association
64
+ - National Archives Presidential Resources
65
+ - Library of Congress Abraham Lincoln Papers
66
+ - Miller Center, University of Virginia