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.
- checksums.yaml +7 -0
- data/.architecture/decisions/adrs/001-use-postgresql-timescaledb-storage.md +227 -0
- data/.architecture/decisions/adrs/002-two-tier-memory-architecture.md +322 -0
- data/.architecture/decisions/adrs/003-ollama-default-embedding-provider.md +339 -0
- data/.architecture/decisions/adrs/004-multi-robot-shared-memory-hive-mind.md +374 -0
- data/.architecture/decisions/adrs/005-rag-based-retrieval-with-hybrid-search.md +443 -0
- data/.architecture/decisions/adrs/006-context-assembly-strategies.md +444 -0
- data/.architecture/decisions/adrs/007-working-memory-eviction-strategy.md +461 -0
- data/.architecture/decisions/adrs/008-robot-identification-system.md +550 -0
- data/.architecture/decisions/adrs/009-never-forget-explicit-deletion-only.md +570 -0
- data/.architecture/decisions/adrs/010-redis-working-memory-rejected.md +323 -0
- data/.architecture/decisions/adrs/011-database-side-embedding-generation-with-pgai.md +585 -0
- data/.architecture/decisions/adrs/012-llm-driven-ontology-topic-extraction.md +583 -0
- data/.architecture/decisions/adrs/013-activerecord-orm-and-many-to-many-tagging.md +299 -0
- data/.architecture/decisions/adrs/014-client-side-embedding-generation-workflow.md +569 -0
- data/.architecture/decisions/adrs/015-hierarchical-tag-ontology-and-llm-extraction.md +701 -0
- data/.architecture/decisions/adrs/016-async-embedding-and-tag-generation.md +694 -0
- data/.architecture/members.yml +144 -0
- data/.architecture/reviews/2025-10-29-llm-configuration-and-async-processing-review.md +1137 -0
- data/.architecture/reviews/initial-system-analysis.md +330 -0
- data/.envrc +32 -0
- data/.irbrc +145 -0
- data/CHANGELOG.md +150 -0
- data/COMMITS.md +196 -0
- data/LICENSE +21 -0
- data/README.md +1347 -0
- data/Rakefile +51 -0
- data/SETUP.md +268 -0
- data/config/database.yml +67 -0
- data/db/migrate/20250101000001_enable_extensions.rb +14 -0
- data/db/migrate/20250101000002_create_robots.rb +14 -0
- data/db/migrate/20250101000003_create_nodes.rb +42 -0
- data/db/migrate/20250101000005_create_tags.rb +38 -0
- data/db/migrate/20250101000007_add_node_vector_indexes.rb +30 -0
- data/db/schema.sql +473 -0
- data/db/seed_data/README.md +100 -0
- data/db/seed_data/presidents.md +136 -0
- data/db/seed_data/states.md +151 -0
- data/db/seeds.rb +208 -0
- data/dbdoc/README.md +173 -0
- data/dbdoc/public.node_stats.md +48 -0
- data/dbdoc/public.node_stats.svg +41 -0
- data/dbdoc/public.node_tags.md +40 -0
- data/dbdoc/public.node_tags.svg +112 -0
- data/dbdoc/public.nodes.md +54 -0
- data/dbdoc/public.nodes.svg +118 -0
- data/dbdoc/public.nodes_tags.md +39 -0
- data/dbdoc/public.nodes_tags.svg +112 -0
- data/dbdoc/public.ontology_structure.md +48 -0
- data/dbdoc/public.ontology_structure.svg +38 -0
- data/dbdoc/public.operations_log.md +42 -0
- data/dbdoc/public.operations_log.svg +130 -0
- data/dbdoc/public.relationships.md +39 -0
- data/dbdoc/public.relationships.svg +41 -0
- data/dbdoc/public.robot_activity.md +46 -0
- data/dbdoc/public.robot_activity.svg +35 -0
- data/dbdoc/public.robots.md +35 -0
- data/dbdoc/public.robots.svg +90 -0
- data/dbdoc/public.schema_migrations.md +29 -0
- data/dbdoc/public.schema_migrations.svg +26 -0
- data/dbdoc/public.tags.md +35 -0
- data/dbdoc/public.tags.svg +60 -0
- data/dbdoc/public.topic_relationships.md +45 -0
- data/dbdoc/public.topic_relationships.svg +32 -0
- data/dbdoc/schema.json +1437 -0
- data/dbdoc/schema.svg +154 -0
- data/docs/api/database.md +806 -0
- data/docs/api/embedding-service.md +532 -0
- data/docs/api/htm.md +797 -0
- data/docs/api/index.md +259 -0
- data/docs/api/long-term-memory.md +1096 -0
- data/docs/api/working-memory.md +665 -0
- data/docs/architecture/adrs/001-postgresql-timescaledb.md +314 -0
- data/docs/architecture/adrs/002-two-tier-memory.md +411 -0
- data/docs/architecture/adrs/003-ollama-embeddings.md +421 -0
- data/docs/architecture/adrs/004-hive-mind.md +437 -0
- data/docs/architecture/adrs/005-rag-retrieval.md +531 -0
- data/docs/architecture/adrs/006-context-assembly.md +496 -0
- data/docs/architecture/adrs/007-eviction-strategy.md +645 -0
- data/docs/architecture/adrs/008-robot-identification.md +625 -0
- data/docs/architecture/adrs/009-never-forget.md +648 -0
- data/docs/architecture/adrs/010-redis-working-memory-rejected.md +323 -0
- data/docs/architecture/adrs/011-pgai-integration.md +494 -0
- data/docs/architecture/adrs/index.md +215 -0
- data/docs/architecture/hive-mind.md +736 -0
- data/docs/architecture/index.md +351 -0
- data/docs/architecture/overview.md +538 -0
- data/docs/architecture/two-tier-memory.md +873 -0
- data/docs/assets/css/custom.css +83 -0
- data/docs/assets/images/htm-core-components.svg +63 -0
- data/docs/assets/images/htm-database-schema.svg +93 -0
- data/docs/assets/images/htm-hive-mind-architecture.svg +125 -0
- data/docs/assets/images/htm-importance-scoring-framework.svg +83 -0
- data/docs/assets/images/htm-layered-architecture.svg +71 -0
- data/docs/assets/images/htm-long-term-memory-architecture.svg +115 -0
- data/docs/assets/images/htm-working-memory-architecture.svg +120 -0
- data/docs/assets/images/htm.jpg +0 -0
- data/docs/assets/images/htm_demo.gif +0 -0
- data/docs/assets/js/mathjax.js +18 -0
- data/docs/assets/videos/htm_video.mp4 +0 -0
- data/docs/database_rake_tasks.md +322 -0
- data/docs/development/contributing.md +787 -0
- data/docs/development/index.md +336 -0
- data/docs/development/schema.md +596 -0
- data/docs/development/setup.md +719 -0
- data/docs/development/testing.md +819 -0
- data/docs/guides/adding-memories.md +824 -0
- data/docs/guides/context-assembly.md +1009 -0
- data/docs/guides/getting-started.md +577 -0
- data/docs/guides/index.md +118 -0
- data/docs/guides/long-term-memory.md +941 -0
- data/docs/guides/multi-robot.md +866 -0
- data/docs/guides/recalling-memories.md +927 -0
- data/docs/guides/search-strategies.md +953 -0
- data/docs/guides/working-memory.md +717 -0
- data/docs/index.md +214 -0
- data/docs/installation.md +477 -0
- data/docs/multi_framework_support.md +519 -0
- data/docs/quick-start.md +655 -0
- data/docs/setup_local_database.md +302 -0
- data/docs/using_rake_tasks_in_your_app.md +383 -0
- data/examples/basic_usage.rb +93 -0
- data/examples/cli_app/README.md +317 -0
- data/examples/cli_app/htm_cli.rb +270 -0
- data/examples/custom_llm_configuration.rb +183 -0
- data/examples/example_app/Rakefile +71 -0
- data/examples/example_app/app.rb +206 -0
- data/examples/sinatra_app/Gemfile +21 -0
- data/examples/sinatra_app/app.rb +335 -0
- data/lib/htm/active_record_config.rb +113 -0
- data/lib/htm/configuration.rb +342 -0
- data/lib/htm/database.rb +594 -0
- data/lib/htm/embedding_service.rb +115 -0
- data/lib/htm/errors.rb +34 -0
- data/lib/htm/job_adapter.rb +154 -0
- data/lib/htm/jobs/generate_embedding_job.rb +65 -0
- data/lib/htm/jobs/generate_tags_job.rb +82 -0
- data/lib/htm/long_term_memory.rb +965 -0
- data/lib/htm/models/node.rb +109 -0
- data/lib/htm/models/node_tag.rb +33 -0
- data/lib/htm/models/robot.rb +52 -0
- data/lib/htm/models/tag.rb +76 -0
- data/lib/htm/railtie.rb +76 -0
- data/lib/htm/sinatra.rb +157 -0
- data/lib/htm/tag_service.rb +135 -0
- data/lib/htm/tasks.rb +38 -0
- data/lib/htm/version.rb +5 -0
- data/lib/htm/working_memory.rb +182 -0
- data/lib/htm.rb +400 -0
- data/lib/tasks/db.rake +19 -0
- data/lib/tasks/htm.rake +147 -0
- data/lib/tasks/jobs.rake +312 -0
- data/mkdocs.yml +190 -0
- data/scripts/install_local_database.sh +309 -0
- metadata +341 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# public.robots
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Registry of all LLM robots using the HTM system
|
|
6
|
+
|
|
7
|
+
## Columns
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
11
|
+
| id | bigint | nextval('robots_id_seq'::regclass) | false | [public.nodes](public.nodes.md) | | |
|
|
12
|
+
| name | text | | true | | | Human-readable name for the robot |
|
|
13
|
+
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When the robot was first registered |
|
|
14
|
+
| last_active | timestamp with time zone | CURRENT_TIMESTAMP | true | | | Last time the robot accessed the system |
|
|
15
|
+
| metadata | jsonb | | true | | | Robot-specific configuration and metadata |
|
|
16
|
+
|
|
17
|
+
## Constraints
|
|
18
|
+
|
|
19
|
+
| Name | Type | Definition |
|
|
20
|
+
| ---- | ---- | ---------- |
|
|
21
|
+
| robots_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
22
|
+
|
|
23
|
+
## Indexes
|
|
24
|
+
|
|
25
|
+
| Name | Definition |
|
|
26
|
+
| ---- | ---------- |
|
|
27
|
+
| robots_pkey | CREATE UNIQUE INDEX robots_pkey ON public.robots USING btree (id) |
|
|
28
|
+
|
|
29
|
+
## Relations
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: public.robots Pages: 1 -->
|
|
7
|
+
<svg width="679pt" height="818pt"
|
|
8
|
+
viewBox="0.00 0.00 679.17 817.60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 813.6)">
|
|
10
|
+
<title>public.robots</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-813.6 675.17,-813.6 675.17,4 -4,4"/>
|
|
12
|
+
<!-- public.robots -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.robots</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="54.48,-200.2 54.48,-235.8 304.25,-235.8 304.25,-200.2 54.48,-200.2"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="54.48,-200.2 54.48,-235.8 304.25,-235.8 304.25,-200.2 54.48,-200.2"/>
|
|
17
|
+
<text text-anchor="start" x="69.87" y="-213.6" font-family="Arial Bold" font-size="18.00">public.robots</text>
|
|
18
|
+
<text text-anchor="start" x="164.37" y="-213.6" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="195.48" y="-213.6" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="54.48,-169.4 54.48,-200.2 304.25,-200.2 304.25,-169.4 54.48,-169.4"/>
|
|
21
|
+
<text text-anchor="start" x="61.48" y="-181.6" font-family="Arial" font-size="14.00">id </text>
|
|
22
|
+
<text text-anchor="start" x="76.27" y="-181.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" points="54.48,-138.6 54.48,-169.4 304.25,-169.4 304.25,-138.6 54.48,-138.6"/>
|
|
24
|
+
<text text-anchor="start" x="61.48" y="-150.8" font-family="Arial" font-size="14.00">name </text>
|
|
25
|
+
<text text-anchor="start" x="100.39" y="-150.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
26
|
+
<polygon fill="none" stroke="black" points="54.48,-107.8 54.48,-138.6 304.25,-138.6 304.25,-107.8 54.48,-107.8"/>
|
|
27
|
+
<text text-anchor="start" x="61.48" y="-120" font-family="Arial" font-size="14.00">created_at </text>
|
|
28
|
+
<text text-anchor="start" x="131.53" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
29
|
+
<polygon fill="none" stroke="black" points="54.48,-77 54.48,-107.8 304.25,-107.8 304.25,-77 54.48,-77"/>
|
|
30
|
+
<text text-anchor="start" x="61.48" y="-89.2" font-family="Arial" font-size="14.00">last_active </text>
|
|
31
|
+
<text text-anchor="start" x="131.51" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
32
|
+
<polygon fill="none" stroke="black" points="54.48,-46.2 54.48,-77 304.25,-77 304.25,-46.2 54.48,-46.2"/>
|
|
33
|
+
<text text-anchor="start" x="61.48" y="-58.4" font-family="Arial" font-size="14.00">metadata </text>
|
|
34
|
+
<text text-anchor="start" x="123.74" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
|
|
35
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="52.98,-44.7 52.98,-237.3 305.75,-237.3 305.75,-44.7 52.98,-44.7"/>
|
|
36
|
+
</g>
|
|
37
|
+
<!-- public.nodes -->
|
|
38
|
+
<g id="node2" class="node">
|
|
39
|
+
<title>public.nodes</title>
|
|
40
|
+
<polygon fill="#efefef" stroke="none" points="43.2,-730.8 43.2,-766.4 315.53,-766.4 315.53,-730.8 43.2,-730.8"/>
|
|
41
|
+
<polygon fill="none" stroke="black" points="43.2,-730.8 43.2,-766.4 315.53,-766.4 315.53,-730.8 43.2,-730.8"/>
|
|
42
|
+
<text text-anchor="start" x="71.38" y="-744.2" font-family="Arial Bold" font-size="18.00">public.nodes</text>
|
|
43
|
+
<text text-anchor="start" x="162.86" y="-744.2" font-family="Arial" font-size="14.00"> </text>
|
|
44
|
+
<text text-anchor="start" x="193.98" y="-744.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
45
|
+
<polygon fill="none" stroke="black" points="43.2,-700 43.2,-730.8 315.53,-730.8 315.53,-700 43.2,-700"/>
|
|
46
|
+
<text text-anchor="start" x="50.2" y="-712.2" font-family="Arial" font-size="14.00">id </text>
|
|
47
|
+
<text text-anchor="start" x="64.99" y="-712.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
48
|
+
<polygon fill="none" stroke="black" points="43.2,-669.2 43.2,-700 315.53,-700 315.53,-669.2 43.2,-669.2"/>
|
|
49
|
+
<text text-anchor="start" x="50.2" y="-681.4" font-family="Arial" font-size="14.00">content </text>
|
|
50
|
+
<text text-anchor="start" x="100.01" y="-681.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
51
|
+
<polygon fill="none" stroke="black" points="43.2,-638.4 43.2,-669.2 315.53,-669.2 315.53,-638.4 43.2,-638.4"/>
|
|
52
|
+
<text text-anchor="start" x="50.2" y="-650.6" font-family="Arial" font-size="14.00">source </text>
|
|
53
|
+
<text text-anchor="start" x="96.11" y="-650.6" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
54
|
+
<polygon fill="none" stroke="black" points="43.2,-607.6 43.2,-638.4 315.53,-638.4 315.53,-607.6 43.2,-607.6"/>
|
|
55
|
+
<text text-anchor="start" x="50.2" y="-619.8" font-family="Arial" font-size="14.00">access_count </text>
|
|
56
|
+
<text text-anchor="start" x="139.7" y="-619.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
57
|
+
<polygon fill="none" stroke="black" points="43.2,-576.8 43.2,-607.6 315.53,-607.6 315.53,-576.8 43.2,-576.8"/>
|
|
58
|
+
<text text-anchor="start" x="50.2" y="-589" font-family="Arial" font-size="14.00">created_at </text>
|
|
59
|
+
<text text-anchor="start" x="120.25" y="-589" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
60
|
+
<polygon fill="none" stroke="black" points="43.2,-546 43.2,-576.8 315.53,-576.8 315.53,-546 43.2,-546"/>
|
|
61
|
+
<text text-anchor="start" x="50.2" y="-558.2" font-family="Arial" font-size="14.00">updated_at </text>
|
|
62
|
+
<text text-anchor="start" x="124.16" y="-558.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
63
|
+
<polygon fill="none" stroke="black" points="43.2,-515.2 43.2,-546 315.53,-546 315.53,-515.2 43.2,-515.2"/>
|
|
64
|
+
<text text-anchor="start" x="50.2" y="-527.4" font-family="Arial" font-size="14.00">last_accessed </text>
|
|
65
|
+
<text text-anchor="start" x="142.81" y="-527.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
66
|
+
<polygon fill="none" stroke="black" points="43.2,-484.4 43.2,-515.2 315.53,-515.2 315.53,-484.4 43.2,-484.4"/>
|
|
67
|
+
<text text-anchor="start" x="50.2" y="-496.6" font-family="Arial" font-size="14.00">token_count </text>
|
|
68
|
+
<text text-anchor="start" x="130.37" y="-496.6" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
69
|
+
<polygon fill="none" stroke="black" points="43.2,-453.6 43.2,-484.4 315.53,-484.4 315.53,-453.6 43.2,-453.6"/>
|
|
70
|
+
<text text-anchor="start" x="50.2" y="-465.8" font-family="Arial" font-size="14.00">in_working_memory </text>
|
|
71
|
+
<text text-anchor="start" x="179.36" y="-465.8" font-family="Arial" font-size="14.00" fill="#666666">[boolean]</text>
|
|
72
|
+
<polygon fill="none" stroke="black" points="43.2,-422.8 43.2,-453.6 315.53,-453.6 315.53,-422.8 43.2,-422.8"/>
|
|
73
|
+
<text text-anchor="start" x="50.2" y="-435" font-family="Arial" font-size="14.00">robot_id </text>
|
|
74
|
+
<text text-anchor="start" x="104.68" y="-435" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
75
|
+
<polygon fill="none" stroke="black" points="43.2,-392 43.2,-422.8 315.53,-422.8 315.53,-392 43.2,-392"/>
|
|
76
|
+
<text text-anchor="start" x="50.2" y="-404.2" font-family="Arial" font-size="14.00">embedding </text>
|
|
77
|
+
<text text-anchor="start" x="123.37" y="-404.2" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
|
|
78
|
+
<polygon fill="none" stroke="black" points="43.2,-361.2 43.2,-392 315.53,-392 315.53,-361.2 43.2,-361.2"/>
|
|
79
|
+
<text text-anchor="start" x="50.2" y="-373.4" font-family="Arial" font-size="14.00">embedding_dimension </text>
|
|
80
|
+
<text text-anchor="start" x="194.96" y="-373.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
81
|
+
</g>
|
|
82
|
+
<!-- public.nodes->public.robots -->
|
|
83
|
+
<g id="edge1" class="edge">
|
|
84
|
+
<title>public.nodes:robot_id->public.robots:id</title>
|
|
85
|
+
<path fill="none" stroke="black" d="M326.31,-435.35C371.31,-407.51 358.09,-184.8 305.25,-184.8"/>
|
|
86
|
+
<polygon fill="black" stroke="black" points="326.45,-435.31 315.59,-433.79 321.33,-436.8 317.17,-438.01 317.17,-438.01 317.17,-438.01 321.33,-436.8 318.11,-442.43 326.45,-435.31"/>
|
|
87
|
+
<text text-anchor="start" x="323.53" y="-448.2" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
|
|
88
|
+
</g>
|
|
89
|
+
</g>
|
|
90
|
+
</svg>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# public.schema_migrations
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
## Columns
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
8
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
9
|
+
| version | varchar | | false | | | |
|
|
10
|
+
|
|
11
|
+
## Constraints
|
|
12
|
+
|
|
13
|
+
| Name | Type | Definition |
|
|
14
|
+
| ---- | ---- | ---------- |
|
|
15
|
+
| schema_migrations_pkey | PRIMARY KEY | PRIMARY KEY (version) |
|
|
16
|
+
|
|
17
|
+
## Indexes
|
|
18
|
+
|
|
19
|
+
| Name | Definition |
|
|
20
|
+
| ---- | ---------- |
|
|
21
|
+
| schema_migrations_pkey | CREATE UNIQUE INDEX schema_migrations_pkey ON public.schema_migrations USING btree (version) |
|
|
22
|
+
|
|
23
|
+
## Relations
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: public.schema_migrations Pages: 1 -->
|
|
7
|
+
<svg width="428pt" height="167pt"
|
|
8
|
+
viewBox="0.00 0.00 428.35 166.80" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 162.8)">
|
|
10
|
+
<title>public.schema_migrations</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-162.8 424.35,-162.8 424.35,4 -4,4"/>
|
|
12
|
+
<!-- public.schema_migrations -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.schema_migrations</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-77 46.2,-112.6 374.15,-112.6 374.15,-77 46.2,-77"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="46.2,-77 46.2,-112.6 374.15,-112.6 374.15,-77 46.2,-77"/>
|
|
17
|
+
<text text-anchor="start" x="53.2" y="-90.4" font-family="Arial Bold" font-size="18.00">public.schema_migrations</text>
|
|
18
|
+
<text text-anchor="start" x="242.66" y="-90.4" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="273.77" y="-90.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="46.2,-46.2 46.2,-77 374.15,-77 374.15,-46.2 46.2,-46.2"/>
|
|
21
|
+
<text text-anchor="start" x="53.2" y="-58.4" font-family="Arial" font-size="14.00">version </text>
|
|
22
|
+
<text text-anchor="start" x="102.22" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[varchar]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="44.7,-44.7 44.7,-114.1 375.65,-114.1 375.65,-44.7 44.7,-44.7"/>
|
|
24
|
+
</g>
|
|
25
|
+
</g>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# public.tags
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Unique tag names for categorization
|
|
6
|
+
|
|
7
|
+
## Columns
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
11
|
+
| id | bigint | nextval('tags_id_seq'::regclass) | false | [public.node_tags](public.node_tags.md) | | |
|
|
12
|
+
| name | text | | false | | | Hierarchical tag in format: root:level1:level2 (e.g., database:postgresql:timescaledb) |
|
|
13
|
+
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this tag was created |
|
|
14
|
+
|
|
15
|
+
## Constraints
|
|
16
|
+
|
|
17
|
+
| Name | Type | Definition |
|
|
18
|
+
| ---- | ---- | ---------- |
|
|
19
|
+
| tags_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
20
|
+
|
|
21
|
+
## Indexes
|
|
22
|
+
|
|
23
|
+
| Name | Definition |
|
|
24
|
+
| ---- | ---------- |
|
|
25
|
+
| tags_pkey | CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id) |
|
|
26
|
+
| idx_tags_name_unique | CREATE UNIQUE INDEX idx_tags_name_unique ON public.tags USING btree (name) |
|
|
27
|
+
| idx_tags_name_pattern | CREATE INDEX idx_tags_name_pattern ON public.tags USING btree (name text_pattern_ops) |
|
|
28
|
+
|
|
29
|
+
## Relations
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: public.tags Pages: 1 -->
|
|
7
|
+
<svg width="650pt" height="510pt"
|
|
8
|
+
viewBox="0.00 0.00 650.02 509.60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 505.6)">
|
|
10
|
+
<title>public.tags</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-505.6 646.02,-505.6 646.02,4 -4,4"/>
|
|
12
|
+
<!-- public.tags -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.tags</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="48.8,-138.6 48.8,-174.2 298.57,-174.2 298.57,-138.6 48.8,-138.6"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="48.8,-138.6 48.8,-174.2 298.57,-174.2 298.57,-138.6 48.8,-138.6"/>
|
|
17
|
+
<text text-anchor="start" x="72.19" y="-152" font-family="Arial Bold" font-size="18.00">public.tags</text>
|
|
18
|
+
<text text-anchor="start" x="150.68" y="-152" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="181.8" y="-152" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="48.8,-107.8 48.8,-138.6 298.57,-138.6 298.57,-107.8 48.8,-107.8"/>
|
|
21
|
+
<text text-anchor="start" x="55.8" y="-120" font-family="Arial" font-size="14.00">id </text>
|
|
22
|
+
<text text-anchor="start" x="70.58" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" points="48.8,-77 48.8,-107.8 298.57,-107.8 298.57,-77 48.8,-77"/>
|
|
24
|
+
<text text-anchor="start" x="55.8" y="-89.2" font-family="Arial" font-size="14.00">name </text>
|
|
25
|
+
<text text-anchor="start" x="94.71" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
26
|
+
<polygon fill="none" stroke="black" points="48.8,-46.2 48.8,-77 298.57,-77 298.57,-46.2 48.8,-46.2"/>
|
|
27
|
+
<text text-anchor="start" x="55.8" y="-58.4" font-family="Arial" font-size="14.00">created_at </text>
|
|
28
|
+
<text text-anchor="start" x="125.84" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
29
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="47.3,-44.7 47.3,-175.7 300.07,-175.7 300.07,-44.7 47.3,-44.7"/>
|
|
30
|
+
</g>
|
|
31
|
+
<!-- public.node_tags -->
|
|
32
|
+
<g id="node2" class="node">
|
|
33
|
+
<title>public.node_tags</title>
|
|
34
|
+
<polygon fill="#efefef" stroke="none" points="43.2,-422.8 43.2,-458.4 304.16,-458.4 304.16,-422.8 43.2,-422.8"/>
|
|
35
|
+
<polygon fill="none" stroke="black" points="43.2,-422.8 43.2,-458.4 304.16,-458.4 304.16,-422.8 43.2,-422.8"/>
|
|
36
|
+
<text text-anchor="start" x="50.2" y="-436.2" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
|
|
37
|
+
<text text-anchor="start" x="172.68" y="-436.2" font-family="Arial" font-size="14.00"> </text>
|
|
38
|
+
<text text-anchor="start" x="203.79" y="-436.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
39
|
+
<polygon fill="none" stroke="black" points="43.2,-392 43.2,-422.8 304.16,-422.8 304.16,-392 43.2,-392"/>
|
|
40
|
+
<text text-anchor="start" x="50.2" y="-404.2" font-family="Arial" font-size="14.00">id </text>
|
|
41
|
+
<text text-anchor="start" x="64.99" y="-404.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
42
|
+
<polygon fill="none" stroke="black" points="43.2,-361.2 43.2,-392 304.16,-392 304.16,-361.2 43.2,-361.2"/>
|
|
43
|
+
<text text-anchor="start" x="50.2" y="-373.4" font-family="Arial" font-size="14.00">node_id </text>
|
|
44
|
+
<text text-anchor="start" x="103.92" y="-373.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
45
|
+
<polygon fill="none" stroke="black" points="43.2,-330.4 43.2,-361.2 304.16,-361.2 304.16,-330.4 43.2,-330.4"/>
|
|
46
|
+
<text text-anchor="start" x="50.2" y="-342.6" font-family="Arial" font-size="14.00">tag_id </text>
|
|
47
|
+
<text text-anchor="start" x="92.23" y="-342.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
48
|
+
<polygon fill="none" stroke="black" points="43.2,-299.6 43.2,-330.4 304.16,-330.4 304.16,-299.6 43.2,-299.6"/>
|
|
49
|
+
<text text-anchor="start" x="50.2" y="-311.8" font-family="Arial" font-size="14.00">created_at </text>
|
|
50
|
+
<text text-anchor="start" x="120.25" y="-311.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
51
|
+
</g>
|
|
52
|
+
<!-- public.node_tags->public.tags -->
|
|
53
|
+
<g id="edge1" class="edge">
|
|
54
|
+
<title>public.node_tags:tag_id->public.tags:id</title>
|
|
55
|
+
<path fill="none" stroke="black" d="M315.48,-344.95C403.6,-330 394.96,-123.2 299.57,-123.2"/>
|
|
56
|
+
<polygon fill="black" stroke="black" points="315.46,-344.95 305.13,-341.29 310.15,-345.39 305.83,-345.75 305.83,-345.75 305.83,-345.75 310.15,-345.39 305.87,-350.26 315.46,-344.95"/>
|
|
57
|
+
<text text-anchor="start" x="312.16" y="-355.8" font-family="Arial" font-size="10.00">FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE</text>
|
|
58
|
+
</g>
|
|
59
|
+
</g>
|
|
60
|
+
</svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# public.topic_relationships
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Shows which topics co-occur on the same nodes, revealing cross-topic relationships in the knowledge base.
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary><strong>Table Definition</strong></summary>
|
|
9
|
+
|
|
10
|
+
```sql
|
|
11
|
+
CREATE VIEW topic_relationships AS (
|
|
12
|
+
SELECT t1.tag AS topic1,
|
|
13
|
+
t2.tag AS topic2,
|
|
14
|
+
count(DISTINCT t1.node_id) AS shared_nodes
|
|
15
|
+
FROM (tags t1
|
|
16
|
+
JOIN tags t2 ON (((t1.node_id = t2.node_id) AND (t1.tag < t2.tag))))
|
|
17
|
+
GROUP BY t1.tag, t2.tag
|
|
18
|
+
HAVING (count(DISTINCT t1.node_id) >= 2)
|
|
19
|
+
ORDER BY (count(DISTINCT t1.node_id)) DESC
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
## Columns
|
|
26
|
+
|
|
27
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
28
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
29
|
+
| topic1 | text | | true | | | |
|
|
30
|
+
| topic2 | text | | true | | | |
|
|
31
|
+
| shared_nodes | bigint | | true | | | |
|
|
32
|
+
|
|
33
|
+
## Referenced Tables
|
|
34
|
+
|
|
35
|
+
| Name | Columns | Comment | Type |
|
|
36
|
+
| ---- | ------- | ------- | ---- |
|
|
37
|
+
| [public.tags](public.tags.md) | 4 | Hierarchical topic tags for flexible categorization using colon-delimited format | BASE TABLE |
|
|
38
|
+
|
|
39
|
+
## Relations
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: public.topic_relationships Pages: 1 -->
|
|
7
|
+
<svg width="376pt" height="228pt"
|
|
8
|
+
viewBox="0.00 0.00 375.54 228.40" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 224.4)">
|
|
10
|
+
<title>public.topic_relationships</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-224.4 371.54,-224.4 371.54,4 -4,4"/>
|
|
12
|
+
<!-- public.topic_relationships -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.topic_relationships</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-138.6 46.2,-174.2 321.34,-174.2 321.34,-138.6 46.2,-138.6"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="46.2,-138.6 46.2,-174.2 321.34,-174.2 321.34,-138.6 46.2,-138.6"/>
|
|
17
|
+
<text text-anchor="start" x="53.2" y="-152" font-family="Arial Bold" font-size="18.00">public.topic_relationships</text>
|
|
18
|
+
<text text-anchor="start" x="239.67" y="-152" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="270.79" y="-152" font-family="Arial" font-size="14.00" fill="#666666">[VIEW]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="46.2,-107.8 46.2,-138.6 321.34,-138.6 321.34,-107.8 46.2,-107.8"/>
|
|
21
|
+
<text text-anchor="start" x="53.2" y="-120" font-family="Arial" font-size="14.00">topic1 </text>
|
|
22
|
+
<text text-anchor="start" x="94.45" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" points="46.2,-77 46.2,-107.8 321.34,-107.8 321.34,-77 46.2,-77"/>
|
|
24
|
+
<text text-anchor="start" x="53.2" y="-89.2" font-family="Arial" font-size="14.00">topic2 </text>
|
|
25
|
+
<text text-anchor="start" x="94.45" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
26
|
+
<polygon fill="none" stroke="black" points="46.2,-46.2 46.2,-77 321.34,-77 321.34,-46.2 46.2,-46.2"/>
|
|
27
|
+
<text text-anchor="start" x="53.2" y="-58.4" font-family="Arial" font-size="14.00">shared_nodes </text>
|
|
28
|
+
<text text-anchor="start" x="145.83" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
29
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="44.7,-44.7 44.7,-175.7 322.84,-175.7 322.84,-44.7 44.7,-44.7"/>
|
|
30
|
+
</g>
|
|
31
|
+
</g>
|
|
32
|
+
</svg>
|