{"id":16278783,"url":"https://github.com/themaximalist/thinkabletype","last_synced_at":"2025-09-08T03:31:00.304Z","repository":{"id":222071433,"uuid":"738411785","full_name":"themaximalist/thinkabletype","owner":"themaximalist","description":"Knowledge Graph Toolkit","archived":false,"fork":false,"pushed_at":"2024-05-20T07:59:40.000Z","size":17788,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-24T17:05:14.658Z","etag":null,"topics":["hypergraph","programming-language","symbolic-programming"],"latest_commit_sha":null,"homepage":"https://thinkabletype.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/themaximalist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-03T07:00:17.000Z","updated_at":"2024-12-12T16:08:15.000Z","dependencies_parsed_at":"2024-03-22T19:39:27.299Z","dependency_job_id":"38a5d129-5279-4e2f-a497-16ca4a1bfbde","html_url":"https://github.com/themaximalist/thinkabletype","commit_stats":{"total_commits":109,"total_committers":2,"mean_commits":54.5,"dds":0.00917431192660545,"last_synced_commit":"e19214c74f27cde11a3b6c2f6feb20d3d57eb767"},"previous_names":["themaximal1st/hypertype","themaximal1st/thinkabletype","themaximalist/thinkabletype"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themaximalist%2Fthinkabletype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themaximalist%2Fthinkabletype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themaximalist%2Fthinkabletype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themaximalist%2Fthinkabletype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themaximalist","download_url":"https://codeload.github.com/themaximalist/thinkabletype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232275382,"owners_count":18498268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hypergraph","programming-language","symbolic-programming"],"created_at":"2024-10-10T18:59:57.310Z","updated_at":"2025-09-08T03:31:00.286Z","avatar_url":"https://github.com/themaximalist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ThinkableType \n\n\u003cimg src=\"public/logo.png\" alt=\"ThinkableType — Knowledge Graph Library\" class=\"logo\" style=\"max-width: 500px;\" /\u003e\n\n\u003cdiv class=\"badges\" style=\"text-align: center;\"\u003e\n\u003ca href=\"https://github.com/themaximal1st/thinkabletype\"\u003e\u003cimg alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/themaximal1st/thinkabletype\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@themaximalist/thinkabletype\"\u003e\u003cimg alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dt/%40themaximalist%2Fthinkabletype\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/themaximal1st/thinkabletype\"\u003e\u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/themaximal1st/thinkabletype\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/themaximal1st/thinkabletype\"\u003e\u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/themaximal1st/thinkabletype\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\n\u003cdiv class=\"names\"\u003e\n\n\u003e Interwingled Information Language\n\u003e\n\u003e Hypertext on Hypergraphs\n\u003e\n\u003e Multidimensional Mind Mapping\n\u003e\n\u003e Cognitive Cartography\n\u003e\n\u003e A DSL for Data Explorers\n\u003e\n\u003e Strange Loop Language\n\u003e\n\u003e Tangled Hierarchy Markup Language\n\u003e\n\u003e Knowledge Graph Toolkit\n\u003e\n\u003e Thinkable Type\n\n\u003c/div\u003e\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is a way to represent concepts, ideas and information.\n\nIt's great at building [knowledge graphs](https://thinkmachine.com) and aims to work the way you think.\n\nIt's simple. It's based on a hypergraph, which doesn't sound simple, but it is:\n\n```yaml\nTed Nelson,invented,HyperText\n```\n\nThat's it, a series of connected ideas. Typically separated by a `,` or `-\u003e`\n\n```yaml\nTim Berners-Lee -\u003e invented -\u003e WWW\n```\n\nWhat matters less is the syntax, and more that there are only two things:\n\n* Symbols\n* Connections\n\nTogether these form the building blocks of \u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e.\n\n\n## A New Kind of Knowledge Graph\n\nCurrent knowledge graphs limit how we think. They don't visualize information in the way it's actually shaped.\n\nMind Mapping tries to squeeze complex relationships into a 2D hierarchy—stripped of context, interconnections and intuition.\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is not about creating a simplified view of some information in your head—it's about getting lost in the forest, discovering deep insights, and finding your way back.\n\nHere is [Think Machine](https://thinkmachine.com), a frontend UI for the project.\n\n\u003cvideo src=\"videos/thinkmachine.mp4\" autoplay muted loop\u003e\u003c/video\u003e\n\n\n\n## Creating a ThinkableType file\n\nTo create a \u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e file, just create a CSV file with some connected ideas.\n\n```yaml\nTed Nelson,invented,HyperText\nTim Berners-Lee,invented,WWW\nHyperText,influenced,WWW\n```\n\nThis file gets read, parsed and then a knowledge graph gets created with all the proper connections.\n\nInterconnections are a core idea—called **interwingle**. Interwingle means knowledge is deeply interconnected and there isn't a clean way to divide it up.\n\nConnections, and other tools like PageRank, Text Similarity and LLMs, are all included to help you make sense of your data.\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e wants you to do the hard work of thinking—and then it will do everything it can to help you hit the high notes.\n\n\n## Using ThinkableType\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is a lot of things. It's a DSL, it's a parser, it's a hypergraph database, it's a text similarity vector search engine, it's an AI Research Copilot.\n\nBut at it's core, it's just a library — and getting started is easy.\n\n### Installing ThinkableType \n\nInstall from NPM:\n\n```bash\nnpm install @themaximalist/thinkabletype\n```\n\n### Load ThinkableType file\n\nYou can import an existing `.csv` file\n\n```javascript\nimport ThinkableType from \"@themaximalist/thinkabletype\"\nconst thinkabletype = ThinkableType.parse(\"ancient_sumerians.csv\");\n\n// or specify a different separator\nconst thinkabletype = ThinkableType.parse(\"secret_research_project.csv\", {\n  parse: {\n    delimiter: \" -\u003e \"\n  }\n});\n```\n\n#### Initialize with data\n\nYou can also initialize with an existing list of nodes and connections (called Hyperedges).\n\n```javascript\nconst hyperedges = [\n  [\"Plato\", \"student\", \"Socrates\"],\n  [\"Aristotle\", \"student\", \"Plato\"]\n];\n\nconst thinkabletype = new ThinkableType({ hyperedges });\n```\n\n#### Build programatically\n\nOr you can build up a file programatically\n\n```javascript\nconst thinkabletype = new ThinkableType();\nthinkabletype.add(\"Vannevar Bush\", \"author\", \"As We May Think\");\nthinkabletype.add(\"Ted Nelson\", \"invented\", \"HyperText\");\nthinkabletype.add(\"As We May Think\", \"influenced\", \"HyperText\");\n```\n\nYou can also build up a Hyperedge one symbol at a time.\n\n```javascript\nconst edge = thinkabletype.add(\"Vannevar Bush\");\nedge.add(\"invented\");\nedge.add(\"Memex\");\n```\n\n### Visualize ThinkableType\n\nConnections and visualizations are a core part of \u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e—so [Force Graph 3D](https://vasturiano.github.io/3d-force-graph/) is supported out of the box.\n\n```javascript\nconst thinkabletype = new ThinkableType({\n    hyperedges: [\n        [\"Hercules\", \"son\", \"Zeus\"],\n        [\"Hercules\", \"son\", \"Alcmene\"],\n    ],\n});\nconst data = thinkabletype.graphData(); // { nodes, links } for Force Graph 3D\n```\n\nIn addition, an `interwingle` parameter is available to control the interconnections of the graph.\n\n\n#### Interwingle Isolated\n\n`Isolated` displays hyperedges exactly as they're entered, with no interconnections.\n\n```javascript\nconst thinkabletype = new ThinkableType({\n    interwingle: ThinkableType.INTERWINGLE.ISOLATED,\n    hyperedges: [\n        [\"Hercules\", \"son\", \"Zeus\"],\n        [\"Hercules\", \"son\", \"Alcmene\"],\n    ],\n});\n\n// hyperedges are displayed exactly as entered\nconst data = thinkabletype.graphData();\n// Hercules -\u003e son -\u003e Zeus\n// Hercules -\u003e son -\u003e Alcmene\n```\n\n![Interwingle Isolated Think Machine Example](images/hercules-interwingle-1.png)\n\n#### Interwingle Confluence\n\n`Confluence` connects common parents.\n\n```javascript\nconst thinkabletype = new ThinkableType({\n    interwingle: ThinkableType.INTERWINGLE.CONFLUENCE,\n    hyperedges: [\n        [\"Hercules\", \"son\", \"Zeus\"],\n        [\"Hercules\", \"son\", \"Alcmene\"],\n    ],\n});\n\n// nodes shares common ancestors\nconst data = thinkabletype.graphData();\n//\n//                  / Zeus\n//  Herculues -\u003e son\n//                  \\ Alcmene\n//\n```\n\n![Interwingle Confluence Think Machine Example](images/hercules-interwingle-2.png)\n\n#### Interwingle Fusion\n\n`Fusion` connects starts, ends and direct connections.\n\n```javascript\nconst thinkabletype = new ThinkableType({\n    interwingle: ThinkableType.INTERWINGLE.FUSION,\n    hyperedges: [\n        [\"Plato\", \"student\", \"Socrates\"],\n        [\"Aristotle\", \"student\", \"Plato\"],\n    ],\n});\n\n// start and end nodes are fused together\nconst data = thinkabletype.graphData();\n// Aristotle -\u003e student -\u003e Plato -\u003e student -\u003e Socrates\n```\n\n![Interwingle Fusion Think Machine Example](images/aristotle-plato-socrates-interwingle-3.png)\n\n##### Direct Connect\n\nWhen a hyperedge is two nodes long—it's treated as a direct connection.\n\n```yaml\nA,B,C\n1,2,3\nB,2\n```\n\nIn this case, `B,2` says link every instance of **B** to every instance of **2**. So the other two edges `A,B,C` and `1,2,3` are linked together.\n\nThis is especially useful for making simpler connections than **Bridge** and can keep knowledge graphs structured as you intend.\n\n\n\n\n#### Interwingle Bridge\n\n`Bridge` connects common symbols with a bridge.\n\n```javascript\nconst thinkabletype = new ThinkableType({\n    interwingle: ThinkableType.INTERWINGLE.BRIDGE,\n    hyperedges: [\n        [\"Vannevar Bush\", \"author\", \"As We May Think\"],\n        [\"Ted Nelson\", \"author\", \"Computer Lib/Dream Machines\"],\n        [\"Tim Berners-Lee\", \"author\", \"Weaving the Web\"],\n    ],\n});\n\n// common symbols are connected through a bridge\nconst data = thinkabletype.graphData();\n//\n//  Vannevar Bush   -\u003e author -\u003e As We May Think\n//                     |\n//  Ted Nelson      -\u003e author -\u003e Computer Lib/Dream Machines\n//                     |\n//  Tim Berners-Lee -\u003e author -\u003e Weaving the Web\n```\n\n![Interwingle Bridge ThinkableType Example](images/authors-interwingle-4.png)\n\nThese four views give you control in how to visualize your knowledge graph and control interconnections between your data.\n\nAs you scale up the `interwingle` parameter, all the visualization layers start to combine. Using `Fusion` automatically includes `Confluence`. And using `Bridge` automatically includes `Fusion` and `Confluence`. This lets you increase the complexity of the knowledge graph, step-by-step.\n\n\n\n### PageRank\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e helps you find the most referenced symbols and connections by running `PageRank` on your knowledge graph.\n\n```javascript\nconst thinkabletype = ThinkableType.parse(`A,B,C\nA,B,D\nA,B,E\nA,C,Z`);\n\nawait thinkabletype.sync(); // syncs pagerank\nthinkabletype.pageranks // { A: \u003cnum\u003e, B: \u003cnum\u003e, ... }\nthinkabletype.pagerank(\"Z\") // { A: \u003cnum\u003e, C: \u003cnum\u003e, ... }\n```\n\nNote, \u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e aims to work with very large knowledge graphs, so we keep expensive operations like `PageRank` explicit and in the background, controlled through `await thinkabletype.sync()` or `await thinkabletype.syncPagerank().`\n\n### Embeddings and Vector Search\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e can find similar symbols and hyperedges, not only by the explicit connections, but by the text similarity.\n\nUsing [Embeddings.js](https://embeddingsjs.themaximalist.com) and [VectorDB.js](https://vectordbjs.themaximalist.com), you can find hidden connections in your knowledge graph.\n\nNote, both embeddings and vector search are local by default, but you can use embeddings from `OpenAI` with a few config lines.\n\n#### Find Similar Symbols\n\nFind similar symbols in the knowledge graph, on any edge.\n\n```javascript\nconst thinkabletype = ThinkableType.parse(`Red,Green,Blue\nWhite,Black,Gray`);\nawait thinkabletype.sync();\n\nawait thinkabletype.similarSymbols(\"Redish\");\n// [ { symbol: \"Red\": distance: 0.5 } ]\n```\n\n#### Find Similar Hyperedges\n\nFind similar hyperedges based on symbols.\n\n```javascript\nconst thinkabletype = new ThinkableType();\nconst edge1 = thinkabletype.add(\"Red\", \"Green\", \"Blue\");\nconst edge2 = thinkabletype.add(\"Red\", \"White\", \"Blue\");\nconst edge3 = thinkabletype.add(\"Bob\", \"Sally\", \"Bill\");\n\nawait thinkabletype.sync();\n\nawait edge1.similar(); // [ Hyperedge(\"Red\", \"White\", \"Blue\") ]\nawait edge2.similar(); // [ Hyperedge(\"Red\", \"Green\", \"Blue\") ]\n```\n\n### Searching\n\nSearching in \u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is easy, you can search by symbol, hyperedge or a partial\nhyperedge.\n\n```javascript\nconst thinkabletype = new ThinkableType({\n    hyperedges: [\n        [\"Ted Nelson\", \"invented\", \"Xanadu\"],\n        [\"Tim Berners-Lee\", \"invented\", \"WWW\"],\n        [\"Tim Berners-Lee\", \"author\", \"Weaving the Web\"],\n        // ...\n    ],\n});\nthinkabletype.filter(\"invented\").length; // 2\nthinkabletype.filter(\"Tim Berners-Lee\").length; // 2\nthinkabletype.filter(\"Tim Berners-Lee\", \"invented\").length; // 1\n```\n\n### AI Auto Suggest\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e has `suggest()` built in, which autocompletes any symbol or edge.\n\nUsing [LLM.js](https://llmjs.themaximalist.com), you can use any Large Language Model—like GPT-4, Claude, Mistral or local LLMs like [Llamafile](https://github.com/Mozilla-Ocho/llamafile).\n\n```javascript\nconst options = {\n    llm: {\n        service: \"openai\",\n        model: \"gpt-4-turbo-preview\"\n        apikey: process.env.OPENAI_API_KEY\n    }\n};\n\nconst thinkabletype = new ThinkableType(options);\nconst hyperedge = thinkabletype.add(\"Steve Jobs\", \"inventor\");\nthinkabletype.suggest(); // [\"iPhone\", \"Macintosh\", \"iPod\", ... ]\n```\n\nThis makes programatically expanding knowledge graphs with LLMs incredibly easy!\n\n### AI Generate\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e also has `generate()` built in, which generates hyperedges based on\nyour prompt. This is a great way to expand your knowledge graph in a particular\ndirection.\n\nJust like with AI Auto Suggest, you can use any LLM.\n\n```javascript\nconst options = {\n    llm: {\n        service: \"openai\",\n        model: \"gpt-4-turbo-preview\",\n        apikey: process.env.OPENAI_API_KEY,\n    },\n};\n\nconst thinkabletype = new ThinkableType(options);\nconst hyperedges = thinkabletype.generate(\"Steve Jobs\");\n// Steve Jobs,Apple Inc,CEO\n// Steve Jobs,NeXT,Founder\n// Steve Jobs,Macintosh,Personal Computers\n// Steve Jobs,iPad,Tablet Computing\n// ...\n```\n\n\n\n### CLI\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e ships with a command-line interfaces for searching and generating files.\n\n```bash\n\u003e thinkabletype epic of gilgamesh\nepic of gilgamesh,sumerian literature,ancient civilization  \nepic of gilgamesh,gilgamesh,enkidu,immortality,friendship  \nsumerian literature,cuneiform writing,mesopotamia\n...\n```\n\nBy default it writes to stdout, either copy and paste to a `.csv` file or redirect the out\n\n```bash\n\u003e thinkabletype mesopotamia \u003e mesopotamia.csv\n```\n\n\n\n## The Design of ThinkableType\n\nA language for ideas needs a structureless structure. That's exactly what Stephen Wolfram found hypergraphs to be while working on his Universal Theory of Physics project.\n\nTed Nelson created Zig Zag as a \"hyperstructure\" kit—a way to represent information in HyperText systems.\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e combines these ideas, using the hypergraph as the fundamental unit in the HyperText system.\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is a lot closer to symbolic programming than iterative programming. In iterative programming, you describe every little step. In symbolic programming, you describe the high-level concepts. It's top-down rather than bottom-up.\n\nSomething magical happens with symbolic programming. Like a looking glass, \"the program\" is a reflection of the connected symbols. It's a lot like language. You have legalese and then you have poetry.\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is not a programming language in and of itself—but this high-level connecting of ideas is creating a sum greater than it's parts.\n\n\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e is open source, and the file format is incredibly simple—just CSV files.\n\nIt's goal is to give you control over the knowledge and information in your life.\n\n\u003e File over app is a philosophy: if you want to create digital artifacts that last, they must be files you can control, in formats that are easy to retrieve and read. Use tools that give you this freedom.\n\u003e\n\u003e —[Steph Ango](https://stephango.com/file-over-app) (Obsidian Cofounder)\n\n\n\n## Alpha\n\n\u003ca href=\"https://github.com/themaximal1st/thinkabletype\"\u003e\u003cspan class=\"thinkable\"\u003eThinkable\u003cspan class=\"type\"\u003eType\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e is under heavy development and still subject to breaking changes.\n\n\n\n## Projects\n\nThinkableType is currently used in the following projects:\n\n-   [Think Machine](https://thinkmachine.com)\n\n\n\n## Author\n\n-   [The Maximalist](https://themaximalist.com/)\n-   [@themaximal1st](https://twitter.com/themaximal1st)\n\nCheck out these other projects we've made:\n\n-   [Infinity Arcade](https://infinityarcade.com) — play any text adventure game\n-   [News Score](https://newsscore.com) — score and sort the news\n-   [AI Image Explorer](https://aiimageexplorer.com) — image explorer\n-   [Minds App](https://mindsapp.com) — AI chat in your menubar\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemaximalist%2Fthinkabletype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemaximalist%2Fthinkabletype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemaximalist%2Fthinkabletype/lists"}