▲ | tosh 3 days ago | |
How are you generating the apps? Do you use an agent SDK or is it home grown? The everything in one EAV table concept sounds very interesting as well. Can you say more about that? What kind of queries does it support? Sounds a bit like datomic or datascript. How do you tell the agent to use it? | ||
▲ | stopachka 3 days ago | parent | next [-] | |
> Can you say more about that? What kind of queries does it support? Sounds a bit like datomic or datascript. How do you tell the agent to use it? Yes, we definitely take inspiration from datomic and datascript, as well as Tao (Facebook's DB). EAVs have a few good properties. First, it's more natural to do last-write-wins at the column level this way. Second, we get a real shot at creating a multi-tenant database. With EAVs you can either query them with datalog, or use SQL CTEs. Fun fact, on Instant's backend, we use a datalog-like langauge as intermediary representation, which ends up converting to a SQL CTE. Technically, you can make query on these as you can on a traditional SQL DB. To interact with all this, users (and in proxy agents) use a graphql-like language, called InstaQL. It's like if GraphQL was represented as plain javascript objects. Here's the system prompt, which shows these off: https://gist.github.com/stopachka/a6b07e1e6daeb85fa7c9555d8f... | ||
▲ | stopachka 3 days ago | parent | prev [-] | |
> Do you use an agent SDK or is it home grown? It's about 260 lines of home-grown code. Here's a snippet of how it looks: https://gist.github.com/stopachka/a38f00545d048661cf15a3cf4d... Two interesting things there: 1. Since Instant is reactive, we use it to convey the stream to the client. This way all chats are "resumable" by default, even if the user refreshes the page. 2. To make sure Instant writes don't block the stream, we use a "natural" buffer approach. Basically tokens from the LLM buffer up during every save. |