You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Avraham Sakal 84eaab08ea expand use of react-query for state management 1 month ago
..
@id expand use of react-query for state management 1 month ago
+Page.tsx example of SSE streaming 2 months ago
README.md setup postgres and kyseley for most data instead of milvus 3 months ago
conversations.ts transition to postgresql for persistence layer 1 month ago
fact-triggers.ts expand use of react-query for state management 1 month ago
facts.ts transition to postgresql for persistence layer 1 month ago
messages.ts transition to postgresql for persistence layer 1 month ago
provider.ts transition to postgresql for persistence layer 1 month ago
trpc.ts transition to postgresql for persistence layer 1 month ago

README.md

The system begins with a generic system prompt.

The user begins interacting with the model, perhaps introducing himself. Perhaps the initial UI should contain a pre-filled message as if it's from the model, saying "Hi, I'm {name}. Tell me about yourself or what you want me to do."

Every time the user submits a message, the backend should:

  • Save the message to the database under a conversation id for later lookup
  • Generate a new message from the model, and add it to the database. The model should be given the conversation summary thus far, and of course the user's latest message, unmodified. Invite the model to create any tools it needs. The tool needs to be implemented in a language which this system can execute; usually an interpretted language like Python or JavaScript.
  • Extract Facts from the user's message, and add them to the database, linking the Facts with the messages they came from. (Yes, this should be done after the model response, not before; because when we run a query to find Facts to inject into the context sent to the model, we don't want Facts from the user's current message to be candidates for injection, because we're sending the user's message unadulterated to the model; there's no reason to inject the same Facts that the model is already using to generate its response.)
  • Extract Facts from the model's response, and add them to the database, linking the Facts with the messages they came from.
  • For each Fact produced in the two fact-extraction steps, generate FactTriggers and add them to the database, linking the FactTriggers with the Facts they came from. A FactTrigger is a natural language phrase that describes a situation in which it would be useful to invoke the Fact. (e.g., "When food preferences are discussed").
  • Produce a running summary of the conversation, and save that to the database.
  • Update the UI to show the new message.