htm 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.architecture/decisions/adrs/001-use-postgresql-timescaledb-storage.md +227 -0
- data/.architecture/decisions/adrs/002-two-tier-memory-architecture.md +322 -0
- data/.architecture/decisions/adrs/003-ollama-default-embedding-provider.md +339 -0
- data/.architecture/decisions/adrs/004-multi-robot-shared-memory-hive-mind.md +374 -0
- data/.architecture/decisions/adrs/005-rag-based-retrieval-with-hybrid-search.md +443 -0
- data/.architecture/decisions/adrs/006-context-assembly-strategies.md +444 -0
- data/.architecture/decisions/adrs/007-working-memory-eviction-strategy.md +461 -0
- data/.architecture/decisions/adrs/008-robot-identification-system.md +550 -0
- data/.architecture/decisions/adrs/009-never-forget-explicit-deletion-only.md +570 -0
- data/.architecture/decisions/adrs/010-redis-working-memory-rejected.md +323 -0
- data/.architecture/decisions/adrs/011-database-side-embedding-generation-with-pgai.md +585 -0
- data/.architecture/decisions/adrs/012-llm-driven-ontology-topic-extraction.md +583 -0
- data/.architecture/decisions/adrs/013-activerecord-orm-and-many-to-many-tagging.md +299 -0
- data/.architecture/decisions/adrs/014-client-side-embedding-generation-workflow.md +569 -0
- data/.architecture/decisions/adrs/015-hierarchical-tag-ontology-and-llm-extraction.md +701 -0
- data/.architecture/decisions/adrs/016-async-embedding-and-tag-generation.md +694 -0
- data/.architecture/members.yml +144 -0
- data/.architecture/reviews/2025-10-29-llm-configuration-and-async-processing-review.md +1137 -0
- data/.architecture/reviews/initial-system-analysis.md +330 -0
- data/.envrc +32 -0
- data/.irbrc +145 -0
- data/CHANGELOG.md +150 -0
- data/COMMITS.md +196 -0
- data/LICENSE +21 -0
- data/README.md +1347 -0
- data/Rakefile +51 -0
- data/SETUP.md +268 -0
- data/config/database.yml +67 -0
- data/db/migrate/20250101000001_enable_extensions.rb +14 -0
- data/db/migrate/20250101000002_create_robots.rb +14 -0
- data/db/migrate/20250101000003_create_nodes.rb +42 -0
- data/db/migrate/20250101000005_create_tags.rb +38 -0
- data/db/migrate/20250101000007_add_node_vector_indexes.rb +30 -0
- data/db/schema.sql +473 -0
- data/db/seed_data/README.md +100 -0
- data/db/seed_data/presidents.md +136 -0
- data/db/seed_data/states.md +151 -0
- data/db/seeds.rb +208 -0
- data/dbdoc/README.md +173 -0
- data/dbdoc/public.node_stats.md +48 -0
- data/dbdoc/public.node_stats.svg +41 -0
- data/dbdoc/public.node_tags.md +40 -0
- data/dbdoc/public.node_tags.svg +112 -0
- data/dbdoc/public.nodes.md +54 -0
- data/dbdoc/public.nodes.svg +118 -0
- data/dbdoc/public.nodes_tags.md +39 -0
- data/dbdoc/public.nodes_tags.svg +112 -0
- data/dbdoc/public.ontology_structure.md +48 -0
- data/dbdoc/public.ontology_structure.svg +38 -0
- data/dbdoc/public.operations_log.md +42 -0
- data/dbdoc/public.operations_log.svg +130 -0
- data/dbdoc/public.relationships.md +39 -0
- data/dbdoc/public.relationships.svg +41 -0
- data/dbdoc/public.robot_activity.md +46 -0
- data/dbdoc/public.robot_activity.svg +35 -0
- data/dbdoc/public.robots.md +35 -0
- data/dbdoc/public.robots.svg +90 -0
- data/dbdoc/public.schema_migrations.md +29 -0
- data/dbdoc/public.schema_migrations.svg +26 -0
- data/dbdoc/public.tags.md +35 -0
- data/dbdoc/public.tags.svg +60 -0
- data/dbdoc/public.topic_relationships.md +45 -0
- data/dbdoc/public.topic_relationships.svg +32 -0
- data/dbdoc/schema.json +1437 -0
- data/dbdoc/schema.svg +154 -0
- data/docs/api/database.md +806 -0
- data/docs/api/embedding-service.md +532 -0
- data/docs/api/htm.md +797 -0
- data/docs/api/index.md +259 -0
- data/docs/api/long-term-memory.md +1096 -0
- data/docs/api/working-memory.md +665 -0
- data/docs/architecture/adrs/001-postgresql-timescaledb.md +314 -0
- data/docs/architecture/adrs/002-two-tier-memory.md +411 -0
- data/docs/architecture/adrs/003-ollama-embeddings.md +421 -0
- data/docs/architecture/adrs/004-hive-mind.md +437 -0
- data/docs/architecture/adrs/005-rag-retrieval.md +531 -0
- data/docs/architecture/adrs/006-context-assembly.md +496 -0
- data/docs/architecture/adrs/007-eviction-strategy.md +645 -0
- data/docs/architecture/adrs/008-robot-identification.md +625 -0
- data/docs/architecture/adrs/009-never-forget.md +648 -0
- data/docs/architecture/adrs/010-redis-working-memory-rejected.md +323 -0
- data/docs/architecture/adrs/011-pgai-integration.md +494 -0
- data/docs/architecture/adrs/index.md +215 -0
- data/docs/architecture/hive-mind.md +736 -0
- data/docs/architecture/index.md +351 -0
- data/docs/architecture/overview.md +538 -0
- data/docs/architecture/two-tier-memory.md +873 -0
- data/docs/assets/css/custom.css +83 -0
- data/docs/assets/images/htm-core-components.svg +63 -0
- data/docs/assets/images/htm-database-schema.svg +93 -0
- data/docs/assets/images/htm-hive-mind-architecture.svg +125 -0
- data/docs/assets/images/htm-importance-scoring-framework.svg +83 -0
- data/docs/assets/images/htm-layered-architecture.svg +71 -0
- data/docs/assets/images/htm-long-term-memory-architecture.svg +115 -0
- data/docs/assets/images/htm-working-memory-architecture.svg +120 -0
- data/docs/assets/images/htm.jpg +0 -0
- data/docs/assets/images/htm_demo.gif +0 -0
- data/docs/assets/js/mathjax.js +18 -0
- data/docs/assets/videos/htm_video.mp4 +0 -0
- data/docs/database_rake_tasks.md +322 -0
- data/docs/development/contributing.md +787 -0
- data/docs/development/index.md +336 -0
- data/docs/development/schema.md +596 -0
- data/docs/development/setup.md +719 -0
- data/docs/development/testing.md +819 -0
- data/docs/guides/adding-memories.md +824 -0
- data/docs/guides/context-assembly.md +1009 -0
- data/docs/guides/getting-started.md +577 -0
- data/docs/guides/index.md +118 -0
- data/docs/guides/long-term-memory.md +941 -0
- data/docs/guides/multi-robot.md +866 -0
- data/docs/guides/recalling-memories.md +927 -0
- data/docs/guides/search-strategies.md +953 -0
- data/docs/guides/working-memory.md +717 -0
- data/docs/index.md +214 -0
- data/docs/installation.md +477 -0
- data/docs/multi_framework_support.md +519 -0
- data/docs/quick-start.md +655 -0
- data/docs/setup_local_database.md +302 -0
- data/docs/using_rake_tasks_in_your_app.md +383 -0
- data/examples/basic_usage.rb +93 -0
- data/examples/cli_app/README.md +317 -0
- data/examples/cli_app/htm_cli.rb +270 -0
- data/examples/custom_llm_configuration.rb +183 -0
- data/examples/example_app/Rakefile +71 -0
- data/examples/example_app/app.rb +206 -0
- data/examples/sinatra_app/Gemfile +21 -0
- data/examples/sinatra_app/app.rb +335 -0
- data/lib/htm/active_record_config.rb +113 -0
- data/lib/htm/configuration.rb +342 -0
- data/lib/htm/database.rb +594 -0
- data/lib/htm/embedding_service.rb +115 -0
- data/lib/htm/errors.rb +34 -0
- data/lib/htm/job_adapter.rb +154 -0
- data/lib/htm/jobs/generate_embedding_job.rb +65 -0
- data/lib/htm/jobs/generate_tags_job.rb +82 -0
- data/lib/htm/long_term_memory.rb +965 -0
- data/lib/htm/models/node.rb +109 -0
- data/lib/htm/models/node_tag.rb +33 -0
- data/lib/htm/models/robot.rb +52 -0
- data/lib/htm/models/tag.rb +76 -0
- data/lib/htm/railtie.rb +76 -0
- data/lib/htm/sinatra.rb +157 -0
- data/lib/htm/tag_service.rb +135 -0
- data/lib/htm/tasks.rb +38 -0
- data/lib/htm/version.rb +5 -0
- data/lib/htm/working_memory.rb +182 -0
- data/lib/htm.rb +400 -0
- data/lib/tasks/db.rake +19 -0
- data/lib/tasks/htm.rake +147 -0
- data/lib/tasks/jobs.rake +312 -0
- data/mkdocs.yml +190 -0
- data/scripts/install_local_database.sh +309 -0
- metadata +341 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* Custom CSS for HTM Documentation */
|
|
2
|
+
|
|
3
|
+
/* Code blocks - enhance readability */
|
|
4
|
+
.highlight pre {
|
|
5
|
+
border-left: 3px solid var(--md-primary-fg-color);
|
|
6
|
+
padding-left: 1em;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Admonitions - adjust spacing */
|
|
10
|
+
.admonition {
|
|
11
|
+
margin: 1.5em 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Tables - improve mobile responsiveness */
|
|
15
|
+
.md-typeset table:not([class]) {
|
|
16
|
+
display: block;
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
overflow-x: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Code inline - subtle background */
|
|
22
|
+
.md-typeset code {
|
|
23
|
+
background-color: var(--md-code-bg-color);
|
|
24
|
+
padding: 0.1em 0.3em;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Navigation improvements */
|
|
28
|
+
.md-nav__item--active > .md-nav__link {
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Search results */
|
|
33
|
+
.md-search-result__article {
|
|
34
|
+
padding: 0.5rem 0.8rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Improve link visibility in dark mode */
|
|
38
|
+
[data-md-color-scheme="slate"] a {
|
|
39
|
+
text-decoration-color: var(--md-accent-fg-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Custom styling for API reference sections */
|
|
43
|
+
.api-signature {
|
|
44
|
+
background-color: var(--md-code-bg-color);
|
|
45
|
+
padding: 1em;
|
|
46
|
+
border-radius: 0.2em;
|
|
47
|
+
font-family: var(--md-code-font-family);
|
|
48
|
+
margin: 1em 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Architecture decision badges */
|
|
52
|
+
.adr-status {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
padding: 0.2em 0.6em;
|
|
55
|
+
border-radius: 0.3em;
|
|
56
|
+
font-size: 0.85em;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
margin-left: 0.5em;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.adr-status.accepted {
|
|
62
|
+
background-color: #28a745;
|
|
63
|
+
color: white;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.adr-status.rejected {
|
|
67
|
+
background-color: #dc3545;
|
|
68
|
+
color: white;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.adr-status.superseded {
|
|
72
|
+
background-color: #6c757d;
|
|
73
|
+
color: white;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Improve code block title visibility */
|
|
77
|
+
.md-typeset .highlight .filename {
|
|
78
|
+
background-color: var(--md-code-bg-color);
|
|
79
|
+
color: var(--md-primary-fg-color);
|
|
80
|
+
padding: 0.5em 1em;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
border-radius: 0.2em 0.2em 0 0;
|
|
83
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<svg viewBox="0 0 900 600" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<!-- HTM Core -->
|
|
3
|
+
<rect x="350" y="50" width="200" height="100" fill="rgba(76, 175, 80, 0.2)" stroke="#4CAF50" stroke-width="3" rx="5"/>
|
|
4
|
+
<text x="450" y="85" text-anchor="middle" fill="#E0E0E0" font-size="16" font-weight="bold">HTM</text>
|
|
5
|
+
<text x="450" y="110" text-anchor="middle" fill="#B0B0B0" font-size="11">@robot_id: UUID</text>
|
|
6
|
+
<text x="450" y="130" text-anchor="middle" fill="#B0B0B0" font-size="11">@robot_name: String</text>
|
|
7
|
+
|
|
8
|
+
<!-- Working Memory -->
|
|
9
|
+
<rect x="50" y="250" width="240" height="280" fill="rgba(33, 150, 243, 0.2)" stroke="#2196F3" stroke-width="2" rx="5"/>
|
|
10
|
+
<text x="170" y="280" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">WorkingMemory</text>
|
|
11
|
+
<line x1="60" y1="290" x2="280" y2="290" stroke="#2196F3" stroke-width="1"/>
|
|
12
|
+
<text x="70" y="310" fill="#B0B0B0" font-size="11">@max_tokens: Integer</text>
|
|
13
|
+
<text x="70" y="330" fill="#B0B0B0" font-size="11">@nodes: Hash</text>
|
|
14
|
+
<text x="70" y="350" fill="#B0B0B0" font-size="11">@access_order: Array</text>
|
|
15
|
+
<line x1="60" y1="360" x2="280" y2="360" stroke="#2196F3" stroke-width="1"/>
|
|
16
|
+
<text x="70" y="380" fill="#B0B0B0" font-size="11">+add(key, value, ...)</text>
|
|
17
|
+
<text x="70" y="400" fill="#B0B0B0" font-size="11">+remove(key)</text>
|
|
18
|
+
<text x="70" y="420" fill="#B0B0B0" font-size="11">+has_space?(tokens)</text>
|
|
19
|
+
<text x="70" y="440" fill="#B0B0B0" font-size="11">+evict_to_make_space()</text>
|
|
20
|
+
<text x="70" y="460" fill="#B0B0B0" font-size="11">+assemble_context()</text>
|
|
21
|
+
<text x="70" y="480" fill="#B0B0B0" font-size="11">+token_count()</text>
|
|
22
|
+
<text x="70" y="500" fill="#B0B0B0" font-size="11">+utilization_percentage()</text>
|
|
23
|
+
|
|
24
|
+
<!-- Long-Term Memory -->
|
|
25
|
+
<rect x="330" y="250" width="240" height="280" fill="rgba(156, 39, 176, 0.2)" stroke="#9C27B0" stroke-width="2" rx="5"/>
|
|
26
|
+
<text x="450" y="280" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">LongTermMemory</text>
|
|
27
|
+
<line x1="340" y1="290" x2="560" y2="290" stroke="#9C27B0" stroke-width="1"/>
|
|
28
|
+
<text x="350" y="310" fill="#B0B0B0" font-size="11">@db: Database</text>
|
|
29
|
+
<text x="350" y="330" fill="#B0B0B0" font-size="11">@connection_pool</text>
|
|
30
|
+
<line x1="340" y1="340" x2="560" y2="340" stroke="#9C27B0" stroke-width="1"/>
|
|
31
|
+
<text x="350" y="360" fill="#B0B0B0" font-size="11">+add(key, value, ...)</text>
|
|
32
|
+
<text x="350" y="380" fill="#B0B0B0" font-size="11">+retrieve(key)</text>
|
|
33
|
+
<text x="350" y="400" fill="#B0B0B0" font-size="11">+delete(key)</text>
|
|
34
|
+
<text x="350" y="420" fill="#B0B0B0" font-size="11">+search(timeframe, ...)</text>
|
|
35
|
+
<text x="350" y="440" fill="#B0B0B0" font-size="11">+search_fulltext(query)</text>
|
|
36
|
+
<text x="350" y="460" fill="#B0B0B0" font-size="11">+search_hybrid()</text>
|
|
37
|
+
<text x="350" y="480" fill="#B0B0B0" font-size="11">+register_robot()</text>
|
|
38
|
+
<text x="350" y="500" fill="#B0B0B0" font-size="11">+add_relationship()</text>
|
|
39
|
+
|
|
40
|
+
<!-- Embedding Service -->
|
|
41
|
+
<rect x="610" y="250" width="240" height="280" fill="rgba(255, 152, 0, 0.2)" stroke="#FF9800" stroke-width="2" rx="5"/>
|
|
42
|
+
<text x="730" y="280" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">EmbeddingService</text>
|
|
43
|
+
<line x1="620" y1="290" x2="840" y2="290" stroke="#FF9800" stroke-width="1"/>
|
|
44
|
+
<text x="630" y="310" fill="#B0B0B0" font-size="11">@provider: Symbol</text>
|
|
45
|
+
<text x="630" y="330" fill="#B0B0B0" font-size="11">@model: String</text>
|
|
46
|
+
<text x="630" y="350" fill="#B0B0B0" font-size="11">@dimensions: Integer</text>
|
|
47
|
+
<text x="630" y="370" fill="#B0B0B0" font-size="11">@ollama_url: String</text>
|
|
48
|
+
<line x1="620" y1="380" x2="840" y2="380" stroke="#FF9800" stroke-width="1"/>
|
|
49
|
+
<text x="630" y="400" fill="#4CAF50" font-size="11">+embed(text)</text>
|
|
50
|
+
<text x="630" y="420" fill="#B0B0B0" font-size="11">+count_tokens(text)</text>
|
|
51
|
+
<text x="630" y="440" fill="#B0B0B0" font-size="11">+embed_with_ollama()</text>
|
|
52
|
+
<text x="630" y="460" fill="#B0B0B0" font-size="11">+embed_with_openai()</text>
|
|
53
|
+
<text x="630" y="480" fill="#FFC107" font-size="10" font-style="italic">// Client-side generation</text>
|
|
54
|
+
|
|
55
|
+
<!-- Relationships -->
|
|
56
|
+
<line x1="450" y1="150" x2="170" y2="250" stroke="#2196F3" stroke-width="2"/>
|
|
57
|
+
<line x1="450" y1="150" x2="450" y2="250" stroke="#9C27B0" stroke-width="2"/>
|
|
58
|
+
<line x1="450" y1="150" x2="730" y2="250" stroke="#FF9800" stroke-width="2"/>
|
|
59
|
+
|
|
60
|
+
<text x="310" y="200" fill="#B0B0B0" font-size="10">1 has 1</text>
|
|
61
|
+
<text x="460" y="200" fill="#B0B0B0" font-size="10">1 has 1</text>
|
|
62
|
+
<text x="590" y="200" fill="#B0B0B0" font-size="10">1 has 1</text>
|
|
63
|
+
</svg>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<svg viewBox="0 0 900 750" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<!-- Title -->
|
|
3
|
+
<text x="450" y="30" text-anchor="middle" fill="#E0E0E0" font-size="18" font-weight="bold">HTM Database Schema</text>
|
|
4
|
+
|
|
5
|
+
<!-- Nodes Table (Top Left - Large) -->
|
|
6
|
+
<rect x="50" y="70" width="450" height="280" fill="rgba(33, 150, 243, 0.2)" stroke="#2196F3" stroke-width="2" rx="5"/>
|
|
7
|
+
<text x="275" y="95" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">nodes</text>
|
|
8
|
+
<line x1="60" y1="105" x2="490" y2="105" stroke="#2196F3" stroke-width="1"/>
|
|
9
|
+
<text x="70" y="125" fill="#FFC107" font-size="11" font-weight="bold">id: BIGSERIAL PK</text>
|
|
10
|
+
<text x="70" y="145" fill="#B0B0B0" font-size="11">key: TEXT UNIQUE</text>
|
|
11
|
+
<text x="70" y="165" fill="#B0B0B0" font-size="11">value: TEXT</text>
|
|
12
|
+
<text x="70" y="185" fill="#B0B0B0" font-size="11">type: TEXT</text>
|
|
13
|
+
<text x="70" y="205" fill="#B0B0B0" font-size="11">category: TEXT</text>
|
|
14
|
+
<text x="70" y="225" fill="#B0B0B0" font-size="11">importance: REAL</text>
|
|
15
|
+
<text x="70" y="245" fill="#B0B0B0" font-size="11">token_count: INTEGER</text>
|
|
16
|
+
<text x="70" y="265" fill="#B0B0B0" font-size="11">in_working_memory: BOOL</text>
|
|
17
|
+
<text x="70" y="285" fill="#4CAF50" font-size="11">robot_id: TEXT FK</text>
|
|
18
|
+
<text x="70" y="305" fill="#B0B0B0" font-size="11">embedding: vector(1536)</text>
|
|
19
|
+
<text x="70" y="325" fill="#B0B0B0" font-size="11">created_at, updated_at, ...</text>
|
|
20
|
+
|
|
21
|
+
<!-- Robots Table (Top Right) -->
|
|
22
|
+
<rect x="550" y="70" width="300" height="160" fill="rgba(76, 175, 80, 0.2)" stroke="#4CAF50" stroke-width="2" rx="5"/>
|
|
23
|
+
<text x="700" y="95" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">robots</text>
|
|
24
|
+
<line x1="560" y1="105" x2="840" y2="105" stroke="#4CAF50" stroke-width="1"/>
|
|
25
|
+
<text x="570" y="125" fill="#FFC107" font-size="11" font-weight="bold">id: TEXT PK (UUID)</text>
|
|
26
|
+
<text x="570" y="145" fill="#B0B0B0" font-size="11">name: TEXT</text>
|
|
27
|
+
<text x="570" y="165" fill="#B0B0B0" font-size="11">created_at: TIMESTAMP</text>
|
|
28
|
+
<text x="570" y="185" fill="#B0B0B0" font-size="11">last_active: TIMESTAMP</text>
|
|
29
|
+
<text x="570" y="205" fill="#B0B0B0" font-size="11">metadata: JSONB</text>
|
|
30
|
+
|
|
31
|
+
<!-- Relationships Table (Bottom Left) -->
|
|
32
|
+
<rect x="50" y="400" width="250" height="180" fill="rgba(156, 39, 176, 0.2)" stroke="#9C27B0" stroke-width="2" rx="5"/>
|
|
33
|
+
<text x="175" y="425" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">relationships</text>
|
|
34
|
+
<line x1="60" y1="435" x2="290" y2="435" stroke="#9C27B0" stroke-width="1"/>
|
|
35
|
+
<text x="70" y="455" fill="#FFC107" font-size="11" font-weight="bold">id: BIGSERIAL PK</text>
|
|
36
|
+
<text x="70" y="475" fill="#4CAF50" font-size="11">from_node_id: BIGINT FK</text>
|
|
37
|
+
<text x="70" y="495" fill="#4CAF50" font-size="11">to_node_id: BIGINT FK</text>
|
|
38
|
+
<text x="70" y="515" fill="#B0B0B0" font-size="11">relationship_type: TEXT</text>
|
|
39
|
+
<text x="70" y="535" fill="#B0B0B0" font-size="11">strength: REAL</text>
|
|
40
|
+
<text x="70" y="555" fill="#B0B0B0" font-size="11">created_at: TIMESTAMP</text>
|
|
41
|
+
|
|
42
|
+
<!-- Tags Table (Bottom Middle) -->
|
|
43
|
+
<rect x="340" y="400" width="200" height="160" fill="rgba(255, 152, 0, 0.2)" stroke="#FF9800" stroke-width="2" rx="5"/>
|
|
44
|
+
<text x="440" y="425" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">tags</text>
|
|
45
|
+
<line x1="350" y1="435" x2="530" y2="435" stroke="#FF9800" stroke-width="1"/>
|
|
46
|
+
<text x="360" y="455" fill="#FFC107" font-size="11" font-weight="bold">id: BIGSERIAL PK</text>
|
|
47
|
+
<text x="360" y="475" fill="#4CAF50" font-size="11">node_id: BIGINT FK</text>
|
|
48
|
+
<text x="360" y="495" fill="#B0B0B0" font-size="11">tag: TEXT</text>
|
|
49
|
+
<text x="360" y="515" fill="#B0B0B0" font-size="11">created_at: TIMESTAMP</text>
|
|
50
|
+
|
|
51
|
+
<!-- Operations Log Table (Bottom Right) -->
|
|
52
|
+
<rect x="580" y="400" width="270" height="180" fill="rgba(244, 67, 54, 0.2)" stroke="#F44336" stroke-width="2" rx="5"/>
|
|
53
|
+
<text x="715" y="425" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">operations_log</text>
|
|
54
|
+
<line x1="590" y1="435" x2="840" y2="435" stroke="#F44336" stroke-width="1"/>
|
|
55
|
+
<text x="600" y="455" fill="#FFC107" font-size="11" font-weight="bold">id: BIGSERIAL PK</text>
|
|
56
|
+
<text x="600" y="475" fill="#B0B0B0" font-size="11">timestamp: TIMESTAMP</text>
|
|
57
|
+
<text x="600" y="495" fill="#B0B0B0" font-size="11">operation: TEXT</text>
|
|
58
|
+
<text x="600" y="515" fill="#4CAF50" font-size="11">node_id: BIGINT FK</text>
|
|
59
|
+
<text x="600" y="535" fill="#4CAF50" font-size="11">robot_id: TEXT FK</text>
|
|
60
|
+
<text x="600" y="555" fill="#B0B0B0" font-size="11">details: JSONB</text>
|
|
61
|
+
|
|
62
|
+
<!-- Foreign Key Relationships -->
|
|
63
|
+
<!-- nodes.robot_id -> robots.id -->
|
|
64
|
+
<line x1="500" y1="285" x2="550" y2="150" stroke="#4CAF50" stroke-width="2" marker-end="url(#fk-arrow)"/>
|
|
65
|
+
<text x="510" y="220" fill="#4CAF50" font-size="10">robot_id FK</text>
|
|
66
|
+
|
|
67
|
+
<!-- nodes -> relationships (from_node_id, to_node_id) -->
|
|
68
|
+
<line x1="175" y1="350" x2="175" y2="400" stroke="#9C27B0" stroke-width="2" marker-end="url(#fk-arrow)"/>
|
|
69
|
+
<text x="185" y="375" fill="#9C27B0" font-size="10">from/to FK</text>
|
|
70
|
+
|
|
71
|
+
<!-- nodes -> tags (node_id) -->
|
|
72
|
+
<line x1="300" y1="350" x2="440" y2="400" stroke="#FF9800" stroke-width="2" marker-end="url(#fk-arrow)"/>
|
|
73
|
+
<text x="350" y="375" fill="#FF9800" font-size="10">node_id FK</text>
|
|
74
|
+
|
|
75
|
+
<!-- nodes -> operations_log (node_id) -->
|
|
76
|
+
<line x1="500" y1="350" x2="715" y2="400" stroke="#F44336" stroke-width="2" marker-end="url(#fk-arrow)"/>
|
|
77
|
+
<text x="580" y="375" fill="#F44336" font-size="10">node_id FK</text>
|
|
78
|
+
|
|
79
|
+
<!-- robots -> operations_log (robot_id) -->
|
|
80
|
+
<line x1="700" y1="230" x2="700" y2="400" stroke="#4CAF50" stroke-width="2" marker-end="url(#fk-arrow)"/>
|
|
81
|
+
<text x="710" y="315" fill="#4CAF50" font-size="10">robot_id FK</text>
|
|
82
|
+
|
|
83
|
+
<defs>
|
|
84
|
+
<marker id="fk-arrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
85
|
+
<polygon points="0 0, 10 3, 0 6" fill="#4CAF50"/>
|
|
86
|
+
</marker>
|
|
87
|
+
</defs>
|
|
88
|
+
|
|
89
|
+
<!-- Legend -->
|
|
90
|
+
<text x="50" y="650" fill="#E0E0E0" font-size="12" font-weight="bold">Legend:</text>
|
|
91
|
+
<text x="50" y="670" fill="#FFC107" font-size="10">PK = Primary Key</text>
|
|
92
|
+
<text x="200" y="670" fill="#4CAF50" font-size="10">FK = Foreign Key</text>
|
|
93
|
+
</svg>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<svg viewBox="0 0 1000 650" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<defs>
|
|
3
|
+
<style>
|
|
4
|
+
.robot-box { fill: rgba(33, 150, 243, 0.2); stroke: #2196F3; stroke-width: 2.5; }
|
|
5
|
+
.robot-alpha { fill: rgba(156, 39, 176, 0.2); stroke: #9C27B0; stroke-width: 2.5; }
|
|
6
|
+
.robot-beta { fill: rgba(255, 152, 0, 0.2); stroke: #FF9800; stroke-width: 2.5; }
|
|
7
|
+
.robot-gamma { fill: rgba(76, 175, 80, 0.2); stroke: #4CAF50; stroke-width: 2.5; }
|
|
8
|
+
.shared-box { fill: rgba(33, 150, 243, 0.3); stroke: #2196F3; stroke-width: 3; }
|
|
9
|
+
.text-header { fill: #E0E0E0; font-size: 16px; font-weight: bold; }
|
|
10
|
+
.text-label { fill: #E0E0E0; font-size: 13px; }
|
|
11
|
+
.text-small { fill: #B0B0B0; font-size: 11px; }
|
|
12
|
+
.text-tiny { fill: #A0A0A0; font-size: 10px; }
|
|
13
|
+
.arrow { stroke: #4A9EFF; stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
|
|
14
|
+
.arrow-bidirect { stroke: #4A9EFF; stroke-width: 2; fill: none; marker-start: url(#arrowhead-rev); marker-end: url(#arrowhead); }
|
|
15
|
+
</style>
|
|
16
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
17
|
+
<polygon points="0 0, 10 3, 0 6" fill="#4A9EFF" />
|
|
18
|
+
</marker>
|
|
19
|
+
<marker id="arrowhead-rev" markerWidth="10" markerHeight="10" refX="1" refY="3" orient="auto">
|
|
20
|
+
<polygon points="10 0, 0 3, 10 6" fill="#4A9EFF" />
|
|
21
|
+
</marker>
|
|
22
|
+
</defs>
|
|
23
|
+
|
|
24
|
+
<!-- Title -->
|
|
25
|
+
<text x="500" y="30" text-anchor="middle" class="text-header" font-size="18">HTM Hive Mind Architecture</text>
|
|
26
|
+
|
|
27
|
+
<!-- Robot Alpha -->
|
|
28
|
+
<rect x="50" y="70" width="250" height="200" class="robot-alpha" rx="5"/>
|
|
29
|
+
<text x="175" y="95" text-anchor="middle" class="text-header">Robot Alpha</text>
|
|
30
|
+
<text x="175" y="115" text-anchor="middle" class="text-small">ID: research-001</text>
|
|
31
|
+
|
|
32
|
+
<rect x="65" y="130" width="220" height="120" fill="rgba(156, 39, 176, 0.15)" stroke="#9C27B0" stroke-width="1.5" rx="3"/>
|
|
33
|
+
<text x="175" y="150" text-anchor="middle" class="text-label">Working Memory</text>
|
|
34
|
+
<text x="175" y="167" text-anchor="middle" class="text-small">(Private)</text>
|
|
35
|
+
|
|
36
|
+
<text x="75" y="190" class="text-tiny">• Research findings</text>
|
|
37
|
+
<text x="75" y="205" class="text-tiny">• Data analysis</text>
|
|
38
|
+
<text x="75" y="220" class="text-tiny">• Recent queries</text>
|
|
39
|
+
<text x="75" y="235" class="text-tiny">128K tokens active</text>
|
|
40
|
+
|
|
41
|
+
<!-- Robot Beta -->
|
|
42
|
+
<rect x="375" y="70" width="250" height="200" class="robot-beta" rx="5"/>
|
|
43
|
+
<text x="500" y="95" text-anchor="middle" class="text-header">Robot Beta</text>
|
|
44
|
+
<text x="500" y="115" text-anchor="middle" class="text-small">ID: code-001</text>
|
|
45
|
+
|
|
46
|
+
<rect x="390" y="130" width="220" height="120" fill="rgba(255, 152, 0, 0.15)" stroke="#FF9800" stroke-width="1.5" rx="3"/>
|
|
47
|
+
<text x="500" y="150" text-anchor="middle" class="text-label">Working Memory</text>
|
|
48
|
+
<text x="500" y="167" text-anchor="middle" class="text-small">(Private)</text>
|
|
49
|
+
|
|
50
|
+
<text x="400" y="190" class="text-tiny">• Code snippets</text>
|
|
51
|
+
<text x="400" y="205" class="text-tiny">• Implementation plans</text>
|
|
52
|
+
<text x="400" y="220" class="text-tiny">• Architecture docs</text>
|
|
53
|
+
<text x="400" y="235" class="text-tiny">96K tokens active</text>
|
|
54
|
+
|
|
55
|
+
<!-- Robot Gamma -->
|
|
56
|
+
<rect x="700" y="70" width="250" height="200" class="robot-gamma" rx="5"/>
|
|
57
|
+
<text x="825" y="95" text-anchor="middle" class="text-header">Robot Gamma</text>
|
|
58
|
+
<text x="825" y="115" text-anchor="middle" class="text-small">ID: docs-001</text>
|
|
59
|
+
|
|
60
|
+
<rect x="715" y="130" width="220" height="120" fill="rgba(76, 175, 80, 0.15)" stroke="#4CAF50" stroke-width="1.5" rx="3"/>
|
|
61
|
+
<text x="825" y="150" text-anchor="middle" class="text-label">Working Memory</text>
|
|
62
|
+
<text x="825" y="167" text-anchor="middle" class="text-small">(Private)</text>
|
|
63
|
+
|
|
64
|
+
<text x="725" y="190" class="text-tiny">• Documentation</text>
|
|
65
|
+
<text x="725" y="205" class="text-tiny">• Examples</text>
|
|
66
|
+
<text x="725" y="220" class="text-tiny">• Tutorials</text>
|
|
67
|
+
<text x="725" y="235" class="text-tiny">64K tokens active</text>
|
|
68
|
+
|
|
69
|
+
<!-- Arrows from robots to shared memory -->
|
|
70
|
+
<path d="M 175 270 L 175 350" class="arrow-bidirect"/>
|
|
71
|
+
<text x="195" y="315" class="text-tiny" fill="#9C27B0">read/write</text>
|
|
72
|
+
|
|
73
|
+
<path d="M 500 270 L 500 350" class="arrow-bidirect"/>
|
|
74
|
+
<text x="520" y="315" class="text-tiny" fill="#FF9800">read/write</text>
|
|
75
|
+
|
|
76
|
+
<path d="M 825 270 L 825 350" class="arrow-bidirect"/>
|
|
77
|
+
<text x="845" y="315" class="text-tiny" fill="#4CAF50">read/write</text>
|
|
78
|
+
|
|
79
|
+
<!-- Shared Long-term Memory -->
|
|
80
|
+
<rect x="150" y="370" width="700" height="250" class="shared-box" rx="5"/>
|
|
81
|
+
<text x="500" y="400" text-anchor="middle" class="text-header" font-size="18">Long-term Memory (Shared)</text>
|
|
82
|
+
<text x="500" y="420" text-anchor="middle" class="text-small">PostgreSQL</text>
|
|
83
|
+
|
|
84
|
+
<!-- Shared memory features -->
|
|
85
|
+
<rect x="170" y="445" width="160" height="160" fill="rgba(33, 150, 243, 0.15)" stroke="#2196F3" stroke-width="1.5" rx="3"/>
|
|
86
|
+
<text x="250" y="465" text-anchor="middle" class="text-label">All Robot Data</text>
|
|
87
|
+
<text x="180" y="490" class="text-small">✓ Combined knowledge</text>
|
|
88
|
+
<text x="180" y="510" class="text-small">✓ Shared discoveries</text>
|
|
89
|
+
<text x="180" y="530" class="text-small">✓ Cross-robot recall</text>
|
|
90
|
+
<text x="180" y="550" class="text-small">✓ Full conversation</text>
|
|
91
|
+
<text x="190" y="570" class="text-small">history</text>
|
|
92
|
+
<text x="180" y="590" class="text-tiny" fill="#64B5F6">~50,000 nodes</text>
|
|
93
|
+
|
|
94
|
+
<rect x="350" y="445" width="160" height="160" fill="rgba(33, 150, 243, 0.15)" stroke="#2196F3" stroke-width="1.5" rx="3"/>
|
|
95
|
+
<text x="430" y="465" text-anchor="middle" class="text-label">Attribution</text>
|
|
96
|
+
<text x="360" y="490" class="text-small">✓ robot_id per node</text>
|
|
97
|
+
<text x="360" y="510" class="text-small">✓ Creation timestamps</text>
|
|
98
|
+
<text x="360" y="530" class="text-small">✓ Contribution tracking</text>
|
|
99
|
+
<text x="360" y="550" class="text-small">✓ Activity logs</text>
|
|
100
|
+
<text x="360" y="570" class="text-small">✓ Timeline queries</text>
|
|
101
|
+
|
|
102
|
+
<rect x="530" y="445" width="160" height="160" fill="rgba(33, 150, 243, 0.15)" stroke="#2196F3" stroke-width="1.5" rx="3"/>
|
|
103
|
+
<text x="610" y="465" text-anchor="middle" class="text-label">Search & Recall</text>
|
|
104
|
+
<text x="540" y="490" class="text-small">✓ Vector search</text>
|
|
105
|
+
<text x="540" y="510" class="text-small">✓ Full-text search</text>
|
|
106
|
+
<text x="540" y="530" class="text-small">✓ Hybrid retrieval</text>
|
|
107
|
+
<text x="540" y="550" class="text-small">✓ Time-range queries</text>
|
|
108
|
+
<text x="540" y="570" class="text-small">✓ Tag-based filtering</text>
|
|
109
|
+
|
|
110
|
+
<rect x="710" y="445" width="120" height="160" fill="rgba(33, 150, 243, 0.15)" stroke="#2196F2" stroke-width="1.5" rx="3"/>
|
|
111
|
+
<text x="770" y="465" text-anchor="middle" class="text-label">Features</text>
|
|
112
|
+
<text x="720" y="490" class="text-small">✓ Never forget</text>
|
|
113
|
+
<text x="720" y="510" class="text-small">✓ Permanent</text>
|
|
114
|
+
<text x="720" y="530" class="text-small">✓ Scalable</text>
|
|
115
|
+
<text x="720" y="550" class="text-small">✓ Consistent</text>
|
|
116
|
+
<text x="720" y="570" class="text-small">✓ ACID safe</text>
|
|
117
|
+
<text x="720" y="590" class="text-small">✓ Durable</text>
|
|
118
|
+
|
|
119
|
+
<!-- Legend -->
|
|
120
|
+
<rect x="50" y="300" width="80" height="20" fill="rgba(156, 39, 176, 0.2)" stroke="#9C27B0" stroke-width="1" rx="2"/>
|
|
121
|
+
<text x="140" y="314" class="text-tiny">Private Memory</text>
|
|
122
|
+
|
|
123
|
+
<rect x="260" y="300" width="80" height="20" fill="rgba(33, 150, 243, 0.3)" stroke="#2196F3" stroke-width="1" rx="2"/>
|
|
124
|
+
<text x="350" y="314" class="text-tiny">Shared Memory</text>
|
|
125
|
+
</svg>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<svg viewBox="0 0 900 600" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<defs>
|
|
3
|
+
<style>
|
|
4
|
+
.critical-box { fill: rgba(244, 67, 54, 0.3); stroke: #F44336; stroke-width: 2; }
|
|
5
|
+
.high-box { fill: rgba(255, 152, 0, 0.3); stroke: #FF9800; stroke-width: 2; }
|
|
6
|
+
.medium-box { fill: rgba(255, 235, 59, 0.3); stroke: #FFEB3B; stroke-width: 2; }
|
|
7
|
+
.low-box { fill: rgba(158, 158, 158, 0.3); stroke: #9E9E9E; stroke-width: 2; }
|
|
8
|
+
.type-box { fill: rgba(33, 150, 243, 0.2); stroke: #2196F3; stroke-width: 1.5; }
|
|
9
|
+
.text-header { fill: #E0E0E0; font-size: 18px; font-weight: bold; }
|
|
10
|
+
.text-label { fill: #E0E0E0; font-size: 13px; font-weight: bold; }
|
|
11
|
+
.text-small { fill: #B0B0B0; font-size: 11px; }
|
|
12
|
+
.text-tiny { fill: #A0A0A0; font-size: 10px; }
|
|
13
|
+
</style>
|
|
14
|
+
</defs>
|
|
15
|
+
|
|
16
|
+
<!-- Title -->
|
|
17
|
+
<text x="450" y="30" text-anchor="middle" class="text-header">Importance Scoring Framework</text>
|
|
18
|
+
|
|
19
|
+
<!-- Importance Scale -->
|
|
20
|
+
<text x="50" y="70" class="text-label">Importance Scale (0.0 - 10.0)</text>
|
|
21
|
+
|
|
22
|
+
<!-- Critical (9.0-10.0) -->
|
|
23
|
+
<rect x="50" y="90" width="800" height="80" class="critical-box" rx="5"/>
|
|
24
|
+
<text x="70" y="115" class="text-label" fill="#F44336">Critical (9.0-10.0)</text>
|
|
25
|
+
<text x="70" y="135" class="text-small">Must never lose • Highest retention priority</text>
|
|
26
|
+
<text x="70" y="155" class="text-tiny">Examples: API keys, core architecture decisions, critical user data</text>
|
|
27
|
+
|
|
28
|
+
<!-- High (7.0-8.9) -->
|
|
29
|
+
<rect x="50" y="185" width="800" height="80" class="high-box" rx="5"/>
|
|
30
|
+
<text x="70" y="210" class="text-label" fill="#FF9800">High (7.0-8.9)</text>
|
|
31
|
+
<text x="70" y="230" class="text-small">Very important • High retention priority</text>
|
|
32
|
+
<text x="70" y="250" class="text-tiny">Examples: User identity, major decisions, important preferences</text>
|
|
33
|
+
|
|
34
|
+
<!-- Medium (4.0-6.9) -->
|
|
35
|
+
<rect x="50" y="280" width="800" height="80" class="medium-box" rx="5"/>
|
|
36
|
+
<text x="70" y="305" class="text-label" fill="#FDD835">Medium (4.0-6.9)</text>
|
|
37
|
+
<text x="70" y="325" class="text-small">Moderately important • Standard retention</text>
|
|
38
|
+
<text x="70" y="345" class="text-tiny">Examples: Code snippets, current context, minor preferences</text>
|
|
39
|
+
|
|
40
|
+
<!-- Low (1.0-3.9) -->
|
|
41
|
+
<rect x="50" y="375" width="800" height="80" class="low-box" rx="5"/>
|
|
42
|
+
<text x="70" y="400" class="text-label" fill="#9E9E9E">Low (1.0-3.9)</text>
|
|
43
|
+
<text x="70" y="420" class="text-small">Nice to have • Can evict when needed</text>
|
|
44
|
+
<text x="70" y="440" class="text-tiny">Examples: Temporary notes, minor context, throwaway calculations</text>
|
|
45
|
+
|
|
46
|
+
<!-- Memory Types with Typical Ranges -->
|
|
47
|
+
<text x="50" y="490" class="text-label">Typical Importance by Memory Type</text>
|
|
48
|
+
|
|
49
|
+
<!-- Type boxes -->
|
|
50
|
+
<rect x="50" y="510" width="130" height="70" class="type-box" rx="3"/>
|
|
51
|
+
<text x="115" y="530" text-anchor="middle" class="text-label" fill="#2196F3">:fact</text>
|
|
52
|
+
<text x="115" y="550" text-anchor="middle" class="text-small">7.0-10.0</text>
|
|
53
|
+
<text x="115" y="570" text-anchor="middle" class="text-tiny">User data, system</text>
|
|
54
|
+
|
|
55
|
+
<rect x="195" y="510" width="130" height="70" class="type-box" rx="3"/>
|
|
56
|
+
<text x="260" y="530" text-anchor="middle" class="text-label" fill="#2196F3">:decision</text>
|
|
57
|
+
<text x="260" y="550" text-anchor="middle" class="text-small">7.0-10.0</text>
|
|
58
|
+
<text x="260" y="570" text-anchor="middle" class="text-tiny">Architecture,</text>
|
|
59
|
+
<text x="260" y="580" text-anchor="middle" class="text-tiny">choices</text>
|
|
60
|
+
|
|
61
|
+
<rect x="340" y="510" width="130" height="70" class="type-box" rx="3"/>
|
|
62
|
+
<text x="405" y="530" text-anchor="middle" class="text-label" fill="#2196F3">:preference</text>
|
|
63
|
+
<text x="405" y="550" text-anchor="middle" class="text-small">4.0-8.0</text>
|
|
64
|
+
<text x="405" y="570" text-anchor="middle" class="text-tiny">User preferences</text>
|
|
65
|
+
|
|
66
|
+
<rect x="485" y="510" width="130" height="70" class="type-box" rx="3"/>
|
|
67
|
+
<text x="550" y="530" text-anchor="middle" class="text-label" fill="#2196F3">:code</text>
|
|
68
|
+
<text x="550" y="550" text-anchor="middle" class="text-small">4.0-7.0</text>
|
|
69
|
+
<text x="550" y="570" text-anchor="middle" class="text-tiny">Snippets,</text>
|
|
70
|
+
<text x="550" y="580" text-anchor="middle" class="text-tiny">examples</text>
|
|
71
|
+
|
|
72
|
+
<rect x="630" y="510" width="130" height="70" class="type-box" rx="3"/>
|
|
73
|
+
<text x="695" y="530" text-anchor="middle" class="text-label" fill="#2196F3">:context</text>
|
|
74
|
+
<text x="695" y="550" text-anchor="middle" class="text-small">3.0-6.0</text>
|
|
75
|
+
<text x="695" y="570" text-anchor="middle" class="text-tiny">Conversation</text>
|
|
76
|
+
<text x="695" y="580" text-anchor="middle" class="text-tiny">state</text>
|
|
77
|
+
|
|
78
|
+
<rect x="775" y="510" width="75" height="70" class="type-box" rx="3"/>
|
|
79
|
+
<text x="812" y="530" text-anchor="middle" class="text-label" fill="#2196F3">:question</text>
|
|
80
|
+
<text x="812" y="550" text-anchor="middle" class="text-small">5.0-8.0</text>
|
|
81
|
+
<text x="812" y="570" text-anchor="middle" class="text-tiny">Open</text>
|
|
82
|
+
<text x="812" y="580" text-anchor="middle" class="text-tiny">items</text>
|
|
83
|
+
</svg>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<svg viewBox="0 0 800 700" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
|
2
|
+
<!-- Title -->
|
|
3
|
+
<text x="400" y="30" text-anchor="middle" fill="#E0E0E0" font-size="18" font-weight="bold">HTM Layered Architecture</text>
|
|
4
|
+
|
|
5
|
+
<!-- Layer 1: API Layer -->
|
|
6
|
+
<rect x="100" y="60" width="600" height="100" fill="rgba(76, 175, 80, 0.2)" stroke="#4CAF50" stroke-width="2" rx="5"/>
|
|
7
|
+
<text x="400" y="85" text-anchor="middle" fill="#E0E0E0" font-size="16" font-weight="bold">API Layer</text>
|
|
8
|
+
<text x="200" y="110" text-anchor="middle" fill="#B0B0B0" font-size="12">add_node()</text>
|
|
9
|
+
<text x="320" y="110" text-anchor="middle" fill="#B0B0B0" font-size="12">recall()</text>
|
|
10
|
+
<text x="440" y="110" text-anchor="middle" fill="#B0B0B0" font-size="12">retrieve()</text>
|
|
11
|
+
<text x="560" y="110" text-anchor="middle" fill="#B0B0B0" font-size="12">forget()</text>
|
|
12
|
+
<text x="400" y="135" text-anchor="middle" fill="#B0B0B0" font-size="12">create_context() • memory_stats() • which_robot_said()</text>
|
|
13
|
+
|
|
14
|
+
<!-- Layer 2: Coordination Layer -->
|
|
15
|
+
<rect x="100" y="180" width="600" height="100" fill="rgba(33, 150, 243, 0.2)" stroke="#2196F3" stroke-width="2" rx="5"/>
|
|
16
|
+
<text x="400" y="205" text-anchor="middle" fill="#E0E0E0" font-size="16" font-weight="bold">Coordination Layer (HTM)</text>
|
|
17
|
+
<text x="250" y="235" text-anchor="middle" fill="#B0B0B0" font-size="12">Robot Registration</text>
|
|
18
|
+
<text x="400" y="235" text-anchor="middle" fill="#B0B0B0" font-size="12">Embedding Generation</text>
|
|
19
|
+
<text x="550" y="235" text-anchor="middle" fill="#B0B0B0" font-size="12">Token Counting</text>
|
|
20
|
+
<text x="400" y="260" text-anchor="middle" fill="#B0B0B0" font-size="12">Memory Orchestration • Context Assembly</text>
|
|
21
|
+
|
|
22
|
+
<!-- Layer 3: Memory Management Layer -->
|
|
23
|
+
<rect x="100" y="300" width="290" height="120" fill="rgba(156, 39, 176, 0.2)" stroke="#9C27B0" stroke-width="2" rx="5"/>
|
|
24
|
+
<text x="245" y="325" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">Working Memory</text>
|
|
25
|
+
<text x="245" y="350" text-anchor="middle" fill="#B0B0B0" font-size="11">Token Budget</text>
|
|
26
|
+
<text x="245" y="370" text-anchor="middle" fill="#B0B0B0" font-size="11">Eviction Strategy</text>
|
|
27
|
+
<text x="245" y="390" text-anchor="middle" fill="#B0B0B0" font-size="11">Context Assembly</text>
|
|
28
|
+
<text x="245" y="410" text-anchor="middle" fill="#B0B0B0" font-size="11">In-Memory Storage</text>
|
|
29
|
+
|
|
30
|
+
<rect x="410" y="300" width="290" height="120" fill="rgba(255, 152, 0, 0.2)" stroke="#FF9800" stroke-width="2" rx="5"/>
|
|
31
|
+
<text x="555" y="325" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">Long-Term Memory</text>
|
|
32
|
+
<text x="555" y="350" text-anchor="middle" fill="#B0B0B0" font-size="11">Persistence</text>
|
|
33
|
+
<text x="555" y="370" text-anchor="middle" fill="#B0B0B0" font-size="11">RAG Search</text>
|
|
34
|
+
<text x="555" y="390" text-anchor="middle" fill="#B0B0B0" font-size="11">Relationship Graphs</text>
|
|
35
|
+
<text x="555" y="410" text-anchor="middle" fill="#B0B0B0" font-size="11">Robot Registry</text>
|
|
36
|
+
|
|
37
|
+
<!-- Layer 4: Services Layer -->
|
|
38
|
+
<rect x="100" y="440" width="290" height="100" fill="rgba(244, 67, 54, 0.2)" stroke="#F44336" stroke-width="2" rx="5"/>
|
|
39
|
+
<text x="245" y="465" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">Embedding Service</text>
|
|
40
|
+
<text x="245" y="490" text-anchor="middle" fill="#B0B0B0" font-size="11">Ollama • OpenAI • Cohere</text>
|
|
41
|
+
<text x="245" y="510" text-anchor="middle" fill="#B0B0B0" font-size="11">Vector Generation</text>
|
|
42
|
+
<text x="245" y="530" text-anchor="middle" fill="#B0B0B0" font-size="11">Token Counting</text>
|
|
43
|
+
|
|
44
|
+
<rect x="410" y="440" width="290" height="100" fill="rgba(255, 193, 7, 0.2)" stroke="#FFC107" stroke-width="2" rx="5"/>
|
|
45
|
+
<text x="555" y="465" text-anchor="middle" fill="#E0E0E0" font-size="14" font-weight="bold">Database Service</text>
|
|
46
|
+
<text x="555" y="490" text-anchor="middle" fill="#B0B0B0" font-size="11">Connection Pool</text>
|
|
47
|
+
<text x="555" y="510" text-anchor="middle" fill="#B0B0B0" font-size="11">Query Execution</text>
|
|
48
|
+
<text x="555" y="530" text-anchor="middle" fill="#B0B0B0" font-size="11">Transaction Management</text>
|
|
49
|
+
|
|
50
|
+
<!-- Layer 5: Data Layer -->
|
|
51
|
+
<rect x="100" y="560" width="600" height="100" fill="rgba(121, 85, 72, 0.2)" stroke="#795548" stroke-width="2" rx="5"/>
|
|
52
|
+
<text x="400" y="585" text-anchor="middle" fill="#E0E0E0" font-size="16" font-weight="bold">Data Layer</text>
|
|
53
|
+
<text x="250" y="615" text-anchor="middle" fill="#B0B0B0" font-size="12">PostgreSQL 16+</text>
|
|
54
|
+
<text x="400" y="615" text-anchor="middle" fill="#B0B0B0" font-size="12">PostgreSQL</text>
|
|
55
|
+
<text x="550" y="615" text-anchor="middle" fill="#B0B0B0" font-size="12">pgvector</text>
|
|
56
|
+
<text x="400" y="640" text-anchor="middle" fill="#B0B0B0" font-size="11">Hypertables • Vector Indexes • Full-Text Search</text>
|
|
57
|
+
|
|
58
|
+
<!-- Connection arrows -->
|
|
59
|
+
<line x1="400" y1="160" x2="400" y2="180" stroke="#808080" stroke-width="2" marker-end="url(#arrow)"/>
|
|
60
|
+
<line x1="400" y1="280" x2="245" y2="300" stroke="#808080" stroke-width="2" marker-end="url(#arrow)"/>
|
|
61
|
+
<line x1="400" y1="280" x2="555" y2="300" stroke="#808080" stroke-width="2" marker-end="url(#arrow)"/>
|
|
62
|
+
<line x1="245" y1="420" x2="245" y2="440" stroke="#808080" stroke-width="2" marker-end="url(#arrow)"/>
|
|
63
|
+
<line x1="555" y1="420" x2="555" y2="440" stroke="#808080" stroke-width="2" marker-end="url(#arrow)"/>
|
|
64
|
+
<line x1="400" y1="540" x2="400" y2="560" stroke="#808080" stroke-width="2" marker-end="url(#arrow)"/>
|
|
65
|
+
|
|
66
|
+
<defs>
|
|
67
|
+
<marker id="arrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
68
|
+
<polygon points="0 0, 10 3, 0 6" fill="#808080"/>
|
|
69
|
+
</marker>
|
|
70
|
+
</defs>
|
|
71
|
+
</svg>
|