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
|
@@ -8,42 +8,47 @@ Core memory storage for conversation messages and context
|
|
|
8
8
|
|
|
9
9
|
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
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
11
|
| access_count | integer | 0 | false | | | Number of times this node has been accessed/retrieved |
|
|
12
|
+
| chunk_position | integer | | true | | | Position within source file (0-indexed) |
|
|
13
|
+
| content | text | | false | | | The conversation message/utterance content |
|
|
14
|
+
| content_hash | varchar(64) | | true | | | SHA-256 hash of content for deduplication |
|
|
15
15
|
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this memory was created |
|
|
16
|
-
|
|
|
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 |
|
|
16
|
+
| deleted_at | timestamp with time zone | | true | | | Soft delete timestamp - node is considered deleted when set |
|
|
21
17
|
| embedding | vector(2000) | | true | | | Vector embedding (max 2000 dimensions) for semantic search |
|
|
22
18
|
| embedding_dimension | integer | | true | | | Actual number of dimensions used in the embedding vector (max 2000) |
|
|
19
|
+
| id | bigint | nextval('nodes_id_seq'::regclass) | false | [public.node_tags](public.node_tags.md) [public.robot_nodes](public.robot_nodes.md) | | |
|
|
20
|
+
| last_accessed | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this memory was last accessed |
|
|
21
|
+
| metadata | jsonb | '{}'::jsonb | false | | | Flexible metadata storage (memory_type, importance, source, etc.) |
|
|
22
|
+
| source_id | bigint | | true | | [public.file_sources](public.file_sources.md) | Reference to source file (for file-loaded nodes) |
|
|
23
|
+
| token_count | integer | | true | | | Number of tokens in the content (for context budget management) |
|
|
24
|
+
| updated_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this memory was last modified |
|
|
23
25
|
|
|
24
26
|
## Constraints
|
|
25
27
|
|
|
26
28
|
| Name | Type | Definition |
|
|
27
29
|
| ---- | ---- | ---------- |
|
|
28
30
|
| check_embedding_dimension | CHECK | CHECK (((embedding_dimension IS NULL) OR ((embedding_dimension > 0) AND (embedding_dimension <= 2000)))) |
|
|
29
|
-
|
|
|
31
|
+
| fk_rails_920ad16d08 | FOREIGN KEY | FOREIGN KEY (source_id) REFERENCES file_sources(id) ON DELETE SET NULL |
|
|
30
32
|
| nodes_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
31
33
|
|
|
32
34
|
## Indexes
|
|
33
35
|
|
|
34
36
|
| Name | Definition |
|
|
35
37
|
| ---- | ---------- |
|
|
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
38
|
| 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
39
|
| idx_nodes_content_gin | CREATE INDEX idx_nodes_content_gin ON public.nodes USING gin (to_tsvector('english'::regconfig, content)) |
|
|
40
|
+
| idx_nodes_content_hash_unique | CREATE UNIQUE INDEX idx_nodes_content_hash_unique ON public.nodes USING btree (content_hash) |
|
|
46
41
|
| idx_nodes_content_trgm | CREATE INDEX idx_nodes_content_trgm ON public.nodes USING gin (content gin_trgm_ops) |
|
|
42
|
+
| idx_nodes_created_at | CREATE INDEX idx_nodes_created_at ON public.nodes USING btree (created_at) |
|
|
43
|
+
| idx_nodes_deleted_at | CREATE INDEX idx_nodes_deleted_at ON public.nodes USING btree (deleted_at) |
|
|
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_last_accessed | CREATE INDEX idx_nodes_last_accessed ON public.nodes USING btree (last_accessed) |
|
|
46
|
+
| idx_nodes_metadata | CREATE INDEX idx_nodes_metadata ON public.nodes USING gin (metadata) |
|
|
47
|
+
| idx_nodes_not_deleted_created_at | CREATE INDEX idx_nodes_not_deleted_created_at ON public.nodes USING btree (created_at) WHERE (deleted_at IS NULL) |
|
|
48
|
+
| idx_nodes_source_chunk_position | CREATE INDEX idx_nodes_source_chunk_position ON public.nodes USING btree (source_id, chunk_position) |
|
|
49
|
+
| idx_nodes_source_id | CREATE INDEX idx_nodes_source_id ON public.nodes USING btree (source_id) |
|
|
50
|
+
| idx_nodes_updated_at | CREATE INDEX idx_nodes_updated_at ON public.nodes USING btree (updated_at) |
|
|
51
|
+
| nodes_pkey | CREATE UNIQUE INDEX nodes_pkey ON public.nodes USING btree (id) |
|
|
47
52
|
|
|
48
53
|
## Relations
|
|
49
54
|
|
|
@@ -0,0 +1,271 @@
|
|
|
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="2106pt" height="1469pt"
|
|
8
|
+
viewBox="0.00 0.00 2105.90 1468.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 1464.8)">
|
|
10
|
+
<title>public.nodes</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-1464.8 2101.9,-1464.8 2101.9,4 -4,4"/>
|
|
12
|
+
<!-- public.nodes -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>public.nodes</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="755.49,-923 755.49,-969 1411.53,-969 1411.53,-923 755.49,-923"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="755.49,-923 755.49,-969 1411.53,-969 1411.53,-923 755.49,-923"/>
|
|
17
|
+
<text text-anchor="start" x="975.53" y="-946.8" font-family="Arial Bold" font-size="18.00">public.nodes</text>
|
|
18
|
+
<text text-anchor="start" x="1067.01" y="-946.8" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="1098.13" y="-946.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
20
|
+
<text text-anchor="start" x="892.09" y="-932.4" font-family="Arial" font-size="14.00" fill="#333333">Core memory storage for conversation messages and context</text>
|
|
21
|
+
<polygon fill="none" stroke="black" points="755.49,-892.2 755.49,-923 1411.53,-923 1411.53,-892.2 755.49,-892.2"/>
|
|
22
|
+
<text text-anchor="start" x="762.49" y="-904.4" font-family="Arial" font-size="14.00">access_count </text>
|
|
23
|
+
<text text-anchor="start" x="851.99" y="-904.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
24
|
+
<text text-anchor="start" x="902.58" y="-904.4" font-family="Arial" font-size="14.00"> Number of times this node has been accessed/retrieved</text>
|
|
25
|
+
<polygon fill="none" stroke="black" points="755.49,-861.4 755.49,-892.2 1411.53,-892.2 1411.53,-861.4 755.49,-861.4"/>
|
|
26
|
+
<text text-anchor="start" x="762.49" y="-873.6" font-family="Arial" font-size="14.00">chunk_position </text>
|
|
27
|
+
<text text-anchor="start" x="859.78" y="-873.6" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
28
|
+
<text text-anchor="start" x="910.37" y="-873.6" font-family="Arial" font-size="14.00"> Position within source file (0-indexed)</text>
|
|
29
|
+
<polygon fill="none" stroke="black" points="755.49,-830.6 755.49,-861.4 1411.53,-861.4 1411.53,-830.6 755.49,-830.6"/>
|
|
30
|
+
<text text-anchor="start" x="762.49" y="-842.8" font-family="Arial" font-size="14.00">content </text>
|
|
31
|
+
<text text-anchor="start" x="812.31" y="-842.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
32
|
+
<text text-anchor="start" x="842.65" y="-842.8" font-family="Arial" font-size="14.00"> The conversation message/utterance content</text>
|
|
33
|
+
<polygon fill="none" stroke="black" points="755.49,-799.8 755.49,-830.6 1411.53,-830.6 1411.53,-799.8 755.49,-799.8"/>
|
|
34
|
+
<text text-anchor="start" x="762.49" y="-812" font-family="Arial" font-size="14.00">content_hash </text>
|
|
35
|
+
<text text-anchor="start" x="850.45" y="-812" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
|
|
36
|
+
<text text-anchor="start" x="929.81" y="-812" font-family="Arial" font-size="14.00"> SHA-256 hash of content for deduplication</text>
|
|
37
|
+
<polygon fill="none" stroke="black" points="755.49,-769 755.49,-799.8 1411.53,-799.8 1411.53,-769 755.49,-769"/>
|
|
38
|
+
<text text-anchor="start" x="762.49" y="-781.2" font-family="Arial" font-size="14.00">created_at </text>
|
|
39
|
+
<text text-anchor="start" x="832.54" y="-781.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
40
|
+
<text text-anchor="start" x="998.26" y="-781.2" font-family="Arial" font-size="14.00"> When this memory was created</text>
|
|
41
|
+
<polygon fill="none" stroke="black" points="755.49,-738.2 755.49,-769 1411.53,-769 1411.53,-738.2 755.49,-738.2"/>
|
|
42
|
+
<text text-anchor="start" x="762.49" y="-750.4" font-family="Arial" font-size="14.00">deleted_at </text>
|
|
43
|
+
<text text-anchor="start" x="831.78" y="-750.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
44
|
+
<text text-anchor="start" x="997.5" y="-750.4" font-family="Arial" font-size="14.00"> Soft delete timestamp - node is considered deleted when set</text>
|
|
45
|
+
<polygon fill="none" stroke="black" points="755.49,-707.4 755.49,-738.2 1411.53,-738.2 1411.53,-707.4 755.49,-707.4"/>
|
|
46
|
+
<text text-anchor="start" x="762.49" y="-719.6" font-family="Arial" font-size="14.00">embedding </text>
|
|
47
|
+
<text text-anchor="start" x="835.66" y="-719.6" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
|
|
48
|
+
<text text-anchor="start" x="922.03" y="-719.6" font-family="Arial" font-size="14.00"> Vector embedding (max 2000 dimensions) for semantic search</text>
|
|
49
|
+
<polygon fill="none" stroke="black" points="755.49,-676.6 755.49,-707.4 1411.53,-707.4 1411.53,-676.6 755.49,-676.6"/>
|
|
50
|
+
<text text-anchor="start" x="762.49" y="-688.8" font-family="Arial" font-size="14.00">embedding_dimension </text>
|
|
51
|
+
<text text-anchor="start" x="907.26" y="-688.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
52
|
+
<text text-anchor="start" x="957.84" y="-688.8" font-family="Arial" font-size="14.00"> Actual number of dimensions used in the embedding vector (max 2000)</text>
|
|
53
|
+
<polygon fill="none" stroke="black" points="755.49,-645.8 755.49,-676.6 1411.53,-676.6 1411.53,-645.8 755.49,-645.8"/>
|
|
54
|
+
<text text-anchor="start" x="762.49" y="-658" font-family="Arial" font-size="14.00">id </text>
|
|
55
|
+
<text text-anchor="start" x="777.28" y="-658" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
56
|
+
<polygon fill="none" stroke="black" points="755.49,-615 755.49,-645.8 1411.53,-645.8 1411.53,-615 755.49,-615"/>
|
|
57
|
+
<text text-anchor="start" x="762.49" y="-627.2" font-family="Arial" font-size="14.00">last_accessed </text>
|
|
58
|
+
<text text-anchor="start" x="855.1" y="-627.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
59
|
+
<text text-anchor="start" x="1020.82" y="-627.2" font-family="Arial" font-size="14.00"> When this memory was last accessed</text>
|
|
60
|
+
<polygon fill="none" stroke="black" points="755.49,-584.2 755.49,-615 1411.53,-615 1411.53,-584.2 755.49,-584.2"/>
|
|
61
|
+
<text text-anchor="start" x="762.49" y="-596.4" font-family="Arial" font-size="14.00">metadata </text>
|
|
62
|
+
<text text-anchor="start" x="824.76" y="-596.4" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
|
|
63
|
+
<text text-anchor="start" x="866" y="-596.4" font-family="Arial" font-size="14.00"> Flexible metadata storage (memory_type, importance, source, etc.)</text>
|
|
64
|
+
<polygon fill="none" stroke="black" points="755.49,-553.4 755.49,-584.2 1411.53,-584.2 1411.53,-553.4 755.49,-553.4"/>
|
|
65
|
+
<text text-anchor="start" x="762.49" y="-565.6" font-family="Arial" font-size="14.00">source_id </text>
|
|
66
|
+
<text text-anchor="start" x="827.09" y="-565.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
67
|
+
<text text-anchor="start" x="868.33" y="-565.6" font-family="Arial" font-size="14.00"> Reference to source file (for file-loaded nodes)</text>
|
|
68
|
+
<polygon fill="none" stroke="black" points="755.49,-522.6 755.49,-553.4 1411.53,-553.4 1411.53,-522.6 755.49,-522.6"/>
|
|
69
|
+
<text text-anchor="start" x="762.49" y="-534.8" font-family="Arial" font-size="14.00">token_count </text>
|
|
70
|
+
<text text-anchor="start" x="842.67" y="-534.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
71
|
+
<text text-anchor="start" x="893.25" y="-534.8" font-family="Arial" font-size="14.00"> Number of tokens in the content (for context budget management)</text>
|
|
72
|
+
<polygon fill="none" stroke="black" points="755.49,-491.8 755.49,-522.6 1411.53,-522.6 1411.53,-491.8 755.49,-491.8"/>
|
|
73
|
+
<text text-anchor="start" x="762.49" y="-504" font-family="Arial" font-size="14.00">updated_at </text>
|
|
74
|
+
<text text-anchor="start" x="836.45" y="-504" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
75
|
+
<text text-anchor="start" x="1002.18" y="-504" font-family="Arial" font-size="14.00"> When this memory was last modified</text>
|
|
76
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="753.99,-490.3 753.99,-970.5 1413.03,-970.5 1413.03,-490.3 753.99,-490.3"/>
|
|
77
|
+
</g>
|
|
78
|
+
<!-- public.file_sources -->
|
|
79
|
+
<g id="node6" class="node">
|
|
80
|
+
<title>public.file_sources</title>
|
|
81
|
+
<polygon fill="#efefef" stroke="none" points="837.64,-320.4 837.64,-366.4 1329.38,-366.4 1329.38,-320.4 837.64,-320.4"/>
|
|
82
|
+
<polygon fill="none" stroke="black" points="837.64,-320.4 837.64,-366.4 1329.38,-366.4 1329.38,-320.4 837.64,-320.4"/>
|
|
83
|
+
<text text-anchor="start" x="953.04" y="-344.2" font-family="Arial Bold" font-size="18.00">public.file_sources</text>
|
|
84
|
+
<text text-anchor="start" x="1089.5" y="-344.2" font-family="Arial" font-size="14.00"> </text>
|
|
85
|
+
<text text-anchor="start" x="1120.61" y="-344.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
86
|
+
<text text-anchor="start" x="950.04" y="-329.8" font-family="Arial" font-size="14.00" fill="#333333">Source file metadata for loaded documents</text>
|
|
87
|
+
<polygon fill="none" stroke="black" points="837.64,-289.6 837.64,-320.4 1329.38,-320.4 1329.38,-289.6 837.64,-289.6"/>
|
|
88
|
+
<text text-anchor="start" x="844.64" y="-301.8" font-family="Arial" font-size="14.00">created_at </text>
|
|
89
|
+
<text text-anchor="start" x="914.69" y="-301.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
90
|
+
<polygon fill="none" stroke="black" points="837.64,-258.8 837.64,-289.6 1329.38,-289.6 1329.38,-258.8 837.64,-258.8"/>
|
|
91
|
+
<text text-anchor="start" x="844.64" y="-271" font-family="Arial" font-size="14.00">file_hash </text>
|
|
92
|
+
<text text-anchor="start" x="904.57" y="-271" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
|
|
93
|
+
<text text-anchor="start" x="983.93" y="-271" font-family="Arial" font-size="14.00"> SHA-256 hash of file content</text>
|
|
94
|
+
<polygon fill="none" stroke="black" points="837.64,-228 837.64,-258.8 1329.38,-258.8 1329.38,-228 837.64,-228"/>
|
|
95
|
+
<text text-anchor="start" x="844.64" y="-240.2" font-family="Arial" font-size="14.00">file_path </text>
|
|
96
|
+
<text text-anchor="start" x="901.46" y="-240.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
97
|
+
<text text-anchor="start" x="931.81" y="-240.2" font-family="Arial" font-size="14.00"> Absolute path to source file</text>
|
|
98
|
+
<polygon fill="none" stroke="black" points="837.64,-197.2 837.64,-228 1329.38,-228 1329.38,-197.2 837.64,-197.2"/>
|
|
99
|
+
<text text-anchor="start" x="844.64" y="-209.4" font-family="Arial" font-size="14.00">file_size </text>
|
|
100
|
+
<text text-anchor="start" x="899.11" y="-209.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
101
|
+
<text text-anchor="start" x="949.7" y="-209.4" font-family="Arial" font-size="14.00"> File size in bytes</text>
|
|
102
|
+
<polygon fill="none" stroke="black" points="837.64,-166.4 837.64,-197.2 1329.38,-197.2 1329.38,-166.4 837.64,-166.4"/>
|
|
103
|
+
<text text-anchor="start" x="844.64" y="-178.6" font-family="Arial" font-size="14.00">frontmatter </text>
|
|
104
|
+
<text text-anchor="start" x="916.22" y="-178.6" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
|
|
105
|
+
<text text-anchor="start" x="957.47" y="-178.6" font-family="Arial" font-size="14.00"> Parsed YAML frontmatter</text>
|
|
106
|
+
<polygon fill="none" stroke="black" points="837.64,-135.6 837.64,-166.4 1329.38,-166.4 1329.38,-135.6 837.64,-135.6"/>
|
|
107
|
+
<text text-anchor="start" x="844.64" y="-147.8" font-family="Arial" font-size="14.00">id </text>
|
|
108
|
+
<text text-anchor="start" x="859.43" y="-147.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
109
|
+
<polygon fill="none" stroke="black" points="837.64,-104.8 837.64,-135.6 1329.38,-135.6 1329.38,-104.8 837.64,-104.8"/>
|
|
110
|
+
<text text-anchor="start" x="844.64" y="-117" font-family="Arial" font-size="14.00">last_synced_at </text>
|
|
111
|
+
<text text-anchor="start" x="941.92" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
112
|
+
<text text-anchor="start" x="1107.65" y="-117" font-family="Arial" font-size="14.00"> When file was last synced to HTM</text>
|
|
113
|
+
<polygon fill="none" stroke="black" points="837.64,-74 837.64,-104.8 1329.38,-104.8 1329.38,-74 837.64,-74"/>
|
|
114
|
+
<text text-anchor="start" x="844.64" y="-86.2" font-family="Arial" font-size="14.00">mtime </text>
|
|
115
|
+
<text text-anchor="start" x="886.64" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
116
|
+
<text text-anchor="start" x="1052.36" y="-86.2" font-family="Arial" font-size="14.00"> File modification time</text>
|
|
117
|
+
<polygon fill="none" stroke="black" points="837.64,-43.2 837.64,-74 1329.38,-74 1329.38,-43.2 837.64,-43.2"/>
|
|
118
|
+
<text text-anchor="start" x="844.64" y="-55.4" font-family="Arial" font-size="14.00">updated_at </text>
|
|
119
|
+
<text text-anchor="start" x="918.6" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
120
|
+
</g>
|
|
121
|
+
<!-- public.nodes->public.file_sources -->
|
|
122
|
+
<g id="edge5" class="edge">
|
|
123
|
+
<title>public.nodes:source_id->public.file_sources:id</title>
|
|
124
|
+
<path fill="none" stroke="black" d="M1422.34,-567.12C1501.04,-538.37 1421.49,-151 1330.38,-151"/>
|
|
125
|
+
<polygon fill="black" stroke="black" points="1422.72,-567.05 1412.1,-564.31 1417.46,-567.95 1413.19,-568.69 1413.19,-568.69 1413.19,-568.69 1417.46,-567.95 1413.62,-573.18 1422.72,-567.05"/>
|
|
126
|
+
<text text-anchor="start" x="1419.53" y="-578.8" font-family="Arial" font-size="10.00">FOREIGN KEY (source_id) REFERENCES file_sources(id) ON DELETE SET NULL</text>
|
|
127
|
+
</g>
|
|
128
|
+
<!-- public.node_tags -->
|
|
129
|
+
<g id="node2" class="node">
|
|
130
|
+
<title>public.node_tags</title>
|
|
131
|
+
<polygon fill="#efefef" stroke="none" points="496.91,-1294.6 496.91,-1340.6 966.12,-1340.6 966.12,-1294.6 496.91,-1294.6"/>
|
|
132
|
+
<polygon fill="none" stroke="black" points="496.91,-1294.6 496.91,-1340.6 966.12,-1340.6 966.12,-1294.6 496.91,-1294.6"/>
|
|
133
|
+
<text text-anchor="start" x="608.03" y="-1318.4" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
|
|
134
|
+
<text text-anchor="start" x="730.51" y="-1318.4" font-family="Arial" font-size="14.00"> </text>
|
|
135
|
+
<text text-anchor="start" x="761.62" y="-1318.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
136
|
+
<text text-anchor="start" x="570.43" y="-1304" font-family="Arial" font-size="14.00" fill="#333333">Join table connecting nodes to tags (many-to-many)</text>
|
|
137
|
+
<polygon fill="none" stroke="black" points="496.91,-1263.8 496.91,-1294.6 966.12,-1294.6 966.12,-1263.8 496.91,-1263.8"/>
|
|
138
|
+
<text text-anchor="start" x="503.91" y="-1276" font-family="Arial" font-size="14.00">created_at </text>
|
|
139
|
+
<text text-anchor="start" x="573.95" y="-1276" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
140
|
+
<text text-anchor="start" x="739.68" y="-1276" font-family="Arial" font-size="14.00"> When this association was created</text>
|
|
141
|
+
<polygon fill="none" stroke="black" points="496.91,-1233 496.91,-1263.8 966.12,-1263.8 966.12,-1233 496.91,-1233"/>
|
|
142
|
+
<text text-anchor="start" x="503.91" y="-1245.2" font-family="Arial" font-size="14.00">id </text>
|
|
143
|
+
<text text-anchor="start" x="518.69" y="-1245.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
144
|
+
<polygon fill="none" stroke="black" points="496.91,-1202.2 496.91,-1233 966.12,-1233 966.12,-1202.2 496.91,-1202.2"/>
|
|
145
|
+
<text text-anchor="start" x="503.91" y="-1214.4" font-family="Arial" font-size="14.00">node_id </text>
|
|
146
|
+
<text text-anchor="start" x="557.62" y="-1214.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
147
|
+
<text text-anchor="start" x="598.87" y="-1214.4" font-family="Arial" font-size="14.00"> ID of the node being tagged</text>
|
|
148
|
+
<polygon fill="none" stroke="black" points="496.91,-1171.4 496.91,-1202.2 966.12,-1202.2 966.12,-1171.4 496.91,-1171.4"/>
|
|
149
|
+
<text text-anchor="start" x="503.91" y="-1183.6" font-family="Arial" font-size="14.00">tag_id </text>
|
|
150
|
+
<text text-anchor="start" x="545.94" y="-1183.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
151
|
+
<text text-anchor="start" x="587.19" y="-1183.6" font-family="Arial" font-size="14.00"> ID of the tag being applied</text>
|
|
152
|
+
</g>
|
|
153
|
+
<!-- public.node_tags->public.nodes -->
|
|
154
|
+
<g id="edge1" class="edge">
|
|
155
|
+
<title>public.node_tags:node_id->public.nodes:id</title>
|
|
156
|
+
<path fill="none" stroke="black" d="M977.1,-1216.09C1002.92,-1206.98 984.7,-1158.86 966.12,-1128.2 911.07,-1037.35 810.17,-1106.28 755.49,-1015.2 715.01,-947.75 675.83,-661.2 754.49,-661.2"/>
|
|
157
|
+
<polygon fill="black" stroke="black" points="977.34,-1216.05 966.77,-1213.1 972.06,-1216.85 967.78,-1217.5 967.78,-1217.5 967.78,-1217.5 972.06,-1216.85 968.12,-1222 977.34,-1216.05"/>
|
|
158
|
+
<text text-anchor="start" x="974.12" y="-1227.6" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
|
|
159
|
+
</g>
|
|
160
|
+
<!-- public.tags -->
|
|
161
|
+
<g id="node3" class="node">
|
|
162
|
+
<title>public.tags</title>
|
|
163
|
+
<polygon fill="#efefef" stroke="none" points="43.2,-753.6 43.2,-799.6 647.83,-799.6 647.83,-753.6 43.2,-753.6"/>
|
|
164
|
+
<polygon fill="none" stroke="black" points="43.2,-753.6 43.2,-799.6 647.83,-799.6 647.83,-753.6 43.2,-753.6"/>
|
|
165
|
+
<text text-anchor="start" x="244.02" y="-777.4" font-family="Arial Bold" font-size="18.00">public.tags</text>
|
|
166
|
+
<text text-anchor="start" x="322.51" y="-777.4" font-family="Arial" font-size="14.00"> </text>
|
|
167
|
+
<text text-anchor="start" x="353.63" y="-777.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
168
|
+
<text text-anchor="start" x="233.06" y="-763" font-family="Arial" font-size="14.00" fill="#333333">Unique tag names for categorization</text>
|
|
169
|
+
<polygon fill="none" stroke="black" points="43.2,-722.8 43.2,-753.6 647.83,-753.6 647.83,-722.8 43.2,-722.8"/>
|
|
170
|
+
<text text-anchor="start" x="50.2" y="-735" font-family="Arial" font-size="14.00">created_at </text>
|
|
171
|
+
<text text-anchor="start" x="120.25" y="-735" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
172
|
+
<text text-anchor="start" x="285.97" y="-735" font-family="Arial" font-size="14.00"> When this tag was created</text>
|
|
173
|
+
<polygon fill="none" stroke="black" points="43.2,-692 43.2,-722.8 647.83,-722.8 647.83,-692 43.2,-692"/>
|
|
174
|
+
<text text-anchor="start" x="50.2" y="-704.2" font-family="Arial" font-size="14.00">id </text>
|
|
175
|
+
<text text-anchor="start" x="64.99" y="-704.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
176
|
+
<polygon fill="none" stroke="black" points="43.2,-661.2 43.2,-692 647.83,-692 647.83,-661.2 43.2,-661.2"/>
|
|
177
|
+
<text text-anchor="start" x="50.2" y="-673.4" font-family="Arial" font-size="14.00">name </text>
|
|
178
|
+
<text text-anchor="start" x="89.11" y="-673.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
179
|
+
<text text-anchor="start" x="119.45" y="-673.4" font-family="Arial" font-size="14.00"> Hierarchical tag in format: root:level1:level2 (e.g., database:postgresql:timescaledb)</text>
|
|
180
|
+
</g>
|
|
181
|
+
<!-- public.node_tags->public.tags -->
|
|
182
|
+
<g id="edge2" class="edge">
|
|
183
|
+
<title>public.node_tags:tag_id->public.tags:id</title>
|
|
184
|
+
<path fill="none" stroke="black" d="M485.73,-1186.43C291.39,-1171.48 868.87,-707.4 648.83,-707.4"/>
|
|
185
|
+
<polygon fill="black" stroke="black" points="485.58,-1186.42 495.41,-1191.28 490.91,-1186.62 495.24,-1186.78 495.24,-1186.78 495.24,-1186.78 490.91,-1186.62 495.74,-1182.29 485.58,-1186.42"/>
|
|
186
|
+
<text text-anchor="start" x="166.05" y="-1196.8" font-family="Arial" font-size="10.00">FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE</text>
|
|
187
|
+
</g>
|
|
188
|
+
<!-- public.robot_nodes -->
|
|
189
|
+
<g id="node4" class="node">
|
|
190
|
+
<title>public.robot_nodes</title>
|
|
191
|
+
<polygon fill="#efefef" stroke="none" points="1112.77,-1371.6 1112.77,-1417.6 1742.26,-1417.6 1742.26,-1371.6 1112.77,-1371.6"/>
|
|
192
|
+
<polygon fill="none" stroke="black" points="1112.77,-1371.6 1112.77,-1417.6 1742.26,-1417.6 1742.26,-1371.6 1112.77,-1371.6"/>
|
|
193
|
+
<text text-anchor="start" x="1296.03" y="-1395.4" font-family="Arial Bold" font-size="18.00">public.robot_nodes</text>
|
|
194
|
+
<text text-anchor="start" x="1434.51" y="-1395.4" font-family="Arial" font-size="14.00"> </text>
|
|
195
|
+
<text text-anchor="start" x="1465.63" y="-1395.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
196
|
+
<text text-anchor="start" x="1260.2" y="-1381" font-family="Arial" font-size="14.00" fill="#333333">Join table connecting robots to nodes (many-to-many)</text>
|
|
197
|
+
<polygon fill="none" stroke="black" points="1112.77,-1340.8 1112.77,-1371.6 1742.26,-1371.6 1742.26,-1340.8 1112.77,-1340.8"/>
|
|
198
|
+
<text text-anchor="start" x="1119.77" y="-1353" font-family="Arial" font-size="14.00">created_at </text>
|
|
199
|
+
<text text-anchor="start" x="1189.82" y="-1353" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
200
|
+
<polygon fill="none" stroke="black" points="1112.77,-1310 1112.77,-1340.8 1742.26,-1340.8 1742.26,-1310 1112.77,-1310"/>
|
|
201
|
+
<text text-anchor="start" x="1119.77" y="-1322.2" font-family="Arial" font-size="14.00">first_remembered_at </text>
|
|
202
|
+
<text text-anchor="start" x="1252.82" y="-1322.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
203
|
+
<text text-anchor="start" x="1418.55" y="-1322.2" font-family="Arial" font-size="14.00"> When this robot first remembered this content</text>
|
|
204
|
+
<polygon fill="none" stroke="black" points="1112.77,-1279.2 1112.77,-1310 1742.26,-1310 1742.26,-1279.2 1112.77,-1279.2"/>
|
|
205
|
+
<text text-anchor="start" x="1119.77" y="-1291.4" font-family="Arial" font-size="14.00">id </text>
|
|
206
|
+
<text text-anchor="start" x="1134.55" y="-1291.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
207
|
+
<polygon fill="none" stroke="black" points="1112.77,-1248.4 1112.77,-1279.2 1742.26,-1279.2 1742.26,-1248.4 1112.77,-1248.4"/>
|
|
208
|
+
<text text-anchor="start" x="1119.77" y="-1260.6" font-family="Arial" font-size="14.00">last_remembered_at </text>
|
|
209
|
+
<text text-anchor="start" x="1252.06" y="-1260.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
210
|
+
<text text-anchor="start" x="1417.78" y="-1260.6" font-family="Arial" font-size="14.00"> When this robot last tried to remember this content</text>
|
|
211
|
+
<polygon fill="none" stroke="black" points="1112.77,-1217.6 1112.77,-1248.4 1742.26,-1248.4 1742.26,-1217.6 1112.77,-1217.6"/>
|
|
212
|
+
<text text-anchor="start" x="1119.77" y="-1229.8" font-family="Arial" font-size="14.00">node_id </text>
|
|
213
|
+
<text text-anchor="start" x="1173.49" y="-1229.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
214
|
+
<text text-anchor="start" x="1214.73" y="-1229.8" font-family="Arial" font-size="14.00"> ID of the node being remembered</text>
|
|
215
|
+
<polygon fill="none" stroke="black" points="1112.77,-1186.8 1112.77,-1217.6 1742.26,-1217.6 1742.26,-1186.8 1112.77,-1186.8"/>
|
|
216
|
+
<text text-anchor="start" x="1119.77" y="-1199" font-family="Arial" font-size="14.00">remember_count </text>
|
|
217
|
+
<text text-anchor="start" x="1229.49" y="-1199" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
|
|
218
|
+
<text text-anchor="start" x="1280.07" y="-1199" font-family="Arial" font-size="14.00"> Number of times this robot has tried to remember this content</text>
|
|
219
|
+
<polygon fill="none" stroke="black" points="1112.77,-1156 1112.77,-1186.8 1742.26,-1186.8 1742.26,-1156 1112.77,-1156"/>
|
|
220
|
+
<text text-anchor="start" x="1119.77" y="-1168.2" font-family="Arial" font-size="14.00">robot_id </text>
|
|
221
|
+
<text text-anchor="start" x="1174.25" y="-1168.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
222
|
+
<text text-anchor="start" x="1215.5" y="-1168.2" font-family="Arial" font-size="14.00"> ID of the robot that remembered this node</text>
|
|
223
|
+
<polygon fill="none" stroke="black" points="1112.77,-1125.2 1112.77,-1156 1742.26,-1156 1742.26,-1125.2 1112.77,-1125.2"/>
|
|
224
|
+
<text text-anchor="start" x="1119.77" y="-1137.4" font-family="Arial" font-size="14.00">updated_at </text>
|
|
225
|
+
<text text-anchor="start" x="1193.73" y="-1137.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
226
|
+
<polygon fill="none" stroke="black" points="1112.77,-1094.4 1112.77,-1125.2 1742.26,-1125.2 1742.26,-1094.4 1112.77,-1094.4"/>
|
|
227
|
+
<text text-anchor="start" x="1119.77" y="-1106.6" font-family="Arial" font-size="14.00">working_memory </text>
|
|
228
|
+
<text text-anchor="start" x="1230.24" y="-1106.6" font-family="Arial" font-size="14.00" fill="#666666">[boolean]</text>
|
|
229
|
+
<text text-anchor="start" x="1287.85" y="-1106.6" font-family="Arial" font-size="14.00"> True if this node is currently in the robot working memory</text>
|
|
230
|
+
</g>
|
|
231
|
+
<!-- public.robot_nodes->public.nodes -->
|
|
232
|
+
<g id="edge3" class="edge">
|
|
233
|
+
<title>public.robot_nodes:node_id->public.nodes:id</title>
|
|
234
|
+
<path fill="none" stroke="black" d="M1101.53,-1232.28C1033.54,-1222.21 1061.41,-1108.8 1112.77,-1051.2 1201.78,-951.38 1322.66,-1115.14 1411.53,-1015.2 1463.81,-956.41 1491.2,-661.2 1412.53,-661.2"/>
|
|
235
|
+
<polygon fill="black" stroke="black" points="1101.46,-1232.28 1111.12,-1237.47 1106.78,-1232.65 1111.1,-1232.95 1111.1,-1232.95 1111.1,-1232.95 1106.78,-1232.65 1111.75,-1228.49 1101.46,-1232.28"/>
|
|
236
|
+
<text text-anchor="start" x="853.61" y="-1217" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
|
|
237
|
+
</g>
|
|
238
|
+
<!-- public.robots -->
|
|
239
|
+
<g id="node5" class="node">
|
|
240
|
+
<title>public.robots</title>
|
|
241
|
+
<polygon fill="#efefef" stroke="none" points="1519.41,-769 1519.41,-815 2023.62,-815 2023.62,-769 1519.41,-769"/>
|
|
242
|
+
<polygon fill="none" stroke="black" points="1519.41,-769 1519.41,-815 2023.62,-815 2023.62,-769 1519.41,-769"/>
|
|
243
|
+
<text text-anchor="start" x="1662.02" y="-792.8" font-family="Arial Bold" font-size="18.00">public.robots</text>
|
|
244
|
+
<text text-anchor="start" x="1756.51" y="-792.8" font-family="Arial" font-size="14.00"> </text>
|
|
245
|
+
<text text-anchor="start" x="1787.63" y="-792.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
|
|
246
|
+
<text text-anchor="start" x="1620.57" y="-778.4" font-family="Arial" font-size="14.00" fill="#333333">Registry of all LLM robots using the HTM system</text>
|
|
247
|
+
<polygon fill="none" stroke="black" points="1519.41,-738.2 1519.41,-769 2023.62,-769 2023.62,-738.2 1519.41,-738.2"/>
|
|
248
|
+
<text text-anchor="start" x="1526.41" y="-750.4" font-family="Arial" font-size="14.00">created_at </text>
|
|
249
|
+
<text text-anchor="start" x="1596.45" y="-750.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
250
|
+
<text text-anchor="start" x="1762.18" y="-750.4" font-family="Arial" font-size="14.00"> When the robot was first registered</text>
|
|
251
|
+
<polygon fill="none" stroke="black" points="1519.41,-707.4 1519.41,-738.2 2023.62,-738.2 2023.62,-707.4 1519.41,-707.4"/>
|
|
252
|
+
<text text-anchor="start" x="1526.41" y="-719.6" font-family="Arial" font-size="14.00">id </text>
|
|
253
|
+
<text text-anchor="start" x="1541.19" y="-719.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
|
|
254
|
+
<polygon fill="none" stroke="black" points="1519.41,-676.6 1519.41,-707.4 2023.62,-707.4 2023.62,-676.6 1519.41,-676.6"/>
|
|
255
|
+
<text text-anchor="start" x="1526.41" y="-688.8" font-family="Arial" font-size="14.00">last_active </text>
|
|
256
|
+
<text text-anchor="start" x="1596.44" y="-688.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
|
|
257
|
+
<text text-anchor="start" x="1762.16" y="-688.8" font-family="Arial" font-size="14.00"> Last time the robot accessed the system</text>
|
|
258
|
+
<polygon fill="none" stroke="black" points="1519.41,-645.8 1519.41,-676.6 2023.62,-676.6 2023.62,-645.8 1519.41,-645.8"/>
|
|
259
|
+
<text text-anchor="start" x="1526.41" y="-658" font-family="Arial" font-size="14.00">name </text>
|
|
260
|
+
<text text-anchor="start" x="1565.32" y="-658" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
|
|
261
|
+
<text text-anchor="start" x="1595.66" y="-658" font-family="Arial" font-size="14.00"> Human-readable name for the robot</text>
|
|
262
|
+
</g>
|
|
263
|
+
<!-- public.robot_nodes->public.robots -->
|
|
264
|
+
<g id="edge4" class="edge">
|
|
265
|
+
<title>public.robot_nodes:robot_id->public.robots:id</title>
|
|
266
|
+
<path fill="none" stroke="black" d="M1753.29,-1170.37C1792.22,-1161.43 1763.08,-1096.29 1742.26,-1051.2 1687.32,-932.25 1574.29,-977.18 1519.41,-858.2 1494.2,-803.55 1458.23,-722.8 1518.41,-722.8"/>
|
|
267
|
+
<polygon fill="black" stroke="black" points="1753.54,-1170.34 1743.13,-1166.89 1748.23,-1170.89 1743.92,-1171.33 1743.92,-1171.33 1743.92,-1171.33 1748.23,-1170.89 1744.05,-1175.84 1753.54,-1170.34"/>
|
|
268
|
+
<text text-anchor="start" x="1750.26" y="-1181.4" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
|
|
269
|
+
</g>
|
|
270
|
+
</g>
|
|
271
|
+
</svg>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# public.robot_nodes
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Join table connecting robots to nodes (many-to-many)
|
|
6
|
+
|
|
7
|
+
## Columns
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
10
|
+
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
|
11
|
+
| created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
|
|
12
|
+
| first_remembered_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this robot first remembered this content |
|
|
13
|
+
| id | bigint | nextval('robot_nodes_id_seq'::regclass) | false | | | |
|
|
14
|
+
| last_remembered_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this robot last tried to remember this content |
|
|
15
|
+
| node_id | bigint | | false | | [public.nodes](public.nodes.md) | ID of the node being remembered |
|
|
16
|
+
| remember_count | integer | 1 | false | | | Number of times this robot has tried to remember this content |
|
|
17
|
+
| robot_id | bigint | | false | | [public.robots](public.robots.md) | ID of the robot that remembered this node |
|
|
18
|
+
| updated_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
|
|
19
|
+
| working_memory | boolean | false | false | | | True if this node is currently in the robot working memory |
|
|
20
|
+
|
|
21
|
+
## Constraints
|
|
22
|
+
|
|
23
|
+
| Name | Type | Definition |
|
|
24
|
+
| ---- | ---- | ---------- |
|
|
25
|
+
| fk_rails_9b003078a8 | FOREIGN KEY | FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE |
|
|
26
|
+
| fk_rails_f2fc98d49e | FOREIGN KEY | FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE |
|
|
27
|
+
| robot_nodes_pkey | PRIMARY KEY | PRIMARY KEY (id) |
|
|
28
|
+
|
|
29
|
+
## Indexes
|
|
30
|
+
|
|
31
|
+
| Name | Definition |
|
|
32
|
+
| ---- | ---------- |
|
|
33
|
+
| idx_robot_nodes_last_remembered_at | CREATE INDEX idx_robot_nodes_last_remembered_at ON public.robot_nodes USING btree (last_remembered_at) |
|
|
34
|
+
| idx_robot_nodes_node_id | CREATE INDEX idx_robot_nodes_node_id ON public.robot_nodes USING btree (node_id) |
|
|
35
|
+
| idx_robot_nodes_robot_id | CREATE INDEX idx_robot_nodes_robot_id ON public.robot_nodes USING btree (robot_id) |
|
|
36
|
+
| idx_robot_nodes_unique | CREATE UNIQUE INDEX idx_robot_nodes_unique ON public.robot_nodes USING btree (robot_id, node_id) |
|
|
37
|
+
| idx_robot_nodes_working_memory | CREATE INDEX idx_robot_nodes_working_memory ON public.robot_nodes USING btree (robot_id, working_memory) WHERE (working_memory = true) |
|
|
38
|
+
| robot_nodes_pkey | CREATE UNIQUE INDEX robot_nodes_pkey ON public.robot_nodes USING btree (id) |
|
|
39
|
+
|
|
40
|
+
## Relations
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|