htm 0.0.1 → 0.0.10
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.
- checksums.yaml +4 -4
- data/.aigcm_msg +1 -0
- data/.architecture/reviews/comprehensive-codebase-review.md +577 -0
- data/.claude/settings.local.json +92 -0
- data/.envrc +1 -0
- data/.irbrc +283 -80
- data/.tbls.yml +31 -0
- data/CHANGELOG.md +314 -16
- data/CLAUDE.md +603 -0
- data/README.md +76 -5
- data/Rakefile +5 -0
- data/SETUP.md +132 -101
- data/db/migrate/{20250101000001_enable_extensions.rb → 00001_enable_extensions.rb} +0 -1
- data/db/migrate/00002_create_robots.rb +11 -0
- data/db/migrate/00003_create_file_sources.rb +20 -0
- data/db/migrate/00004_create_nodes.rb +65 -0
- data/db/migrate/00005_create_tags.rb +13 -0
- data/db/migrate/00006_create_node_tags.rb +18 -0
- data/db/migrate/00007_create_robot_nodes.rb +26 -0
- data/db/migrate/00009_add_working_memory_to_robot_nodes.rb +12 -0
- data/db/schema.sql +390 -36
- data/docs/api/database.md +19 -232
- data/docs/api/embedding-service.md +1 -7
- data/docs/api/htm.md +305 -364
- data/docs/api/index.md +1 -7
- data/docs/api/long-term-memory.md +342 -590
- data/docs/api/yard/HTM/ActiveRecordConfig.md +23 -0
- data/docs/api/yard/HTM/AuthorizationError.md +11 -0
- data/docs/api/yard/HTM/CircuitBreaker.md +92 -0
- data/docs/api/yard/HTM/CircuitBreakerOpenError.md +34 -0
- data/docs/api/yard/HTM/Configuration.md +175 -0
- data/docs/api/yard/HTM/Database.md +99 -0
- data/docs/api/yard/HTM/DatabaseError.md +14 -0
- data/docs/api/yard/HTM/EmbeddingError.md +18 -0
- data/docs/api/yard/HTM/EmbeddingService.md +58 -0
- data/docs/api/yard/HTM/Error.md +11 -0
- data/docs/api/yard/HTM/JobAdapter.md +39 -0
- data/docs/api/yard/HTM/LongTermMemory.md +342 -0
- data/docs/api/yard/HTM/NotFoundError.md +17 -0
- data/docs/api/yard/HTM/Observability.md +107 -0
- data/docs/api/yard/HTM/QueryTimeoutError.md +19 -0
- data/docs/api/yard/HTM/Railtie.md +27 -0
- data/docs/api/yard/HTM/ResourceExhaustedError.md +13 -0
- data/docs/api/yard/HTM/TagError.md +18 -0
- data/docs/api/yard/HTM/TagService.md +67 -0
- data/docs/api/yard/HTM/Timeframe/Result.md +24 -0
- data/docs/api/yard/HTM/Timeframe.md +40 -0
- data/docs/api/yard/HTM/TimeframeExtractor/Result.md +24 -0
- data/docs/api/yard/HTM/TimeframeExtractor.md +45 -0
- data/docs/api/yard/HTM/ValidationError.md +20 -0
- data/docs/api/yard/HTM/WorkingMemory.md +131 -0
- data/docs/api/yard/HTM.md +80 -0
- data/docs/api/yard/index.csv +179 -0
- data/docs/api/yard-reference.md +51 -0
- data/docs/architecture/adrs/001-postgresql-timescaledb.md +1 -1
- data/docs/architecture/adrs/003-ollama-embeddings.md +1 -1
- data/docs/architecture/adrs/010-redis-working-memory-rejected.md +2 -27
- data/docs/architecture/adrs/index.md +2 -13
- data/docs/architecture/hive-mind.md +165 -166
- data/docs/architecture/index.md +2 -2
- data/docs/architecture/overview.md +5 -171
- data/docs/architecture/two-tier-memory.md +1 -35
- data/docs/assets/images/adr-010-current-architecture.svg +37 -0
- data/docs/assets/images/adr-010-proposed-architecture.svg +48 -0
- data/docs/assets/images/adr-dependency-tree.svg +93 -0
- data/docs/assets/images/class-hierarchy.svg +55 -0
- data/docs/assets/images/exception-hierarchy.svg +45 -0
- data/docs/assets/images/htm-architecture-overview.svg +83 -0
- data/docs/assets/images/htm-complete-memory-flow.svg +160 -0
- data/docs/assets/images/htm-context-assembly-flow.svg +148 -0
- data/docs/assets/images/htm-eviction-process.svg +141 -0
- data/docs/assets/images/htm-memory-addition-flow.svg +138 -0
- data/docs/assets/images/htm-memory-recall-flow.svg +152 -0
- data/docs/assets/images/htm-node-states.svg +123 -0
- data/docs/assets/images/project-structure.svg +78 -0
- data/docs/assets/images/test-directory-structure.svg +38 -0
- data/{dbdoc → docs/database}/README.md +127 -125
- data/docs/database/public.file_sources.md +42 -0
- data/docs/database/public.file_sources.svg +211 -0
- data/{dbdoc → docs/database}/public.node_tags.md +7 -8
- data/docs/database/public.node_tags.svg +239 -0
- data/{dbdoc → docs/database}/public.nodes.md +22 -17
- data/docs/database/public.nodes.svg +271 -0
- data/docs/database/public.robot_nodes.md +46 -0
- data/docs/database/public.robot_nodes.svg +243 -0
- data/{dbdoc → docs/database}/public.robots.md +2 -3
- data/docs/database/public.robots.svg +161 -0
- data/docs/database/public.tags.svg +139 -0
- data/{dbdoc → docs/database}/schema.json +941 -630
- data/docs/database/schema.svg +282 -0
- data/docs/development/index.md +1 -29
- data/docs/development/schema.md +134 -309
- data/docs/development/testing.md +1 -9
- data/docs/getting-started/index.md +47 -0
- data/docs/{installation.md → getting-started/installation.md} +2 -2
- data/docs/{quick-start.md → getting-started/quick-start.md} +5 -5
- data/docs/guides/adding-memories.md +295 -643
- data/docs/guides/recalling-memories.md +36 -1
- data/docs/guides/search-strategies.md +85 -51
- data/docs/images/htm-er-diagram.svg +156 -0
- data/docs/index.md +16 -31
- data/docs/multi_framework_support.md +4 -4
- data/examples/README.md +280 -0
- data/examples/basic_usage.rb +18 -16
- data/examples/cli_app/htm_cli.rb +146 -8
- data/examples/cli_app/temp.log +93 -0
- data/examples/custom_llm_configuration.rb +1 -2
- data/examples/example_app/app.rb +11 -14
- data/examples/file_loader_usage.rb +177 -0
- data/examples/robot_groups/lib/robot_group.rb +419 -0
- data/examples/robot_groups/lib/working_memory_channel.rb +140 -0
- data/examples/robot_groups/multi_process.rb +286 -0
- data/examples/robot_groups/robot_worker.rb +136 -0
- data/examples/robot_groups/same_process.rb +229 -0
- data/examples/sinatra_app/Gemfile +1 -0
- data/examples/sinatra_app/Gemfile.lock +166 -0
- data/examples/sinatra_app/app.rb +219 -24
- data/examples/timeframe_demo.rb +276 -0
- data/lib/htm/active_record_config.rb +10 -3
- data/lib/htm/circuit_breaker.rb +202 -0
- data/lib/htm/configuration.rb +313 -80
- data/lib/htm/database.rb +67 -36
- data/lib/htm/embedding_service.rb +39 -2
- data/lib/htm/errors.rb +131 -11
- data/lib/htm/{sinatra.rb → integrations/sinatra.rb} +87 -12
- data/lib/htm/job_adapter.rb +10 -3
- data/lib/htm/jobs/generate_embedding_job.rb +5 -4
- data/lib/htm/jobs/generate_tags_job.rb +4 -0
- data/lib/htm/loaders/markdown_loader.rb +263 -0
- data/lib/htm/loaders/paragraph_chunker.rb +112 -0
- data/lib/htm/long_term_memory.rb +601 -321
- data/lib/htm/models/file_source.rb +99 -0
- data/lib/htm/models/node.rb +116 -12
- data/lib/htm/models/robot.rb +53 -4
- data/lib/htm/models/robot_node.rb +51 -0
- data/lib/htm/models/tag.rb +302 -0
- data/lib/htm/observability.rb +395 -0
- data/lib/htm/tag_service.rb +60 -3
- data/lib/htm/tasks.rb +29 -0
- data/lib/htm/timeframe.rb +194 -0
- data/lib/htm/timeframe_extractor.rb +307 -0
- data/lib/htm/version.rb +1 -1
- data/lib/htm/working_memory.rb +165 -70
- data/lib/htm.rb +352 -133
- data/lib/tasks/doc.rake +300 -0
- data/lib/tasks/files.rake +299 -0
- data/lib/tasks/htm.rake +188 -2
- data/lib/tasks/jobs.rake +10 -12
- data/lib/tasks/tags.rake +194 -0
- data/mkdocs.yml +91 -9
- data/notes/ARCHITECTURE_REVIEW.md +1167 -0
- data/notes/IMPLEMENTATION_SUMMARY.md +606 -0
- data/notes/MULTI_FRAMEWORK_IMPLEMENTATION.md +451 -0
- data/notes/next_steps.md +100 -0
- data/notes/plan.md +627 -0
- data/notes/tag_ontology_enhancement_ideas.md +222 -0
- data/notes/timescaledb_removal_summary.md +200 -0
- metadata +177 -37
- data/db/migrate/20250101000002_create_robots.rb +0 -14
- data/db/migrate/20250101000003_create_nodes.rb +0 -42
- data/db/migrate/20250101000005_create_tags.rb +0 -38
- data/db/migrate/20250101000007_add_node_vector_indexes.rb +0 -30
- data/dbdoc/public.node_tags.svg +0 -112
- data/dbdoc/public.nodes.svg +0 -118
- data/dbdoc/public.robots.svg +0 -90
- data/dbdoc/public.tags.svg +0 -60
- data/dbdoc/schema.svg +0 -154
- data/{dbdoc → docs/database}/public.node_stats.md +0 -0
- data/{dbdoc → docs/database}/public.node_stats.svg +0 -0
- data/{dbdoc → docs/database}/public.nodes_tags.md +0 -0
- data/{dbdoc → docs/database}/public.nodes_tags.svg +0 -0
- data/{dbdoc → docs/database}/public.ontology_structure.md +0 -0
- data/{dbdoc → docs/database}/public.ontology_structure.svg +0 -0
- data/{dbdoc → docs/database}/public.operations_log.md +0 -0
- data/{dbdoc → docs/database}/public.operations_log.svg +0 -0
- data/{dbdoc → docs/database}/public.relationships.md +0 -0
- data/{dbdoc → docs/database}/public.relationships.svg +0 -0
- data/{dbdoc → docs/database}/public.robot_activity.md +0 -0
- data/{dbdoc → docs/database}/public.robot_activity.svg +0 -0
- data/{dbdoc → docs/database}/public.schema_migrations.md +0 -0
- data/{dbdoc → docs/database}/public.schema_migrations.svg +0 -0
- data/{dbdoc → docs/database}/public.tags.md +3 -3
- /data/{dbdoc → docs/database}/public.topic_relationships.md +0 -0
- /data/{dbdoc → docs/database}/public.topic_relationships.svg +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<svg viewBox="0 0 1000 700" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<!-- Title -->
|
|
3
|
+
<text x="500" y="30" text-anchor="middle" fill="#FFFFFF" font-size="20" font-weight="bold">Node States in HTM</text>
|
|
4
|
+
|
|
5
|
+
<!-- Start state -->
|
|
6
|
+
<circle cx="100" cy="120" r="15" fill="#4CAF50" stroke="#4CAF50" stroke-width="3"/>
|
|
7
|
+
<circle cx="100" cy="120" r="10" fill="transparent" stroke="#4CAF50" stroke-width="3"/>
|
|
8
|
+
|
|
9
|
+
<!-- Created state -->
|
|
10
|
+
<rect x="220" y="90" width="160" height="60" fill="rgba(76, 175, 80, 0.3)" stroke="#4CAF50" stroke-width="3" rx="8"/>
|
|
11
|
+
<text x="300" y="125" text-anchor="middle" fill="#FFFFFF" font-size="14" font-weight="bold">Created</text>
|
|
12
|
+
|
|
13
|
+
<!-- InBothMemories state -->
|
|
14
|
+
<rect x="220" y="220" width="200" height="80" fill="rgba(33, 150, 243, 0.3)" stroke="#2196F3" stroke-width="3" rx="8"/>
|
|
15
|
+
<text x="320" y="250" text-anchor="middle" fill="#FFFFFF" font-size="14" font-weight="bold">InBothMemories</text>
|
|
16
|
+
<text x="320" y="270" text-anchor="middle" fill="#B0B0B0" font-size="11">in_working_memory=TRUE</text>
|
|
17
|
+
<text x="320" y="288" text-anchor="middle" fill="#B0B0B0" font-size="11">Node in WM + LTM</text>
|
|
18
|
+
|
|
19
|
+
<!-- WorkingMemoryOnly state -->
|
|
20
|
+
<rect x="500" y="220" width="220" height="80" fill="rgba(255, 152, 0, 0.3)" stroke="#FF9800" stroke-width="3" rx="8"/>
|
|
21
|
+
<text x="610" y="248" text-anchor="middle" fill="#FFFFFF" font-size="13" font-weight="bold">WorkingMemoryOnly</text>
|
|
22
|
+
<text x="610" y="270" text-anchor="middle" fill="#B0B0B0" font-size="11">in_working_memory=FALSE</text>
|
|
23
|
+
<text x="610" y="288" text-anchor="middle" fill="#B0B0B0" font-size="11">(Evicted from WM)</text>
|
|
24
|
+
|
|
25
|
+
<!-- LongTermMemoryOnly state -->
|
|
26
|
+
<rect x="780" y="220" width="200" height="80" fill="rgba(156, 39, 176, 0.3)" stroke="#9C27B0" stroke-width="3" rx="8"/>
|
|
27
|
+
<text x="880" y="248" text-anchor="middle" fill="#FFFFFF" font-size="13" font-weight="bold">LongTermMemory</text>
|
|
28
|
+
<text x="880" y="266" text-anchor="middle" fill="#FFFFFF" font-size="13" font-weight="bold">Only</text>
|
|
29
|
+
<text x="880" y="288" text-anchor="middle" fill="#B0B0B0" font-size="11">(WM cleared)</text>
|
|
30
|
+
|
|
31
|
+
<!-- Forgotten state -->
|
|
32
|
+
<rect x="470" y="450" width="150" height="60" fill="rgba(244, 67, 54, 0.3)" stroke="#F44336" stroke-width="3" rx="8"/>
|
|
33
|
+
<text x="545" y="485" text-anchor="middle" fill="#FFFFFF" font-size="14" font-weight="bold">Forgotten</text>
|
|
34
|
+
|
|
35
|
+
<!-- End state -->
|
|
36
|
+
<circle cx="545" cy="590" r="15" fill="transparent" stroke="#F44336" stroke-width="3"/>
|
|
37
|
+
<circle cx="545" cy="590" r="10" fill="#F44336"/>
|
|
38
|
+
|
|
39
|
+
<!-- Transitions -->
|
|
40
|
+
<!-- Start to Created -->
|
|
41
|
+
<path d="M 115 120 L 220 120" stroke="#4CAF50" stroke-width="2" fill="none" marker-end="url(#arrow1)"/>
|
|
42
|
+
<text x="167" y="115" text-anchor="middle" fill="#4CAF50" font-size="11">add_node()</text>
|
|
43
|
+
|
|
44
|
+
<!-- Created to InBothMemories -->
|
|
45
|
+
<path d="M 300 150 L 300 220" stroke="#2196F3" stroke-width="2" fill="none" marker-end="url(#arrow2)"/>
|
|
46
|
+
<text x="330" y="190" text-anchor="middle" fill="#2196F3" font-size="11">Initial state</text>
|
|
47
|
+
|
|
48
|
+
<!-- InBothMemories to WorkingMemoryOnly -->
|
|
49
|
+
<path d="M 420 260 L 500 260" stroke="#FF9800" stroke-width="2" fill="none" marker-end="url(#arrow3)"/>
|
|
50
|
+
<text x="460" y="250" text-anchor="middle" fill="#FF9800" font-size="10">Evicted</text>
|
|
51
|
+
<text x="460" y="263" text-anchor="middle" fill="#FF9800" font-size="10">from WM</text>
|
|
52
|
+
|
|
53
|
+
<!-- InBothMemories to LongTermMemoryOnly -->
|
|
54
|
+
<path d="M 420 260 Q 600 200 780 260" stroke="#9C27B0" stroke-width="2" fill="none" marker-end="url(#arrow4)"/>
|
|
55
|
+
<text x="600" y="220" text-anchor="middle" fill="#9C27B0" font-size="10">WM cleared</text>
|
|
56
|
+
|
|
57
|
+
<!-- WorkingMemoryOnly back to InBothMemories -->
|
|
58
|
+
<path d="M 610 220 Q 520 180 420 220" stroke="#4CAF50" stroke-width="2" fill="none" marker-end="url(#arrow1)"/>
|
|
59
|
+
<text x="520" y="185" text-anchor="middle" fill="#4CAF50" font-size="10">Recalled</text>
|
|
60
|
+
|
|
61
|
+
<!-- LongTermMemoryOnly back to InBothMemories -->
|
|
62
|
+
<path d="M 880 300 Q 680 360 420 300" stroke="#4CAF50" stroke-width="2" fill="none" marker-end="url(#arrow1)"/>
|
|
63
|
+
<text x="650" y="340" text-anchor="middle" fill="#4CAF50" font-size="10">Recalled</text>
|
|
64
|
+
|
|
65
|
+
<!-- InBothMemories to Forgotten -->
|
|
66
|
+
<path d="M 320 300 L 320 380 L 490 380 L 490 450" stroke="#F44336" stroke-width="2" fill="none" marker-end="url(#arrow5)"/>
|
|
67
|
+
<text x="390" y="375" text-anchor="middle" fill="#F44336" font-size="10">forget(confirm:</text>
|
|
68
|
+
<text x="390" y="388" text-anchor="middle" fill="#F44336" font-size="10">:confirmed)</text>
|
|
69
|
+
|
|
70
|
+
<!-- WorkingMemoryOnly to Forgotten -->
|
|
71
|
+
<path d="M 610 300 L 610 400 L 580 400 L 580 450" stroke="#F44336" stroke-width="2" fill="none" marker-end="url(#arrow5)"/>
|
|
72
|
+
<text x="640" y="380" text-anchor="middle" fill="#F44336" font-size="10">forget(confirm:</text>
|
|
73
|
+
<text x="640" y="393" text-anchor="middle" fill="#F44336" font-size="10">:confirmed)</text>
|
|
74
|
+
|
|
75
|
+
<!-- LongTermMemoryOnly to Forgotten -->
|
|
76
|
+
<path d="M 880 300 L 880 400 L 600 400 L 600 450" stroke="#F44336" stroke-width="2" fill="none" marker-end="url(#arrow5)"/>
|
|
77
|
+
<text x="740" y="395" text-anchor="middle" fill="#F44336" font-size="10">forget(confirm: :confirmed)</text>
|
|
78
|
+
|
|
79
|
+
<!-- Forgotten to End -->
|
|
80
|
+
<path d="M 545 510 L 545 575" stroke="#F44336" stroke-width="2" fill="none" marker-end="url(#arrow5)"/>
|
|
81
|
+
|
|
82
|
+
<!-- Notes -->
|
|
83
|
+
<rect x="20" y="360" width="180" height="120" fill="rgba(33, 150, 243, 0.1)" stroke="#2196F3" stroke-width="2" rx="5" stroke-dasharray="5,5"/>
|
|
84
|
+
<text x="110" y="380" text-anchor="middle" fill="#2196F3" font-size="12" font-weight="bold">InBothMemories</text>
|
|
85
|
+
<text x="110" y="400" text-anchor="middle" fill="#B0B0B0" font-size="10">Node exists in:</text>
|
|
86
|
+
<text x="110" y="415" text-anchor="middle" fill="#B0B0B0" font-size="10">• Working Memory</text>
|
|
87
|
+
<text x="110" y="430" text-anchor="middle" fill="#B0B0B0" font-size="10"> (fast access)</text>
|
|
88
|
+
<text x="110" y="445" text-anchor="middle" fill="#B0B0B0" font-size="10">• Long-Term Memory</text>
|
|
89
|
+
<text x="110" y="460" text-anchor="middle" fill="#B0B0B0" font-size="10"> (persistent)</text>
|
|
90
|
+
<text x="110" y="475" text-anchor="middle" fill="#4CAF50" font-size="10" font-weight="bold">in_working_memory=TRUE</text>
|
|
91
|
+
|
|
92
|
+
<rect x="700" y="400" width="180" height="90" fill="rgba(156, 39, 176, 0.1)" stroke="#9C27B0" stroke-width="2" rx="5" stroke-dasharray="5,5"/>
|
|
93
|
+
<text x="790" y="420" text-anchor="middle" fill="#9C27B0" font-size="12" font-weight="bold">LTM Only</text>
|
|
94
|
+
<text x="790" y="440" text-anchor="middle" fill="#B0B0B0" font-size="10">Node exists only in:</text>
|
|
95
|
+
<text x="790" y="455" text-anchor="middle" fill="#B0B0B0" font-size="10">• Long-Term Memory</text>
|
|
96
|
+
<text x="790" y="475" text-anchor="middle" fill="#F44336" font-size="10" font-weight="bold">in_working_memory=FALSE</text>
|
|
97
|
+
<text x="790" y="487" text-anchor="middle" fill="#B0B0B0" font-size="9">(Evicted due to token limit)</text>
|
|
98
|
+
|
|
99
|
+
<rect x="630" y="600" width="180" height="80" fill="rgba(244, 67, 54, 0.1)" stroke="#F44336" stroke-width="2" rx="5" stroke-dasharray="5,5"/>
|
|
100
|
+
<text x="720" y="620" text-anchor="middle" fill="#F44336" font-size="12" font-weight="bold">Forgotten</text>
|
|
101
|
+
<text x="720" y="640" text-anchor="middle" fill="#B0B0B0" font-size="10">Node permanently</text>
|
|
102
|
+
<text x="720" y="655" text-anchor="middle" fill="#B0B0B0" font-size="10">deleted from both</text>
|
|
103
|
+
<text x="720" y="670" text-anchor="middle" fill="#B0B0B0" font-size="10">memories</text>
|
|
104
|
+
|
|
105
|
+
<!-- Markers -->
|
|
106
|
+
<defs>
|
|
107
|
+
<marker id="arrow1" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
108
|
+
<polygon points="0 0, 10 3, 0 6" fill="#4CAF50"/>
|
|
109
|
+
</marker>
|
|
110
|
+
<marker id="arrow2" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
111
|
+
<polygon points="0 0, 10 3, 0 6" fill="#2196F3"/>
|
|
112
|
+
</marker>
|
|
113
|
+
<marker id="arrow3" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
114
|
+
<polygon points="0 0, 10 3, 0 6" fill="#FF9800"/>
|
|
115
|
+
</marker>
|
|
116
|
+
<marker id="arrow4" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
117
|
+
<polygon points="0 0, 10 3, 0 6" fill="#9C27B0"/>
|
|
118
|
+
</marker>
|
|
119
|
+
<marker id="arrow5" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
120
|
+
<polygon points="0 0, 10 3, 0 6" fill="#F44336"/>
|
|
121
|
+
</marker>
|
|
122
|
+
</defs>
|
|
123
|
+
</svg>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<svg viewBox="0 0 800 900" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<!-- Title -->
|
|
3
|
+
<text x="400" y="30" text-anchor="middle" fill="#FFFFFF" font-size="20" font-weight="bold">HTM Project Structure</text>
|
|
4
|
+
|
|
5
|
+
<!-- Root -->
|
|
6
|
+
<text x="50" y="70" fill="#4CAF50" font-size="14" font-weight="bold">htm/</text>
|
|
7
|
+
|
|
8
|
+
<!-- lib/ -->
|
|
9
|
+
<text x="70" y="100" fill="#2196F3" font-size="13" font-weight="bold">├── lib/</text>
|
|
10
|
+
<text x="250" y="100" fill="#B0B0B0" font-size="11">Main library code</text>
|
|
11
|
+
<text x="90" y="125" fill="#FF9800" font-size="12">├── htm.rb</text>
|
|
12
|
+
<text x="250" y="125" fill="#B0B0B0" font-size="10">HTM main class</text>
|
|
13
|
+
<text x="90" y="150" fill="#FF9800" font-size="12">└── htm/</text>
|
|
14
|
+
<text x="120" y="175" fill="#FFC107" font-size="11">├── database.rb</text>
|
|
15
|
+
<text x="300" y="175" fill="#B0B0B0" font-size="10">Database setup and management</text>
|
|
16
|
+
<text x="120" y="200" fill="#FFC107" font-size="11">├── long_term_memory.rb</text>
|
|
17
|
+
<text x="300" y="200" fill="#B0B0B0" font-size="10">PostgreSQL-backed storage</text>
|
|
18
|
+
<text x="120" y="225" fill="#FFC107" font-size="11">├── working_memory.rb</text>
|
|
19
|
+
<text x="300" y="225" fill="#B0B0B0" font-size="10">In-memory active context</text>
|
|
20
|
+
<text x="120" y="250" fill="#FFC107" font-size="11">├── embedding_service.rb</text>
|
|
21
|
+
<text x="300" y="250" fill="#B0B0B0" font-size="10">Vector embedding generation</text>
|
|
22
|
+
<text x="120" y="275" fill="#FFC107" font-size="11">└── version.rb</text>
|
|
23
|
+
<text x="300" y="275" fill="#B0B0B0" font-size="10">Version constant</text>
|
|
24
|
+
|
|
25
|
+
<!-- test/ -->
|
|
26
|
+
<text x="70" y="310" fill="#2196F3" font-size="13" font-weight="bold">├── test/</text>
|
|
27
|
+
<text x="250" y="310" fill="#B0B0B0" font-size="11">Test suite</text>
|
|
28
|
+
<text x="90" y="335" fill="#FF9800" font-size="12">├── test_helper.rb</text>
|
|
29
|
+
<text x="300" y="335" fill="#B0B0B0" font-size="10">Test configuration</text>
|
|
30
|
+
<text x="90" y="360" fill="#FF9800" font-size="12">├── htm_test.rb</text>
|
|
31
|
+
<text x="300" y="360" fill="#B0B0B0" font-size="10">Unit tests</text>
|
|
32
|
+
<text x="90" y="385" fill="#FF9800" font-size="12">├── embedding_service_test.rb</text>
|
|
33
|
+
<text x="300" y="385" fill="#B0B0B0" font-size="10">Embedding tests</text>
|
|
34
|
+
<text x="90" y="410" fill="#FF9800" font-size="12">└── integration_test.rb</text>
|
|
35
|
+
<text x="300" y="410" fill="#B0B0B0" font-size="10">Integration tests</text>
|
|
36
|
+
|
|
37
|
+
<!-- sql/ -->
|
|
38
|
+
<text x="70" y="445" fill="#2196F3" font-size="13" font-weight="bold">├── sql/</text>
|
|
39
|
+
<text x="250" y="445" fill="#B0B0B0" font-size="11">Database schemas</text>
|
|
40
|
+
<text x="90" y="470" fill="#FF9800" font-size="12">└── schema.sql</text>
|
|
41
|
+
<text x="300" y="470" fill="#B0B0B0" font-size="10">PostgreSQL schema</text>
|
|
42
|
+
|
|
43
|
+
<!-- examples/ -->
|
|
44
|
+
<text x="70" y="505" fill="#2196F3" font-size="13" font-weight="bold">├── examples/</text>
|
|
45
|
+
<text x="250" y="505" fill="#B0B0B0" font-size="11">Usage examples</text>
|
|
46
|
+
<text x="90" y="530" fill="#FF9800" font-size="12">└── basic_usage.rb</text>
|
|
47
|
+
<text x="300" y="530" fill="#B0B0B0" font-size="10">Basic usage demonstration</text>
|
|
48
|
+
|
|
49
|
+
<!-- docs/ -->
|
|
50
|
+
<text x="70" y="565" fill="#2196F3" font-size="13" font-weight="bold">├── docs/</text>
|
|
51
|
+
<text x="250" y="565" fill="#B0B0B0" font-size="11">Documentation (MkDocs)</text>
|
|
52
|
+
<text x="90" y="590" fill="#FF9800" font-size="12">├── development/</text>
|
|
53
|
+
<text x="300" y="590" fill="#B0B0B0" font-size="10">This guide</text>
|
|
54
|
+
<text x="90" y="615" fill="#FF9800" font-size="12">├── guides/</text>
|
|
55
|
+
<text x="300" y="615" fill="#B0B0B0" font-size="10">User guides</text>
|
|
56
|
+
<text x="90" y="640" fill="#FF9800" font-size="12">├── api/</text>
|
|
57
|
+
<text x="300" y="640" fill="#B0B0B0" font-size="10">API reference</text>
|
|
58
|
+
<text x="90" y="665" fill="#FF9800" font-size="12">└── architecture/</text>
|
|
59
|
+
<text x="300" y="665" fill="#B0B0B0" font-size="10">Architecture docs</text>
|
|
60
|
+
|
|
61
|
+
<!-- Root files -->
|
|
62
|
+
<text x="70" y="700" fill="#2196F3" font-size="13" font-weight="bold">├── Rakefile</text>
|
|
63
|
+
<text x="250" y="700" fill="#B0B0B0" font-size="11">Rake tasks</text>
|
|
64
|
+
<text x="70" y="725" fill="#2196F3" font-size="13" font-weight="bold">├── Gemfile</text>
|
|
65
|
+
<text x="250" y="725" fill="#B0B0B0" font-size="11">Development dependencies</text>
|
|
66
|
+
<text x="70" y="750" fill="#2196F3" font-size="13" font-weight="bold">├── htm.gemspec</text>
|
|
67
|
+
<text x="250" y="750" fill="#B0B0B0" font-size="11">Gem specification</text>
|
|
68
|
+
<text x="70" y="775" fill="#2196F3" font-size="13" font-weight="bold">└── README.md</text>
|
|
69
|
+
<text x="250" y="775" fill="#B0B0B0" font-size="11">Project overview</text>
|
|
70
|
+
|
|
71
|
+
<!-- Legend -->
|
|
72
|
+
<rect x="30" y="810" width="740" height="70" fill="rgba(33, 150, 243, 0.1)" stroke="#2196F3" stroke-width="2" rx="5" stroke-dasharray="5,5"/>
|
|
73
|
+
<text x="400" y="830" text-anchor="middle" fill="#2196F3" font-size="12" font-weight="bold">Directory Structure Key</text>
|
|
74
|
+
<text x="50" y="850" fill="#B0B0B0" font-size="10">• <tspan fill="#4CAF50" font-weight="bold">Green</tspan>: Root directory</text>
|
|
75
|
+
<text x="250" y="850" fill="#B0B0B0" font-size="10">• <tspan fill="#2196F3" font-weight="bold">Blue</tspan>: Directories & root files</text>
|
|
76
|
+
<text x="500" y="850" fill="#B0B0B0" font-size="10">• <tspan fill="#FF9800" font-weight="bold">Orange/Yellow</tspan>: Files</text>
|
|
77
|
+
<text x="50" y="870" fill="#B0B0B0" font-size="10">• <tspan fill="#B0B0B0">Gray</tspan>: Descriptions</text>
|
|
78
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<svg viewBox="0 0 700 400" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<!-- Title -->
|
|
3
|
+
<text x="350" y="30" text-anchor="middle" fill="#FFFFFF" font-size="18" font-weight="bold">Test Directory Structure</text>
|
|
4
|
+
|
|
5
|
+
<!-- Root -->
|
|
6
|
+
<text x="100" y="80" fill="#4CAF50" font-size="14" font-weight="bold">test/</text>
|
|
7
|
+
|
|
8
|
+
<!-- test_helper.rb -->
|
|
9
|
+
<text x="120" y="120" fill="#2196F3" font-size="13">├── test_helper.rb</text>
|
|
10
|
+
<text x="350" y="120" fill="#B0B0B0" font-size="11">Shared test configuration</text>
|
|
11
|
+
|
|
12
|
+
<!-- htm_test.rb -->
|
|
13
|
+
<text x="120" y="155" fill="#2196F3" font-size="13">├── htm_test.rb</text>
|
|
14
|
+
<text x="350" y="155" fill="#B0B0B0" font-size="11">Unit tests for HTM class</text>
|
|
15
|
+
|
|
16
|
+
<!-- embedding_service_test.rb -->
|
|
17
|
+
<text x="120" y="190" fill="#2196F3" font-size="13">├── embedding_service_test.rb</text>
|
|
18
|
+
<text x="350" y="190" fill="#B0B0B0" font-size="11">Unit tests for EmbeddingService</text>
|
|
19
|
+
|
|
20
|
+
<!-- integration_test.rb -->
|
|
21
|
+
<text x="120" y="225" fill="#2196F3" font-size="13">├── integration_test.rb</text>
|
|
22
|
+
<text x="350" y="225" fill="#B0B0B0" font-size="11">Integration tests</text>
|
|
23
|
+
|
|
24
|
+
<!-- fixtures/ -->
|
|
25
|
+
<text x="120" y="260" fill="#9C27B0" font-size="13">└── fixtures/</text>
|
|
26
|
+
<text x="350" y="260" fill="#B0B0B0" font-size="11">Test data (future)</text>
|
|
27
|
+
|
|
28
|
+
<!-- sample_memories.json -->
|
|
29
|
+
<text x="160" y="295" fill="#FF9800" font-size="12">└── sample_memories.json</text>
|
|
30
|
+
<text x="400" y="295" fill="#B0B0B0" font-size="10">Sample test data</text>
|
|
31
|
+
|
|
32
|
+
<!-- Legend -->
|
|
33
|
+
<rect x="50" y="330" width="600" height="50" fill="rgba(33, 150, 243, 0.1)" stroke="#2196F3" stroke-width="2" rx="5" stroke-dasharray="5,5"/>
|
|
34
|
+
<text x="350" y="350" text-anchor="middle" fill="#2196F3" font-size="12" font-weight="bold">Test Suite Components</text>
|
|
35
|
+
<text x="70" y="370" fill="#B0B0B0" font-size="10">• <tspan fill="#4CAF50" font-weight="bold">Green</tspan>: Root directory</text>
|
|
36
|
+
<text x="250" y="370" fill="#B0B0B0" font-size="10">• <tspan fill="#2196F3" font-weight="bold">Blue</tspan>: Test files</text>
|
|
37
|
+
<text x="450" y="370" fill="#B0B0B0" font-size="10">• <tspan fill="#9C27B0" font-weight="bold">Purple</tspan>: Subdirectories</text>
|
|
38
|
+
</svg>
|
|
@@ -4,165 +4,167 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Columns | Comment | Type |
|
|
6
6
|
| ---- | ------- | ------- | ---- |
|
|
7
|
+
| [public.file_sources](public.file_sources.md) | 9 | Source file metadata for loaded documents | BASE TABLE |
|
|
7
8
|
| [public.node_tags](public.node_tags.md) | 4 | Join table connecting nodes to tags (many-to-many) | BASE TABLE |
|
|
9
|
+
| [public.nodes](public.nodes.md) | 14 | Core memory storage for conversation messages and context | BASE TABLE |
|
|
10
|
+
| [public.robot_nodes](public.robot_nodes.md) | 9 | Join table connecting robots to nodes (many-to-many) | BASE TABLE |
|
|
11
|
+
| [public.robots](public.robots.md) | 4 | Registry of all LLM robots using the HTM system | BASE TABLE |
|
|
8
12
|
| [public.schema_migrations](public.schema_migrations.md) | 1 | | BASE TABLE |
|
|
9
|
-
| [public.robots](public.robots.md) | 5 | Registry of all LLM robots using the HTM system | BASE TABLE |
|
|
10
|
-
| [public.nodes](public.nodes.md) | 12 | Core memory storage for conversation messages and context | BASE TABLE |
|
|
11
13
|
| [public.tags](public.tags.md) | 3 | Unique tag names for categorization | BASE TABLE |
|
|
12
14
|
|
|
13
15
|
## Stored procedures and functions
|
|
14
16
|
|
|
15
17
|
| Name | ReturnType | Arguments | Type |
|
|
16
18
|
| ---- | ------- | ------- | ---- |
|
|
17
|
-
| public.
|
|
18
|
-
| public.
|
|
19
|
-
| public.
|
|
20
|
-
| public.
|
|
21
|
-
| public.
|
|
22
|
-
| public.
|
|
23
|
-
| public.
|
|
24
|
-
| public.
|
|
25
|
-
| public.l1_distance | float8 | vector, vector | FUNCTION |
|
|
26
|
-
| public.vector_dims | int4 | vector | FUNCTION |
|
|
27
|
-
| public.vector_norm | float8 | vector | FUNCTION |
|
|
28
|
-
| public.l2_normalize | vector | vector | FUNCTION |
|
|
29
|
-
| public.binary_quantize | bit | vector | FUNCTION |
|
|
30
|
-
| public.subvector | vector | vector, integer, integer | FUNCTION |
|
|
31
|
-
| public.vector_add | vector | vector, vector | FUNCTION |
|
|
32
|
-
| public.vector_sub | vector | vector, vector | FUNCTION |
|
|
33
|
-
| public.vector_mul | vector | vector, vector | FUNCTION |
|
|
34
|
-
| public.vector_concat | vector | vector, vector | FUNCTION |
|
|
35
|
-
| public.vector_lt | bool | vector, vector | FUNCTION |
|
|
36
|
-
| public.vector_le | bool | vector, vector | FUNCTION |
|
|
37
|
-
| public.vector_eq | bool | vector, vector | FUNCTION |
|
|
38
|
-
| public.vector_ne | bool | vector, vector | FUNCTION |
|
|
39
|
-
| public.vector_ge | bool | vector, vector | FUNCTION |
|
|
40
|
-
| public.vector_gt | bool | vector, vector | FUNCTION |
|
|
41
|
-
| public.vector_cmp | int4 | vector, vector | FUNCTION |
|
|
42
|
-
| public.vector_l2_squared_distance | float8 | vector, vector | FUNCTION |
|
|
43
|
-
| public.vector_negative_inner_product | float8 | vector, vector | FUNCTION |
|
|
44
|
-
| public.vector_spherical_distance | float8 | vector, vector | FUNCTION |
|
|
45
|
-
| public.vector_accum | _float8 | double precision[], vector | FUNCTION |
|
|
46
|
-
| public.vector_avg | vector | double precision[] | FUNCTION |
|
|
47
|
-
| public.vector_combine | _float8 | double precision[], double precision[] | FUNCTION |
|
|
48
|
-
| public.avg | vector | vector | a |
|
|
49
|
-
| public.sum | vector | vector | a |
|
|
50
|
-
| public.vector | vector | vector, integer, boolean | FUNCTION |
|
|
51
|
-
| public.array_to_vector | vector | integer[], integer, boolean | FUNCTION |
|
|
52
|
-
| public.array_to_vector | vector | real[], integer, boolean | FUNCTION |
|
|
19
|
+
| public.array_to_halfvec | halfvec | double precision[], integer, boolean | FUNCTION |
|
|
20
|
+
| public.array_to_halfvec | halfvec | integer[], integer, boolean | FUNCTION |
|
|
21
|
+
| public.array_to_halfvec | halfvec | numeric[], integer, boolean | FUNCTION |
|
|
22
|
+
| public.array_to_halfvec | halfvec | real[], integer, boolean | FUNCTION |
|
|
23
|
+
| public.array_to_sparsevec | sparsevec | double precision[], integer, boolean | FUNCTION |
|
|
24
|
+
| public.array_to_sparsevec | sparsevec | integer[], integer, boolean | FUNCTION |
|
|
25
|
+
| public.array_to_sparsevec | sparsevec | numeric[], integer, boolean | FUNCTION |
|
|
26
|
+
| public.array_to_sparsevec | sparsevec | real[], integer, boolean | FUNCTION |
|
|
53
27
|
| public.array_to_vector | vector | double precision[], integer, boolean | FUNCTION |
|
|
28
|
+
| public.array_to_vector | vector | integer[], integer, boolean | FUNCTION |
|
|
54
29
|
| public.array_to_vector | vector | numeric[], integer, boolean | FUNCTION |
|
|
55
|
-
| public.
|
|
56
|
-
| public.
|
|
57
|
-
| public.
|
|
58
|
-
| public.ivfflat_halfvec_support | internal | internal | FUNCTION |
|
|
59
|
-
| public.ivfflat_bit_support | internal | internal | FUNCTION |
|
|
60
|
-
| public.hnsw_halfvec_support | internal | internal | FUNCTION |
|
|
61
|
-
| public.hnsw_bit_support | internal | internal | FUNCTION |
|
|
62
|
-
| public.hnsw_sparsevec_support | internal | internal | FUNCTION |
|
|
63
|
-
| public.halfvec_in | halfvec | cstring, oid, integer | FUNCTION |
|
|
64
|
-
| public.halfvec_out | cstring | halfvec | FUNCTION |
|
|
65
|
-
| public.halfvec_typmod_in | int4 | cstring[] | FUNCTION |
|
|
66
|
-
| public.halfvec_recv | halfvec | internal, oid, integer | FUNCTION |
|
|
67
|
-
| public.halfvec_send | bytea | halfvec | FUNCTION |
|
|
68
|
-
| public.l2_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
69
|
-
| public.inner_product | float8 | halfvec, halfvec | FUNCTION |
|
|
70
|
-
| public.cosine_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
71
|
-
| public.l1_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
72
|
-
| public.vector_dims | int4 | halfvec | FUNCTION |
|
|
73
|
-
| public.l2_norm | float8 | halfvec | FUNCTION |
|
|
74
|
-
| public.l2_normalize | halfvec | halfvec | FUNCTION |
|
|
30
|
+
| public.array_to_vector | vector | real[], integer, boolean | FUNCTION |
|
|
31
|
+
| public.avg | halfvec | halfvec | a |
|
|
32
|
+
| public.avg | vector | vector | a |
|
|
75
33
|
| public.binary_quantize | bit | halfvec | FUNCTION |
|
|
76
|
-
| public.
|
|
34
|
+
| public.binary_quantize | bit | vector | FUNCTION |
|
|
35
|
+
| public.cosine_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
36
|
+
| public.cosine_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
37
|
+
| public.cosine_distance | float8 | vector, vector | FUNCTION |
|
|
38
|
+
| public.gin_extract_query_trgm | internal | text, internal, smallint, internal, internal, internal, internal | FUNCTION |
|
|
39
|
+
| public.gin_extract_value_trgm | internal | text, internal | FUNCTION |
|
|
40
|
+
| public.gin_trgm_consistent | bool | internal, smallint, text, integer, internal, internal, internal, internal | FUNCTION |
|
|
41
|
+
| public.gin_trgm_triconsistent | char | internal, smallint, text, integer, internal, internal, internal | FUNCTION |
|
|
42
|
+
| public.gtrgm_compress | internal | internal | FUNCTION |
|
|
43
|
+
| public.gtrgm_consistent | bool | internal, text, smallint, oid, internal | FUNCTION |
|
|
44
|
+
| public.gtrgm_decompress | internal | internal | FUNCTION |
|
|
45
|
+
| public.gtrgm_distance | float8 | internal, text, smallint, oid, internal | FUNCTION |
|
|
46
|
+
| public.gtrgm_in | gtrgm | cstring | FUNCTION |
|
|
47
|
+
| public.gtrgm_options | void | internal | FUNCTION |
|
|
48
|
+
| public.gtrgm_out | cstring | gtrgm | FUNCTION |
|
|
49
|
+
| public.gtrgm_penalty | internal | internal, internal, internal | FUNCTION |
|
|
50
|
+
| public.gtrgm_picksplit | internal | internal, internal | FUNCTION |
|
|
51
|
+
| public.gtrgm_same | internal | gtrgm, gtrgm, internal | FUNCTION |
|
|
52
|
+
| public.gtrgm_union | gtrgm | internal, internal | FUNCTION |
|
|
53
|
+
| public.halfvec | halfvec | halfvec, integer, boolean | FUNCTION |
|
|
54
|
+
| public.halfvec_accum | _float8 | double precision[], halfvec | FUNCTION |
|
|
77
55
|
| public.halfvec_add | halfvec | halfvec, halfvec | FUNCTION |
|
|
78
|
-
| public.
|
|
79
|
-
| public.
|
|
56
|
+
| public.halfvec_avg | halfvec | double precision[] | FUNCTION |
|
|
57
|
+
| public.halfvec_cmp | int4 | halfvec, halfvec | FUNCTION |
|
|
58
|
+
| public.halfvec_combine | _float8 | double precision[], double precision[] | FUNCTION |
|
|
80
59
|
| public.halfvec_concat | halfvec | halfvec, halfvec | FUNCTION |
|
|
81
|
-
| public.halfvec_lt | bool | halfvec, halfvec | FUNCTION |
|
|
82
|
-
| public.halfvec_le | bool | halfvec, halfvec | FUNCTION |
|
|
83
60
|
| public.halfvec_eq | bool | halfvec, halfvec | FUNCTION |
|
|
84
|
-
| public.halfvec_ne | bool | halfvec, halfvec | FUNCTION |
|
|
85
61
|
| public.halfvec_ge | bool | halfvec, halfvec | FUNCTION |
|
|
86
62
|
| public.halfvec_gt | bool | halfvec, halfvec | FUNCTION |
|
|
87
|
-
| public.
|
|
63
|
+
| public.halfvec_in | halfvec | cstring, oid, integer | FUNCTION |
|
|
88
64
|
| public.halfvec_l2_squared_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
65
|
+
| public.halfvec_le | bool | halfvec, halfvec | FUNCTION |
|
|
66
|
+
| public.halfvec_lt | bool | halfvec, halfvec | FUNCTION |
|
|
67
|
+
| public.halfvec_mul | halfvec | halfvec, halfvec | FUNCTION |
|
|
68
|
+
| public.halfvec_ne | bool | halfvec, halfvec | FUNCTION |
|
|
89
69
|
| public.halfvec_negative_inner_product | float8 | halfvec, halfvec | FUNCTION |
|
|
70
|
+
| public.halfvec_out | cstring | halfvec | FUNCTION |
|
|
71
|
+
| public.halfvec_recv | halfvec | internal, oid, integer | FUNCTION |
|
|
72
|
+
| public.halfvec_send | bytea | halfvec | FUNCTION |
|
|
90
73
|
| public.halfvec_spherical_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
91
|
-
| public.
|
|
92
|
-
| public.halfvec_avg | halfvec | double precision[] | FUNCTION |
|
|
93
|
-
| public.halfvec_combine | _float8 | double precision[], double precision[] | FUNCTION |
|
|
94
|
-
| public.avg | halfvec | halfvec | a |
|
|
95
|
-
| public.sum | halfvec | halfvec | a |
|
|
96
|
-
| public.halfvec | halfvec | halfvec, integer, boolean | FUNCTION |
|
|
97
|
-
| public.halfvec_to_vector | vector | halfvec, integer, boolean | FUNCTION |
|
|
98
|
-
| public.vector_to_halfvec | halfvec | vector, integer, boolean | FUNCTION |
|
|
99
|
-
| public.array_to_halfvec | halfvec | integer[], integer, boolean | FUNCTION |
|
|
100
|
-
| public.array_to_halfvec | halfvec | real[], integer, boolean | FUNCTION |
|
|
101
|
-
| public.array_to_halfvec | halfvec | double precision[], integer, boolean | FUNCTION |
|
|
102
|
-
| public.array_to_halfvec | halfvec | numeric[], integer, boolean | FUNCTION |
|
|
74
|
+
| public.halfvec_sub | halfvec | halfvec, halfvec | FUNCTION |
|
|
103
75
|
| public.halfvec_to_float4 | _float4 | halfvec, integer, boolean | FUNCTION |
|
|
76
|
+
| public.halfvec_to_sparsevec | sparsevec | halfvec, integer, boolean | FUNCTION |
|
|
77
|
+
| public.halfvec_to_vector | vector | halfvec, integer, boolean | FUNCTION |
|
|
78
|
+
| public.halfvec_typmod_in | int4 | cstring[] | FUNCTION |
|
|
104
79
|
| public.hamming_distance | float8 | bit, bit | FUNCTION |
|
|
105
|
-
| public.
|
|
106
|
-
| public.
|
|
107
|
-
| public.
|
|
108
|
-
| public.
|
|
109
|
-
| public.
|
|
110
|
-
| public.sparsevec_send | bytea | sparsevec | FUNCTION |
|
|
111
|
-
| public.l2_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
80
|
+
| public.hnsw_bit_support | internal | internal | FUNCTION |
|
|
81
|
+
| public.hnsw_halfvec_support | internal | internal | FUNCTION |
|
|
82
|
+
| public.hnsw_sparsevec_support | internal | internal | FUNCTION |
|
|
83
|
+
| public.hnswhandler | index_am_handler | internal | FUNCTION |
|
|
84
|
+
| public.inner_product | float8 | halfvec, halfvec | FUNCTION |
|
|
112
85
|
| public.inner_product | float8 | sparsevec, sparsevec | FUNCTION |
|
|
113
|
-
| public.
|
|
86
|
+
| public.inner_product | float8 | vector, vector | FUNCTION |
|
|
87
|
+
| public.ivfflat_bit_support | internal | internal | FUNCTION |
|
|
88
|
+
| public.ivfflat_halfvec_support | internal | internal | FUNCTION |
|
|
89
|
+
| public.ivfflathandler | index_am_handler | internal | FUNCTION |
|
|
90
|
+
| public.jaccard_distance | float8 | bit, bit | FUNCTION |
|
|
91
|
+
| public.l1_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
114
92
|
| public.l1_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
93
|
+
| public.l1_distance | float8 | vector, vector | FUNCTION |
|
|
94
|
+
| public.l2_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
95
|
+
| public.l2_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
96
|
+
| public.l2_distance | float8 | vector, vector | FUNCTION |
|
|
97
|
+
| public.l2_norm | float8 | halfvec | FUNCTION |
|
|
115
98
|
| public.l2_norm | float8 | sparsevec | FUNCTION |
|
|
99
|
+
| public.l2_normalize | halfvec | halfvec | FUNCTION |
|
|
116
100
|
| public.l2_normalize | sparsevec | sparsevec | FUNCTION |
|
|
117
|
-
| public.
|
|
118
|
-
| public.
|
|
101
|
+
| public.l2_normalize | vector | vector | FUNCTION |
|
|
102
|
+
| public.set_limit | float4 | real | FUNCTION |
|
|
103
|
+
| public.show_limit | float4 | | FUNCTION |
|
|
104
|
+
| public.show_trgm | _text | text | FUNCTION |
|
|
105
|
+
| public.similarity | float4 | text, text | FUNCTION |
|
|
106
|
+
| public.similarity_dist | float4 | text, text | FUNCTION |
|
|
107
|
+
| public.similarity_op | bool | text, text | FUNCTION |
|
|
108
|
+
| public.sparsevec | sparsevec | sparsevec, integer, boolean | FUNCTION |
|
|
109
|
+
| public.sparsevec_cmp | int4 | sparsevec, sparsevec | FUNCTION |
|
|
119
110
|
| public.sparsevec_eq | bool | sparsevec, sparsevec | FUNCTION |
|
|
120
|
-
| public.sparsevec_ne | bool | sparsevec, sparsevec | FUNCTION |
|
|
121
111
|
| public.sparsevec_ge | bool | sparsevec, sparsevec | FUNCTION |
|
|
122
112
|
| public.sparsevec_gt | bool | sparsevec, sparsevec | FUNCTION |
|
|
123
|
-
| public.
|
|
113
|
+
| public.sparsevec_in | sparsevec | cstring, oid, integer | FUNCTION |
|
|
124
114
|
| public.sparsevec_l2_squared_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
115
|
+
| public.sparsevec_le | bool | sparsevec, sparsevec | FUNCTION |
|
|
116
|
+
| public.sparsevec_lt | bool | sparsevec, sparsevec | FUNCTION |
|
|
117
|
+
| public.sparsevec_ne | bool | sparsevec, sparsevec | FUNCTION |
|
|
125
118
|
| public.sparsevec_negative_inner_product | float8 | sparsevec, sparsevec | FUNCTION |
|
|
126
|
-
| public.
|
|
127
|
-
| public.
|
|
128
|
-
| public.
|
|
129
|
-
| public.halfvec_to_sparsevec | sparsevec | halfvec, integer, boolean | FUNCTION |
|
|
119
|
+
| public.sparsevec_out | cstring | sparsevec | FUNCTION |
|
|
120
|
+
| public.sparsevec_recv | sparsevec | internal, oid, integer | FUNCTION |
|
|
121
|
+
| public.sparsevec_send | bytea | sparsevec | FUNCTION |
|
|
130
122
|
| public.sparsevec_to_halfvec | halfvec | sparsevec, integer, boolean | FUNCTION |
|
|
131
|
-
| public.
|
|
132
|
-
| public.
|
|
133
|
-
| public.array_to_sparsevec | sparsevec | double precision[], integer, boolean | FUNCTION |
|
|
134
|
-
| public.array_to_sparsevec | sparsevec | numeric[], integer, boolean | FUNCTION |
|
|
135
|
-
| public.set_limit | float4 | real | FUNCTION |
|
|
136
|
-
| public.show_limit | float4 | | FUNCTION |
|
|
137
|
-
| public.show_trgm | _text | text | FUNCTION |
|
|
138
|
-
| public.similarity | float4 | text, text | FUNCTION |
|
|
139
|
-
| public.similarity_op | bool | text, text | FUNCTION |
|
|
140
|
-
| public.word_similarity | float4 | text, text | FUNCTION |
|
|
141
|
-
| public.word_similarity_op | bool | text, text | FUNCTION |
|
|
142
|
-
| public.word_similarity_commutator_op | bool | text, text | FUNCTION |
|
|
143
|
-
| public.similarity_dist | float4 | text, text | FUNCTION |
|
|
144
|
-
| public.word_similarity_dist_op | float4 | text, text | FUNCTION |
|
|
145
|
-
| public.word_similarity_dist_commutator_op | float4 | text, text | FUNCTION |
|
|
146
|
-
| public.gtrgm_in | gtrgm | cstring | FUNCTION |
|
|
147
|
-
| public.gtrgm_out | cstring | gtrgm | FUNCTION |
|
|
148
|
-
| public.gtrgm_consistent | bool | internal, text, smallint, oid, internal | FUNCTION |
|
|
149
|
-
| public.gtrgm_distance | float8 | internal, text, smallint, oid, internal | FUNCTION |
|
|
150
|
-
| public.gtrgm_compress | internal | internal | FUNCTION |
|
|
151
|
-
| public.gtrgm_decompress | internal | internal | FUNCTION |
|
|
152
|
-
| public.gtrgm_penalty | internal | internal, internal, internal | FUNCTION |
|
|
153
|
-
| public.gtrgm_picksplit | internal | internal, internal | FUNCTION |
|
|
154
|
-
| public.gtrgm_union | gtrgm | internal, internal | FUNCTION |
|
|
155
|
-
| public.gtrgm_same | internal | gtrgm, gtrgm, internal | FUNCTION |
|
|
156
|
-
| public.gin_extract_value_trgm | internal | text, internal | FUNCTION |
|
|
157
|
-
| public.gin_extract_query_trgm | internal | text, internal, smallint, internal, internal, internal, internal | FUNCTION |
|
|
158
|
-
| public.gin_trgm_consistent | bool | internal, smallint, text, integer, internal, internal, internal, internal | FUNCTION |
|
|
159
|
-
| public.gin_trgm_triconsistent | char | internal, smallint, text, integer, internal, internal, internal | FUNCTION |
|
|
123
|
+
| public.sparsevec_to_vector | vector | sparsevec, integer, boolean | FUNCTION |
|
|
124
|
+
| public.sparsevec_typmod_in | int4 | cstring[] | FUNCTION |
|
|
160
125
|
| public.strict_word_similarity | float4 | text, text | FUNCTION |
|
|
161
|
-
| public.strict_word_similarity_op | bool | text, text | FUNCTION |
|
|
162
126
|
| public.strict_word_similarity_commutator_op | bool | text, text | FUNCTION |
|
|
163
|
-
| public.strict_word_similarity_dist_op | float4 | text, text | FUNCTION |
|
|
164
127
|
| public.strict_word_similarity_dist_commutator_op | float4 | text, text | FUNCTION |
|
|
165
|
-
| public.
|
|
128
|
+
| public.strict_word_similarity_dist_op | float4 | text, text | FUNCTION |
|
|
129
|
+
| public.strict_word_similarity_op | bool | text, text | FUNCTION |
|
|
130
|
+
| public.subvector | halfvec | halfvec, integer, integer | FUNCTION |
|
|
131
|
+
| public.subvector | vector | vector, integer, integer | FUNCTION |
|
|
132
|
+
| public.sum | halfvec | halfvec | a |
|
|
133
|
+
| public.sum | vector | vector | a |
|
|
134
|
+
| public.vector | vector | vector, integer, boolean | FUNCTION |
|
|
135
|
+
| public.vector_accum | _float8 | double precision[], vector | FUNCTION |
|
|
136
|
+
| public.vector_add | vector | vector, vector | FUNCTION |
|
|
137
|
+
| public.vector_avg | vector | double precision[] | FUNCTION |
|
|
138
|
+
| public.vector_cmp | int4 | vector, vector | FUNCTION |
|
|
139
|
+
| public.vector_combine | _float8 | double precision[], double precision[] | FUNCTION |
|
|
140
|
+
| public.vector_concat | vector | vector, vector | FUNCTION |
|
|
141
|
+
| public.vector_dims | int4 | halfvec | FUNCTION |
|
|
142
|
+
| public.vector_dims | int4 | vector | FUNCTION |
|
|
143
|
+
| public.vector_eq | bool | vector, vector | FUNCTION |
|
|
144
|
+
| public.vector_ge | bool | vector, vector | FUNCTION |
|
|
145
|
+
| public.vector_gt | bool | vector, vector | FUNCTION |
|
|
146
|
+
| public.vector_in | vector | cstring, oid, integer | FUNCTION |
|
|
147
|
+
| public.vector_l2_squared_distance | float8 | vector, vector | FUNCTION |
|
|
148
|
+
| public.vector_le | bool | vector, vector | FUNCTION |
|
|
149
|
+
| public.vector_lt | bool | vector, vector | FUNCTION |
|
|
150
|
+
| public.vector_mul | vector | vector, vector | FUNCTION |
|
|
151
|
+
| public.vector_ne | bool | vector, vector | FUNCTION |
|
|
152
|
+
| public.vector_negative_inner_product | float8 | vector, vector | FUNCTION |
|
|
153
|
+
| public.vector_norm | float8 | vector | FUNCTION |
|
|
154
|
+
| public.vector_out | cstring | vector | FUNCTION |
|
|
155
|
+
| public.vector_recv | vector | internal, oid, integer | FUNCTION |
|
|
156
|
+
| public.vector_send | bytea | vector | FUNCTION |
|
|
157
|
+
| public.vector_spherical_distance | float8 | vector, vector | FUNCTION |
|
|
158
|
+
| public.vector_sub | vector | vector, vector | FUNCTION |
|
|
159
|
+
| public.vector_to_float4 | _float4 | vector, integer, boolean | FUNCTION |
|
|
160
|
+
| public.vector_to_halfvec | halfvec | vector, integer, boolean | FUNCTION |
|
|
161
|
+
| public.vector_to_sparsevec | sparsevec | vector, integer, boolean | FUNCTION |
|
|
162
|
+
| public.vector_typmod_in | int4 | cstring[] | FUNCTION |
|
|
163
|
+
| public.word_similarity | float4 | text, text | FUNCTION |
|
|
164
|
+
| public.word_similarity_commutator_op | bool | text, text | FUNCTION |
|
|
165
|
+
| public.word_similarity_dist_commutator_op | float4 | text, text | FUNCTION |
|
|
166
|
+
| public.word_similarity_dist_op | float4 | text, text | FUNCTION |
|
|
167
|
+
| public.word_similarity_op | bool | text, text | FUNCTION |
|
|
166
168
|
|
|
167
169
|
## Relations
|
|
168
170
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# public.file_sources
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Source file metadata for loaded documents
|
|
6
|
+
|
|
7
|
+
## Columns
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
11
|
+
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
|
|
12
|
+
| file_hash | varchar(64) | | true | | | SHA-256 hash of file content |
|
|
13
|
+
| file_path | text | | false | | | Absolute path to source file |
|
|
14
|
+
| file_size | integer | | true | | | File size in bytes |
|
|
15
|
+
| frontmatter | jsonb | '{}'::jsonb | true | | | Parsed YAML frontmatter |
|
|
16
|
+
| id | bigint | nextval('file_sources_id_seq'::regclass) | false | [public.nodes](public.nodes.md) | | |
|
|
17
|
+
| last_synced_at | timestamp with time zone | | true | | | When file was last synced to HTM |
|
|
18
|
+
| mtime | timestamp with time zone | | true | | | File modification time |
|
|
19
|
+
| updated_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
|
|
20
|
+
|
|
21
|
+
## Constraints
|
|
22
|
+
|
|
23
|
+
| Name | Type | Definition |
|
|
24
|
+
| ---- | ---- | ---------- |
|
|
25
|
+
| file_sources_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
26
|
+
|
|
27
|
+
## Indexes
|
|
28
|
+
|
|
29
|
+
| Name | Definition |
|
|
30
|
+
| ---- | ---------- |
|
|
31
|
+
| file_sources_pkey | CREATE UNIQUE INDEX file_sources_pkey ON public.file_sources USING btree (id) |
|
|
32
|
+
| idx_file_sources_hash | CREATE INDEX idx_file_sources_hash ON public.file_sources USING btree (file_hash) |
|
|
33
|
+
| idx_file_sources_last_synced | CREATE INDEX idx_file_sources_last_synced ON public.file_sources USING btree (last_synced_at) |
|
|
34
|
+
| idx_file_sources_path_unique | CREATE UNIQUE INDEX idx_file_sources_path_unique ON public.file_sources USING btree (file_path) |
|
|
35
|
+
|
|
36
|
+
## Relations
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|