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
data/dbdoc/README.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# htm_development
|
|
2
|
+
|
|
3
|
+
## Tables
|
|
4
|
+
|
|
5
|
+
| Name | Columns | Comment | Type |
|
|
6
|
+
| ---- | ------- | ------- | ---- |
|
|
7
|
+
| [public.node_tags](public.node_tags.md) | 4 | Join table connecting nodes to tags (many-to-many) | BASE TABLE |
|
|
8
|
+
| [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
|
+
| [public.tags](public.tags.md) | 3 | Unique tag names for categorization | BASE TABLE |
|
|
12
|
+
|
|
13
|
+
## Stored procedures and functions
|
|
14
|
+
|
|
15
|
+
| Name | ReturnType | Arguments | Type |
|
|
16
|
+
| ---- | ------- | ------- | ---- |
|
|
17
|
+
| public.vector_in | vector | cstring, oid, integer | FUNCTION |
|
|
18
|
+
| public.vector_out | cstring | vector | FUNCTION |
|
|
19
|
+
| public.vector_typmod_in | int4 | cstring[] | FUNCTION |
|
|
20
|
+
| public.vector_recv | vector | internal, oid, integer | FUNCTION |
|
|
21
|
+
| public.vector_send | bytea | vector | FUNCTION |
|
|
22
|
+
| public.l2_distance | float8 | vector, vector | FUNCTION |
|
|
23
|
+
| public.inner_product | float8 | vector, vector | FUNCTION |
|
|
24
|
+
| public.cosine_distance | float8 | vector, vector | FUNCTION |
|
|
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 |
|
|
53
|
+
| public.array_to_vector | vector | double precision[], integer, boolean | FUNCTION |
|
|
54
|
+
| public.array_to_vector | vector | numeric[], integer, boolean | FUNCTION |
|
|
55
|
+
| public.vector_to_float4 | _float4 | vector, integer, boolean | FUNCTION |
|
|
56
|
+
| public.ivfflathandler | index_am_handler | internal | FUNCTION |
|
|
57
|
+
| public.hnswhandler | index_am_handler | internal | FUNCTION |
|
|
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 |
|
|
75
|
+
| public.binary_quantize | bit | halfvec | FUNCTION |
|
|
76
|
+
| public.subvector | halfvec | halfvec, integer, integer | FUNCTION |
|
|
77
|
+
| public.halfvec_add | halfvec | halfvec, halfvec | FUNCTION |
|
|
78
|
+
| public.halfvec_sub | halfvec | halfvec, halfvec | FUNCTION |
|
|
79
|
+
| public.halfvec_mul | halfvec | halfvec, halfvec | FUNCTION |
|
|
80
|
+
| public.halfvec_concat | halfvec | halfvec, halfvec | FUNCTION |
|
|
81
|
+
| public.halfvec_lt | bool | halfvec, halfvec | FUNCTION |
|
|
82
|
+
| public.halfvec_le | bool | halfvec, halfvec | FUNCTION |
|
|
83
|
+
| public.halfvec_eq | bool | halfvec, halfvec | FUNCTION |
|
|
84
|
+
| public.halfvec_ne | bool | halfvec, halfvec | FUNCTION |
|
|
85
|
+
| public.halfvec_ge | bool | halfvec, halfvec | FUNCTION |
|
|
86
|
+
| public.halfvec_gt | bool | halfvec, halfvec | FUNCTION |
|
|
87
|
+
| public.halfvec_cmp | int4 | halfvec, halfvec | FUNCTION |
|
|
88
|
+
| public.halfvec_l2_squared_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
89
|
+
| public.halfvec_negative_inner_product | float8 | halfvec, halfvec | FUNCTION |
|
|
90
|
+
| public.halfvec_spherical_distance | float8 | halfvec, halfvec | FUNCTION |
|
|
91
|
+
| public.halfvec_accum | _float8 | double precision[], halfvec | FUNCTION |
|
|
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 |
|
|
103
|
+
| public.halfvec_to_float4 | _float4 | halfvec, integer, boolean | FUNCTION |
|
|
104
|
+
| public.hamming_distance | float8 | bit, bit | FUNCTION |
|
|
105
|
+
| public.jaccard_distance | float8 | bit, bit | FUNCTION |
|
|
106
|
+
| public.sparsevec_in | sparsevec | cstring, oid, integer | FUNCTION |
|
|
107
|
+
| public.sparsevec_out | cstring | sparsevec | FUNCTION |
|
|
108
|
+
| public.sparsevec_typmod_in | int4 | cstring[] | FUNCTION |
|
|
109
|
+
| public.sparsevec_recv | sparsevec | internal, oid, integer | FUNCTION |
|
|
110
|
+
| public.sparsevec_send | bytea | sparsevec | FUNCTION |
|
|
111
|
+
| public.l2_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
112
|
+
| public.inner_product | float8 | sparsevec, sparsevec | FUNCTION |
|
|
113
|
+
| public.cosine_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
114
|
+
| public.l1_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
115
|
+
| public.l2_norm | float8 | sparsevec | FUNCTION |
|
|
116
|
+
| public.l2_normalize | sparsevec | sparsevec | FUNCTION |
|
|
117
|
+
| public.sparsevec_lt | bool | sparsevec, sparsevec | FUNCTION |
|
|
118
|
+
| public.sparsevec_le | bool | sparsevec, sparsevec | FUNCTION |
|
|
119
|
+
| public.sparsevec_eq | bool | sparsevec, sparsevec | FUNCTION |
|
|
120
|
+
| public.sparsevec_ne | bool | sparsevec, sparsevec | FUNCTION |
|
|
121
|
+
| public.sparsevec_ge | bool | sparsevec, sparsevec | FUNCTION |
|
|
122
|
+
| public.sparsevec_gt | bool | sparsevec, sparsevec | FUNCTION |
|
|
123
|
+
| public.sparsevec_cmp | int4 | sparsevec, sparsevec | FUNCTION |
|
|
124
|
+
| public.sparsevec_l2_squared_distance | float8 | sparsevec, sparsevec | FUNCTION |
|
|
125
|
+
| public.sparsevec_negative_inner_product | float8 | sparsevec, sparsevec | FUNCTION |
|
|
126
|
+
| public.sparsevec | sparsevec | sparsevec, integer, boolean | FUNCTION |
|
|
127
|
+
| public.vector_to_sparsevec | sparsevec | vector, integer, boolean | FUNCTION |
|
|
128
|
+
| public.sparsevec_to_vector | vector | sparsevec, integer, boolean | FUNCTION |
|
|
129
|
+
| public.halfvec_to_sparsevec | sparsevec | halfvec, integer, boolean | FUNCTION |
|
|
130
|
+
| public.sparsevec_to_halfvec | halfvec | sparsevec, integer, boolean | FUNCTION |
|
|
131
|
+
| public.array_to_sparsevec | sparsevec | integer[], integer, boolean | FUNCTION |
|
|
132
|
+
| public.array_to_sparsevec | sparsevec | real[], integer, boolean | FUNCTION |
|
|
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 |
|
|
160
|
+
| public.strict_word_similarity | float4 | text, text | FUNCTION |
|
|
161
|
+
| public.strict_word_similarity_op | bool | text, text | FUNCTION |
|
|
162
|
+
| public.strict_word_similarity_commutator_op | bool | text, text | FUNCTION |
|
|
163
|
+
| public.strict_word_similarity_dist_op | float4 | text, text | FUNCTION |
|
|
164
|
+
| public.strict_word_similarity_dist_commutator_op | float4 | text, text | FUNCTION |
|
|
165
|
+
| public.gtrgm_options | void | internal | FUNCTION |
|
|
166
|
+
|
|
167
|
+
## Relations
|
|
168
|
+
|
|
169
|
+

|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# public.node_stats
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Aggregated statistics by node type showing counts, importance, tokens, and age ranges.
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary><strong>Table Definition</strong></summary>
|
|
9
|
+
|
|
10
|
+
```sql
|
|
11
|
+
CREATE VIEW node_stats AS (
|
|
12
|
+
SELECT type,
|
|
13
|
+
count(*) AS count,
|
|
14
|
+
avg(importance) AS avg_importance,
|
|
15
|
+
sum(token_count) AS total_tokens,
|
|
16
|
+
min(created_at) AS oldest,
|
|
17
|
+
max(created_at) AS newest
|
|
18
|
+
FROM nodes
|
|
19
|
+
GROUP BY type
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
## Columns
|
|
26
|
+
|
|
27
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
28
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
29
|
+
| type | text | | true | | | |
|
|
30
|
+
| count | bigint | | true | | | |
|
|
31
|
+
| avg_importance | double precision | | true | | | |
|
|
32
|
+
| total_tokens | bigint | | true | | | |
|
|
33
|
+
| oldest | timestamp with time zone | | true | | | |
|
|
34
|
+
| newest | timestamp with time zone | | true | | | |
|
|
35
|
+
|
|
36
|
+
## Referenced Tables
|
|
37
|
+
|
|
38
|
+
| Name | Columns | Comment | Type |
|
|
39
|
+
| ---- | ------- | ------- | ---- |
|
|
40
|
+
| [public.nodes](public.nodes.md) | 14 | Core memory storage for conversation messages and context | BASE TABLE |
|
|
41
|
+
|
|
42
|
+
## Relations
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,41 @@
|
|
|
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.node_stats Pages: 1 -->
|
|
7
|
+
<svg width="328pt" height="321pt"
|
|
8
|
+
viewBox="0.00 0.00 328.37 320.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 316.8)">
|
|
10
|
+
<title>public.node_stats</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-316.8 324.37,-316.8 324.37,4 -4,4"/>
|
|
12
|
+
<!-- public.node_stats -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.node_stats</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-231 46.2,-266.6 274.17,-266.6 274.17,-231 46.2,-231"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="46.2,-231 46.2,-266.6 274.17,-266.6 274.17,-231 46.2,-231"/>
|
|
17
|
+
<text text-anchor="start" x="60.11" y="-244.4" font-family="Arial Bold" font-size="18.00">public.node_stats</text>
|
|
18
|
+
<text text-anchor="start" x="185.59" y="-244.4" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="216.71" y="-244.4" font-family="Arial" font-size="14.00" fill="#666666">[VIEW]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="46.2,-200.2 46.2,-231 274.17,-231 274.17,-200.2 46.2,-200.2"/>
|
|
21
|
+
<text text-anchor="start" x="53.2" y="-212.4" font-family="Arial" font-size="14.00">type </text>
|
|
22
|
+
<text text-anchor="start" x="83.55" y="-212.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" points="46.2,-169.4 46.2,-200.2 274.17,-200.2 274.17,-169.4 46.2,-169.4"/>
|
|
24
|
+
<text text-anchor="start" x="53.2" y="-181.6" font-family="Arial" font-size="14.00">count </text>
|
|
25
|
+
<text text-anchor="start" x="91.34" y="-181.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
26
|
+
<polygon fill="none" stroke="black" points="46.2,-138.6 46.2,-169.4 274.17,-169.4 274.17,-138.6 46.2,-138.6"/>
|
|
27
|
+
<text text-anchor="start" x="53.2" y="-150.8" font-family="Arial" font-size="14.00">avg_importance </text>
|
|
28
|
+
<text text-anchor="start" x="156.7" y="-150.8" font-family="Arial" font-size="14.00" fill="#666666">[double precision]</text>
|
|
29
|
+
<polygon fill="none" stroke="black" points="46.2,-107.8 46.2,-138.6 274.17,-138.6 274.17,-107.8 46.2,-107.8"/>
|
|
30
|
+
<text text-anchor="start" x="53.2" y="-120" font-family="Arial" font-size="14.00">total_tokens </text>
|
|
31
|
+
<text text-anchor="start" x="132.59" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
32
|
+
<polygon fill="none" stroke="black" points="46.2,-77 46.2,-107.8 274.17,-107.8 274.17,-77 46.2,-77"/>
|
|
33
|
+
<text text-anchor="start" x="53.2" y="-89.2" font-family="Arial" font-size="14.00">oldest </text>
|
|
34
|
+
<text text-anchor="start" x="94.45" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
35
|
+
<polygon fill="none" stroke="black" points="46.2,-46.2 46.2,-77 274.17,-77 274.17,-46.2 46.2,-46.2"/>
|
|
36
|
+
<text text-anchor="start" x="53.2" y="-58.4" font-family="Arial" font-size="14.00">newest </text>
|
|
37
|
+
<text text-anchor="start" x="101.45" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
38
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="44.7,-44.7 44.7,-268.1 275.67,-268.1 275.67,-44.7 44.7,-44.7"/>
|
|
39
|
+
</g>
|
|
40
|
+
</g>
|
|
41
|
+
</svg>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# public.node_tags
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Join table connecting nodes to tags (many-to-many)
|
|
6
|
+
|
|
7
|
+
## Columns
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
11
|
+
| id | bigint | nextval('node_tags_id_seq'::regclass) | false | | | |
|
|
12
|
+
| node_id | bigint | | false | | [public.nodes](public.nodes.md) | |
|
|
13
|
+
| tag_id | bigint | | false | | [public.tags](public.tags.md) | |
|
|
14
|
+
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
|
|
15
|
+
|
|
16
|
+
## Constraints
|
|
17
|
+
|
|
18
|
+
| Name | Type | Definition |
|
|
19
|
+
| ---- | ---- | ---------- |
|
|
20
|
+
| node_tags_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
21
|
+
| idx_node_tags_unique | UNIQUE | UNIQUE (node_id, tag_id) |
|
|
22
|
+
| fk_rails_ebc9aafd9f | FOREIGN KEY | FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE |
|
|
23
|
+
| fk_rails_b51cdcc57f | FOREIGN KEY | FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE |
|
|
24
|
+
|
|
25
|
+
## Indexes
|
|
26
|
+
|
|
27
|
+
| Name | Definition |
|
|
28
|
+
| ---- | ---------- |
|
|
29
|
+
| node_tags_pkey | CREATE UNIQUE INDEX node_tags_pkey ON public.node_tags USING btree (id) |
|
|
30
|
+
| idx_node_tags_unique | CREATE UNIQUE INDEX idx_node_tags_unique ON public.node_tags USING btree (node_id, tag_id) |
|
|
31
|
+
| idx_node_tags_node_id | CREATE INDEX idx_node_tags_node_id ON public.node_tags USING btree (node_id) |
|
|
32
|
+
| idx_node_tags_tag_id | CREATE INDEX idx_node_tags_tag_id ON public.node_tags USING btree (tag_id) |
|
|
33
|
+
|
|
34
|
+
## Relations
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,112 @@
|
|
|
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.node_tags Pages: 1 -->
|
|
7
|
+
<svg width="961pt" height="787pt"
|
|
8
|
+
viewBox="0.00 0.00 961.37 786.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 782.8)">
|
|
10
|
+
<title>public.node_tags</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-782.8 957.37,-782.8 957.37,4 -4,4"/>
|
|
12
|
+
<!-- public.node_tags -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.node_tags</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="354.55,-697 354.55,-732.6 615.51,-732.6 615.51,-697 354.55,-697"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="354.55,-697 354.55,-732.6 615.51,-732.6 615.51,-697 354.55,-697"/>
|
|
17
|
+
<text text-anchor="start" x="361.55" y="-710.4" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
|
|
18
|
+
<text text-anchor="start" x="484.02" y="-710.4" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="515.14" y="-710.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="354.55,-666.2 354.55,-697 615.51,-697 615.51,-666.2 354.55,-666.2"/>
|
|
21
|
+
<text text-anchor="start" x="361.55" y="-678.4" font-family="Arial" font-size="14.00">id </text>
|
|
22
|
+
<text text-anchor="start" x="376.33" y="-678.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" points="354.55,-635.4 354.55,-666.2 615.51,-666.2 615.51,-635.4 354.55,-635.4"/>
|
|
24
|
+
<text text-anchor="start" x="361.55" y="-647.6" font-family="Arial" font-size="14.00">node_id </text>
|
|
25
|
+
<text text-anchor="start" x="415.26" y="-647.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
26
|
+
<polygon fill="none" stroke="black" points="354.55,-604.6 354.55,-635.4 615.51,-635.4 615.51,-604.6 354.55,-604.6"/>
|
|
27
|
+
<text text-anchor="start" x="361.55" y="-616.8" font-family="Arial" font-size="14.00">tag_id </text>
|
|
28
|
+
<text text-anchor="start" x="403.58" y="-616.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
29
|
+
<polygon fill="none" stroke="black" points="354.55,-573.8 354.55,-604.6 615.51,-604.6 615.51,-573.8 354.55,-573.8"/>
|
|
30
|
+
<text text-anchor="start" x="361.55" y="-586" font-family="Arial" font-size="14.00">created_at </text>
|
|
31
|
+
<text text-anchor="start" x="431.59" y="-586" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
32
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="353.05,-572.3 353.05,-734.1 617.01,-734.1 617.01,-572.3 353.05,-572.3"/>
|
|
33
|
+
</g>
|
|
34
|
+
<!-- public.nodes -->
|
|
35
|
+
<g id="node2" class="node">
|
|
36
|
+
<title>public.nodes</title>
|
|
37
|
+
<polygon fill="#efefef" stroke="none" points="166.86,-412.8 166.86,-448.4 439.19,-448.4 439.19,-412.8 166.86,-412.8"/>
|
|
38
|
+
<polygon fill="none" stroke="black" points="166.86,-412.8 166.86,-448.4 439.19,-448.4 439.19,-412.8 166.86,-412.8"/>
|
|
39
|
+
<text text-anchor="start" x="195.04" y="-426.2" font-family="Arial Bold" font-size="18.00">public.nodes</text>
|
|
40
|
+
<text text-anchor="start" x="286.53" y="-426.2" font-family="Arial" font-size="14.00"> </text>
|
|
41
|
+
<text text-anchor="start" x="317.64" y="-426.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
42
|
+
<polygon fill="none" stroke="black" points="166.86,-382 166.86,-412.8 439.19,-412.8 439.19,-382 166.86,-382"/>
|
|
43
|
+
<text text-anchor="start" x="173.86" y="-394.2" font-family="Arial" font-size="14.00">id </text>
|
|
44
|
+
<text text-anchor="start" x="188.65" y="-394.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
45
|
+
<polygon fill="none" stroke="black" points="166.86,-351.2 166.86,-382 439.19,-382 439.19,-351.2 166.86,-351.2"/>
|
|
46
|
+
<text text-anchor="start" x="173.86" y="-363.4" font-family="Arial" font-size="14.00">content </text>
|
|
47
|
+
<text text-anchor="start" x="223.68" y="-363.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
48
|
+
<polygon fill="none" stroke="black" points="166.86,-320.4 166.86,-351.2 439.19,-351.2 439.19,-320.4 166.86,-320.4"/>
|
|
49
|
+
<text text-anchor="start" x="173.86" y="-332.6" font-family="Arial" font-size="14.00">source </text>
|
|
50
|
+
<text text-anchor="start" x="219.77" y="-332.6" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
51
|
+
<polygon fill="none" stroke="black" points="166.86,-289.6 166.86,-320.4 439.19,-320.4 439.19,-289.6 166.86,-289.6"/>
|
|
52
|
+
<text text-anchor="start" x="173.86" y="-301.8" font-family="Arial" font-size="14.00">access_count </text>
|
|
53
|
+
<text text-anchor="start" x="263.36" y="-301.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
54
|
+
<polygon fill="none" stroke="black" points="166.86,-258.8 166.86,-289.6 439.19,-289.6 439.19,-258.8 166.86,-258.8"/>
|
|
55
|
+
<text text-anchor="start" x="173.86" y="-271" font-family="Arial" font-size="14.00">created_at </text>
|
|
56
|
+
<text text-anchor="start" x="243.91" y="-271" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
57
|
+
<polygon fill="none" stroke="black" points="166.86,-228 166.86,-258.8 439.19,-258.8 439.19,-228 166.86,-228"/>
|
|
58
|
+
<text text-anchor="start" x="173.86" y="-240.2" font-family="Arial" font-size="14.00">updated_at </text>
|
|
59
|
+
<text text-anchor="start" x="247.82" y="-240.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
60
|
+
<polygon fill="none" stroke="black" points="166.86,-197.2 166.86,-228 439.19,-228 439.19,-197.2 166.86,-197.2"/>
|
|
61
|
+
<text text-anchor="start" x="173.86" y="-209.4" font-family="Arial" font-size="14.00">last_accessed </text>
|
|
62
|
+
<text text-anchor="start" x="266.47" y="-209.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
63
|
+
<polygon fill="none" stroke="black" points="166.86,-166.4 166.86,-197.2 439.19,-197.2 439.19,-166.4 166.86,-166.4"/>
|
|
64
|
+
<text text-anchor="start" x="173.86" y="-178.6" font-family="Arial" font-size="14.00">token_count </text>
|
|
65
|
+
<text text-anchor="start" x="254.04" y="-178.6" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
66
|
+
<polygon fill="none" stroke="black" points="166.86,-135.6 166.86,-166.4 439.19,-166.4 439.19,-135.6 166.86,-135.6"/>
|
|
67
|
+
<text text-anchor="start" x="173.86" y="-147.8" font-family="Arial" font-size="14.00">in_working_memory </text>
|
|
68
|
+
<text text-anchor="start" x="303.02" y="-147.8" font-family="Arial" font-size="14.00" fill="#666666">[boolean]</text>
|
|
69
|
+
<polygon fill="none" stroke="black" points="166.86,-104.8 166.86,-135.6 439.19,-135.6 439.19,-104.8 166.86,-104.8"/>
|
|
70
|
+
<text text-anchor="start" x="173.86" y="-117" font-family="Arial" font-size="14.00">robot_id </text>
|
|
71
|
+
<text text-anchor="start" x="228.35" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
72
|
+
<polygon fill="none" stroke="black" points="166.86,-74 166.86,-104.8 439.19,-104.8 439.19,-74 166.86,-74"/>
|
|
73
|
+
<text text-anchor="start" x="173.86" y="-86.2" font-family="Arial" font-size="14.00">embedding </text>
|
|
74
|
+
<text text-anchor="start" x="247.03" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
|
|
75
|
+
<polygon fill="none" stroke="black" points="166.86,-43.2 166.86,-74 439.19,-74 439.19,-43.2 166.86,-43.2"/>
|
|
76
|
+
<text text-anchor="start" x="173.86" y="-55.4" font-family="Arial" font-size="14.00">embedding_dimension </text>
|
|
77
|
+
<text text-anchor="start" x="318.63" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
78
|
+
</g>
|
|
79
|
+
<!-- public.node_tags->public.nodes -->
|
|
80
|
+
<g id="edge1" class="edge">
|
|
81
|
+
<title>public.node_tags:node_id->public.nodes:id</title>
|
|
82
|
+
<path fill="none" stroke="black" d="M343.42,-649.75C302.28,-640.33 326.23,-570.04 354.55,-527.6 377.24,-493.59 416.46,-525.58 439.19,-491.6 462.48,-456.8 482.06,-397.4 440.19,-397.4"/>
|
|
83
|
+
<polygon fill="black" stroke="black" points="343.27,-649.73 352.75,-655.24 348.57,-650.28 352.88,-650.73 352.88,-650.73 352.88,-650.73 348.57,-650.28 353.68,-646.29 343.27,-649.73"/>
|
|
84
|
+
<text text-anchor="start" x="7" y="-660.8" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
|
|
85
|
+
</g>
|
|
86
|
+
<!-- public.tags -->
|
|
87
|
+
<g id="node3" class="node">
|
|
88
|
+
<title>public.tags</title>
|
|
89
|
+
<polygon fill="#efefef" stroke="none" points="543.14,-274.2 543.14,-309.8 792.91,-309.8 792.91,-274.2 543.14,-274.2"/>
|
|
90
|
+
<polygon fill="none" stroke="black" points="543.14,-274.2 543.14,-309.8 792.91,-309.8 792.91,-274.2 543.14,-274.2"/>
|
|
91
|
+
<text text-anchor="start" x="566.54" y="-287.6" font-family="Arial Bold" font-size="18.00">public.tags</text>
|
|
92
|
+
<text text-anchor="start" x="645.03" y="-287.6" font-family="Arial" font-size="14.00"> </text>
|
|
93
|
+
<text text-anchor="start" x="676.14" y="-287.6" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
94
|
+
<polygon fill="none" stroke="black" points="543.14,-243.4 543.14,-274.2 792.91,-274.2 792.91,-243.4 543.14,-243.4"/>
|
|
95
|
+
<text text-anchor="start" x="550.14" y="-255.6" font-family="Arial" font-size="14.00">id </text>
|
|
96
|
+
<text text-anchor="start" x="564.93" y="-255.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
97
|
+
<polygon fill="none" stroke="black" points="543.14,-212.6 543.14,-243.4 792.91,-243.4 792.91,-212.6 543.14,-212.6"/>
|
|
98
|
+
<text text-anchor="start" x="550.14" y="-224.8" font-family="Arial" font-size="14.00">name </text>
|
|
99
|
+
<text text-anchor="start" x="589.05" y="-224.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
100
|
+
<polygon fill="none" stroke="black" points="543.14,-181.8 543.14,-212.6 792.91,-212.6 792.91,-181.8 543.14,-181.8"/>
|
|
101
|
+
<text text-anchor="start" x="550.14" y="-194" font-family="Arial" font-size="14.00">created_at </text>
|
|
102
|
+
<text text-anchor="start" x="620.19" y="-194" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
103
|
+
</g>
|
|
104
|
+
<!-- public.node_tags->public.tags -->
|
|
105
|
+
<g id="edge2" class="edge">
|
|
106
|
+
<title>public.node_tags:tag_id->public.tags:id</title>
|
|
107
|
+
<path fill="none" stroke="black" d="M626.71,-619.46C762.63,-603.96 381.92,-258.8 542.14,-258.8"/>
|
|
108
|
+
<polygon fill="black" stroke="black" points="626.83,-619.46 616.61,-615.49 621.5,-619.74 617.18,-619.96 617.18,-619.96 617.18,-619.96 621.5,-619.74 617.08,-624.48 626.83,-619.46"/>
|
|
109
|
+
<text text-anchor="start" x="623.51" y="-630" font-family="Arial" font-size="10.00">FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE</text>
|
|
110
|
+
</g>
|
|
111
|
+
</g>
|
|
112
|
+
</svg>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# public.nodes
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Core memory storage for conversation messages and context
|
|
6
|
+
|
|
7
|
+
## Columns
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
11
|
+
| id | bigint | nextval('nodes_id_seq'::regclass) | false | [public.node_tags](public.node_tags.md) | | |
|
|
12
|
+
| content | text | | false | | | The conversation message/utterance content |
|
|
13
|
+
| source | text | ''::text | true | | | From where the content came (empty string if unknown) |
|
|
14
|
+
| access_count | integer | 0 | false | | | Number of times this node has been accessed/retrieved |
|
|
15
|
+
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this memory was created |
|
|
16
|
+
| updated_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this memory was last modified |
|
|
17
|
+
| last_accessed | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this memory was last accessed |
|
|
18
|
+
| token_count | integer | | true | | | Number of tokens in the content (for context budget management) |
|
|
19
|
+
| in_working_memory | boolean | false | true | | | Whether this memory is currently in working memory |
|
|
20
|
+
| robot_id | bigint | | false | | [public.robots](public.robots.md) | ID of the robot that owns this memory |
|
|
21
|
+
| embedding | vector(2000) | | true | | | Vector embedding (max 2000 dimensions) for semantic search |
|
|
22
|
+
| embedding_dimension | integer | | true | | | Actual number of dimensions used in the embedding vector (max 2000) |
|
|
23
|
+
|
|
24
|
+
## Constraints
|
|
25
|
+
|
|
26
|
+
| Name | Type | Definition |
|
|
27
|
+
| ---- | ---- | ---------- |
|
|
28
|
+
| check_embedding_dimension | CHECK | CHECK (((embedding_dimension IS NULL) OR ((embedding_dimension > 0) AND (embedding_dimension <= 2000)))) |
|
|
29
|
+
| fk_rails_60162e9d3a | FOREIGN KEY | FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE |
|
|
30
|
+
| nodes_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
31
|
+
|
|
32
|
+
## Indexes
|
|
33
|
+
|
|
34
|
+
| Name | Definition |
|
|
35
|
+
| ---- | ---------- |
|
|
36
|
+
| nodes_pkey | CREATE UNIQUE INDEX nodes_pkey ON public.nodes USING btree (id) |
|
|
37
|
+
| idx_nodes_created_at | CREATE INDEX idx_nodes_created_at ON public.nodes USING btree (created_at) |
|
|
38
|
+
| idx_nodes_updated_at | CREATE INDEX idx_nodes_updated_at ON public.nodes USING btree (updated_at) |
|
|
39
|
+
| idx_nodes_last_accessed | CREATE INDEX idx_nodes_last_accessed ON public.nodes USING btree (last_accessed) |
|
|
40
|
+
| idx_nodes_access_count | CREATE INDEX idx_nodes_access_count ON public.nodes USING btree (access_count) |
|
|
41
|
+
| idx_nodes_robot_id | CREATE INDEX idx_nodes_robot_id ON public.nodes USING btree (robot_id) |
|
|
42
|
+
| idx_nodes_source | CREATE INDEX idx_nodes_source ON public.nodes USING btree (source) |
|
|
43
|
+
| idx_nodes_in_working_memory | CREATE INDEX idx_nodes_in_working_memory ON public.nodes USING btree (in_working_memory) |
|
|
44
|
+
| idx_nodes_embedding | CREATE INDEX idx_nodes_embedding ON public.nodes USING hnsw (embedding vector_cosine_ops) WITH (m='16', ef_construction='64') |
|
|
45
|
+
| idx_nodes_content_gin | CREATE INDEX idx_nodes_content_gin ON public.nodes USING gin (to_tsvector('english'::regconfig, content)) |
|
|
46
|
+
| idx_nodes_content_trgm | CREATE INDEX idx_nodes_content_trgm ON public.nodes USING gin (content gin_trgm_ops) |
|
|
47
|
+
|
|
48
|
+
## Relations
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,118 @@
|
|
|
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.nodes Pages: 1 -->
|
|
7
|
+
<svg width="682pt" height="1099pt"
|
|
8
|
+
viewBox="0.00 0.00 682.17 1098.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 1094.8)">
|
|
10
|
+
<title>public.nodes</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-1094.8 678.17,-1094.8 678.17,4 -4,4"/>
|
|
12
|
+
<!-- public.nodes -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.nodes</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-727.8 46.2,-763.4 318.53,-763.4 318.53,-727.8 46.2,-727.8"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="46.2,-727.8 46.2,-763.4 318.53,-763.4 318.53,-727.8 46.2,-727.8"/>
|
|
17
|
+
<text text-anchor="start" x="74.38" y="-741.2" font-family="Arial Bold" font-size="18.00">public.nodes</text>
|
|
18
|
+
<text text-anchor="start" x="165.86" y="-741.2" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="196.98" y="-741.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
20
|
+
<polygon fill="none" stroke="black" points="46.2,-697 46.2,-727.8 318.53,-727.8 318.53,-697 46.2,-697"/>
|
|
21
|
+
<text text-anchor="start" x="53.2" y="-709.2" font-family="Arial" font-size="14.00">id </text>
|
|
22
|
+
<text text-anchor="start" x="67.99" y="-709.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
23
|
+
<polygon fill="none" stroke="black" points="46.2,-666.2 46.2,-697 318.53,-697 318.53,-666.2 46.2,-666.2"/>
|
|
24
|
+
<text text-anchor="start" x="53.2" y="-678.4" font-family="Arial" font-size="14.00">content </text>
|
|
25
|
+
<text text-anchor="start" x="103.01" y="-678.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
26
|
+
<polygon fill="none" stroke="black" points="46.2,-635.4 46.2,-666.2 318.53,-666.2 318.53,-635.4 46.2,-635.4"/>
|
|
27
|
+
<text text-anchor="start" x="53.2" y="-647.6" font-family="Arial" font-size="14.00">source </text>
|
|
28
|
+
<text text-anchor="start" x="99.11" y="-647.6" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
29
|
+
<polygon fill="none" stroke="black" points="46.2,-604.6 46.2,-635.4 318.53,-635.4 318.53,-604.6 46.2,-604.6"/>
|
|
30
|
+
<text text-anchor="start" x="53.2" y="-616.8" font-family="Arial" font-size="14.00">access_count </text>
|
|
31
|
+
<text text-anchor="start" x="142.7" y="-616.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
32
|
+
<polygon fill="none" stroke="black" points="46.2,-573.8 46.2,-604.6 318.53,-604.6 318.53,-573.8 46.2,-573.8"/>
|
|
33
|
+
<text text-anchor="start" x="53.2" y="-586" font-family="Arial" font-size="14.00">created_at </text>
|
|
34
|
+
<text text-anchor="start" x="123.25" y="-586" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
35
|
+
<polygon fill="none" stroke="black" points="46.2,-543 46.2,-573.8 318.53,-573.8 318.53,-543 46.2,-543"/>
|
|
36
|
+
<text text-anchor="start" x="53.2" y="-555.2" font-family="Arial" font-size="14.00">updated_at </text>
|
|
37
|
+
<text text-anchor="start" x="127.16" y="-555.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
38
|
+
<polygon fill="none" stroke="black" points="46.2,-512.2 46.2,-543 318.53,-543 318.53,-512.2 46.2,-512.2"/>
|
|
39
|
+
<text text-anchor="start" x="53.2" y="-524.4" font-family="Arial" font-size="14.00">last_accessed </text>
|
|
40
|
+
<text text-anchor="start" x="145.81" y="-524.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
41
|
+
<polygon fill="none" stroke="black" points="46.2,-481.4 46.2,-512.2 318.53,-512.2 318.53,-481.4 46.2,-481.4"/>
|
|
42
|
+
<text text-anchor="start" x="53.2" y="-493.6" font-family="Arial" font-size="14.00">token_count </text>
|
|
43
|
+
<text text-anchor="start" x="133.37" y="-493.6" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
44
|
+
<polygon fill="none" stroke="black" points="46.2,-450.6 46.2,-481.4 318.53,-481.4 318.53,-450.6 46.2,-450.6"/>
|
|
45
|
+
<text text-anchor="start" x="53.2" y="-462.8" font-family="Arial" font-size="14.00">in_working_memory </text>
|
|
46
|
+
<text text-anchor="start" x="182.36" y="-462.8" font-family="Arial" font-size="14.00" fill="#666666">[boolean]</text>
|
|
47
|
+
<polygon fill="none" stroke="black" points="46.2,-419.8 46.2,-450.6 318.53,-450.6 318.53,-419.8 46.2,-419.8"/>
|
|
48
|
+
<text text-anchor="start" x="53.2" y="-432" font-family="Arial" font-size="14.00">robot_id </text>
|
|
49
|
+
<text text-anchor="start" x="107.68" y="-432" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
50
|
+
<polygon fill="none" stroke="black" points="46.2,-389 46.2,-419.8 318.53,-419.8 318.53,-389 46.2,-389"/>
|
|
51
|
+
<text text-anchor="start" x="53.2" y="-401.2" font-family="Arial" font-size="14.00">embedding </text>
|
|
52
|
+
<text text-anchor="start" x="126.37" y="-401.2" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
|
|
53
|
+
<polygon fill="none" stroke="black" points="46.2,-358.2 46.2,-389 318.53,-389 318.53,-358.2 46.2,-358.2"/>
|
|
54
|
+
<text text-anchor="start" x="53.2" y="-370.4" font-family="Arial" font-size="14.00">embedding_dimension </text>
|
|
55
|
+
<text text-anchor="start" x="197.96" y="-370.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
56
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="44.7,-356.7 44.7,-764.9 320.03,-764.9 320.03,-356.7 44.7,-356.7"/>
|
|
57
|
+
</g>
|
|
58
|
+
<!-- public.robots -->
|
|
59
|
+
<g id="node3" class="node">
|
|
60
|
+
<title>public.robots</title>
|
|
61
|
+
<polygon fill="#efefef" stroke="none" points="57.48,-197.2 57.48,-232.8 307.25,-232.8 307.25,-197.2 57.48,-197.2"/>
|
|
62
|
+
<polygon fill="none" stroke="black" points="57.48,-197.2 57.48,-232.8 307.25,-232.8 307.25,-197.2 57.48,-197.2"/>
|
|
63
|
+
<text text-anchor="start" x="72.87" y="-210.6" font-family="Arial Bold" font-size="18.00">public.robots</text>
|
|
64
|
+
<text text-anchor="start" x="167.37" y="-210.6" font-family="Arial" font-size="14.00"> </text>
|
|
65
|
+
<text text-anchor="start" x="198.48" y="-210.6" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
66
|
+
<polygon fill="none" stroke="black" points="57.48,-166.4 57.48,-197.2 307.25,-197.2 307.25,-166.4 57.48,-166.4"/>
|
|
67
|
+
<text text-anchor="start" x="64.48" y="-178.6" font-family="Arial" font-size="14.00">id </text>
|
|
68
|
+
<text text-anchor="start" x="79.27" y="-178.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
69
|
+
<polygon fill="none" stroke="black" points="57.48,-135.6 57.48,-166.4 307.25,-166.4 307.25,-135.6 57.48,-135.6"/>
|
|
70
|
+
<text text-anchor="start" x="64.48" y="-147.8" font-family="Arial" font-size="14.00">name </text>
|
|
71
|
+
<text text-anchor="start" x="103.39" y="-147.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
72
|
+
<polygon fill="none" stroke="black" points="57.48,-104.8 57.48,-135.6 307.25,-135.6 307.25,-104.8 57.48,-104.8"/>
|
|
73
|
+
<text text-anchor="start" x="64.48" y="-117" font-family="Arial" font-size="14.00">created_at </text>
|
|
74
|
+
<text text-anchor="start" x="134.53" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
75
|
+
<polygon fill="none" stroke="black" points="57.48,-74 57.48,-104.8 307.25,-104.8 307.25,-74 57.48,-74"/>
|
|
76
|
+
<text text-anchor="start" x="64.48" y="-86.2" font-family="Arial" font-size="14.00">last_active </text>
|
|
77
|
+
<text text-anchor="start" x="134.51" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
78
|
+
<polygon fill="none" stroke="black" points="57.48,-43.2 57.48,-74 307.25,-74 307.25,-43.2 57.48,-43.2"/>
|
|
79
|
+
<text text-anchor="start" x="64.48" y="-55.4" font-family="Arial" font-size="14.00">metadata </text>
|
|
80
|
+
<text text-anchor="start" x="126.74" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
|
|
81
|
+
</g>
|
|
82
|
+
<!-- public.nodes->public.robots -->
|
|
83
|
+
<g id="edge2" class="edge">
|
|
84
|
+
<title>public.nodes:robot_id->public.robots:id</title>
|
|
85
|
+
<path fill="none" stroke="black" d="M329.74,-434.47C431.46,-419.61 417.46,-181.8 308.25,-181.8"/>
|
|
86
|
+
<polygon fill="black" stroke="black" points="329.84,-434.47 319.54,-430.69 324.52,-434.84 320.2,-435.15 320.2,-435.15 320.2,-435.15 324.52,-434.84 320.18,-439.66 329.84,-434.47"/>
|
|
87
|
+
<text text-anchor="start" x="326.53" y="-445.2" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
|
|
88
|
+
</g>
|
|
89
|
+
<!-- public.node_tags -->
|
|
90
|
+
<g id="node2" class="node">
|
|
91
|
+
<title>public.node_tags</title>
|
|
92
|
+
<polygon fill="#efefef" stroke="none" points="51.88,-1012 51.88,-1047.6 312.85,-1047.6 312.85,-1012 51.88,-1012"/>
|
|
93
|
+
<polygon fill="none" stroke="black" points="51.88,-1012 51.88,-1047.6 312.85,-1047.6 312.85,-1012 51.88,-1012"/>
|
|
94
|
+
<text text-anchor="start" x="58.88" y="-1025.4" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
|
|
95
|
+
<text text-anchor="start" x="181.36" y="-1025.4" font-family="Arial" font-size="14.00"> </text>
|
|
96
|
+
<text text-anchor="start" x="212.48" y="-1025.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
97
|
+
<polygon fill="none" stroke="black" points="51.88,-981.2 51.88,-1012 312.85,-1012 312.85,-981.2 51.88,-981.2"/>
|
|
98
|
+
<text text-anchor="start" x="58.88" y="-993.4" font-family="Arial" font-size="14.00">id </text>
|
|
99
|
+
<text text-anchor="start" x="73.67" y="-993.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
100
|
+
<polygon fill="none" stroke="black" points="51.88,-950.4 51.88,-981.2 312.85,-981.2 312.85,-950.4 51.88,-950.4"/>
|
|
101
|
+
<text text-anchor="start" x="58.88" y="-962.6" font-family="Arial" font-size="14.00">node_id </text>
|
|
102
|
+
<text text-anchor="start" x="112.6" y="-962.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
103
|
+
<polygon fill="none" stroke="black" points="51.88,-919.6 51.88,-950.4 312.85,-950.4 312.85,-919.6 51.88,-919.6"/>
|
|
104
|
+
<text text-anchor="start" x="58.88" y="-931.8" font-family="Arial" font-size="14.00">tag_id </text>
|
|
105
|
+
<text text-anchor="start" x="100.92" y="-931.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
106
|
+
<polygon fill="none" stroke="black" points="51.88,-888.8 51.88,-919.6 312.85,-919.6 312.85,-888.8 51.88,-888.8"/>
|
|
107
|
+
<text text-anchor="start" x="58.88" y="-901" font-family="Arial" font-size="14.00">created_at </text>
|
|
108
|
+
<text text-anchor="start" x="128.93" y="-901" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
109
|
+
</g>
|
|
110
|
+
<!-- public.node_tags->public.nodes -->
|
|
111
|
+
<g id="edge1" class="edge">
|
|
112
|
+
<title>public.node_tags:node_id->public.nodes:id</title>
|
|
113
|
+
<path fill="none" stroke="black" d="M324.09,-965.07C426.74,-950.21 428.66,-712.4 319.53,-712.4"/>
|
|
114
|
+
<polygon fill="black" stroke="black" points="324.16,-965.07 313.86,-961.29 318.83,-965.45 314.51,-965.75 314.51,-965.75 314.51,-965.75 318.83,-965.45 314.5,-970.27 324.16,-965.07"/>
|
|
115
|
+
<text text-anchor="start" x="320.85" y="-975.8" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
|
|
116
|
+
</g>
|
|
117
|
+
</g>
|
|
118
|
+
</svg>
|