Welcome to the Logicverse. We wanted to make a simulation of humanity, in the online era. It works almost completely deterministically (aside from some small frontend ML to associate faces with people in our knowledge base).

Analytical conversationalist

We scraped a bunch of data from the HN discord, GitHub, LinkedIn (we got banned 4 times), Devpost about the interests, likes, projects, histories, and more of our fellow hackers. Then from this we built up a huge knowledge-base of ~90,000 relational facts in a logic programming language to derive conversation (which is I think how humans do conversation too).

Conversation is defined purely logically. For example, this query identifies a possible topic of conversation between two interlocutors who recently "did a similar activity". This is indicated by the <didRecently> relation. The knowledge-base engine can run dozens of these queries against tens of thousands of facts and figure out possible dialogue.

SELECT ?cmd
        WHERE {
            GRAPH <metaverse/graph/scene> {
                ?A <is> <present> .
                ?B <is> <present> .
                ?A <alias> ?aliasA .
                ?B <alias> ?aliasB .
            }
            ?A <didRecently> ?activity .
            ?B <didRecently> ?activity .
            ?activity <name> ?activityName .
            FILTER (?A != ?B)
            BIND (CONCAT(
                ?aliasA, " (to ", ?aliasB, "): Have you been doing ", ?activityName, " lately? So have I!\n\n",
                ?aliasB, ": Great minds."
            ) as ?cmd)
        }

Sometimes people will have very little in common, in which case we encode topics of possible smalltalk, and in the extreme case, topics that an individual may talk or think about with themselves.

Formal speech

The dialogues are presented as scripts in a custom domain specific language that we designed.

[Zac wearing short long wig, costume XY3P ]
[Amber wearing blonde long wig, costume AG0R , ginger beard]
[enter Zac from stage left]
Zac: I think, therefore I am.
[enter Amber from stage right]
[cross Amber to Zac]
amber (to Zac): I won First Place at HackNotts '25, did I mention?
Zac (thinking): Only every time we meet.

These dialogues are chosen from a selection presented deterministically by our librettist (a Rust module), and sent to the renderer to be realised in the real world. The renderer interprets these stage directions line by line just as humans would.

Who's there?

When a human sits down in front of our TV,

our system knows. It figures out who has appeared, and creates a virtual alter-ego of them within the screen. These are the subjects and the objects of our facts and relations, and of the conversations to be had with the other inhabitants.

Tech

We wrote the project in pretty much all Rust--taking a fairly low level approach to the graphics with Bevy--plus a little Python for some web scraping.

The knowledge-base is built with the amazing SPARQL query language against RDL Turtle data.

Scraping

We wrote scrapers for Discord, Github, and Devpost. Discord was the hardest because we had no admin access. Instead we automated the browser, scripting the clicks that open each member’s full profile and reading the HTML.

GitHub and Devpost were easier, since both expose their data in a structured form. Devpost was especially useful because many people list their full names. We use those names in the display and in the script language.

We also linked the profiles with relations such as “collaborates with” and “follows”, and with identity links that connect one person’s accounts across platforms.

Built With

  • logic-programming
  • rust
Share this project:

Updates

Submission history