Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Elijas/d7c4004904f394f87265447f40baf83b to your computer and use it in GitHub Desktop.
Save Elijas/d7c4004904f394f87265447f40baf83b to your computer and use it in GitHub Desktop.
brainstorm-fundamental-building-blocks-for-ai-systems.txt
LEGEND
<processing>
[data]
+ binary operator for structurally separable data
& binary operator for structurally inseparable data
(e.g. data and instructions in prompts are mixed up)
█ lines are the parts that are FUNCTION IMPLEMENTATION
| lines are the parts that are just scaffolding/definitions
BAML provides all scaffolding to create LLM FUNCTIONS
how does a good scaffolding AGENT FUNCTION look like
/======= FUNCTION =======\ # Actions are also FUNCTIONS
|
█ <processing>
|
| [structuredOutput]
|
\========================/
/=========== LLM FUNCTION ==========\
|
█ <llmRequestBuilder>
█ [ llmId
+ modelParams
+ instruction
& instructionContext
& structuredOutputDescr ]
|
| <llm> # baml sends request
|
| [completion]
|
| <parser> # baml parses completion
|
| [structuredOutput]
|
\====================================/
/===== LOOP STATE MANAGER FUNCTION ===\
|
| loop {
|
█ <loop state builder>
█ [ functionId
+ task
+ taskContext
+ workingMemory
+ actionsWithParamsDescr ]
|
|
| <function> # action routing AND action param filling
# usually this will be a single LLM FUNCTION
# but doesn't (!) HAVE to be
|
|
| [actionWithParams]
|
|
| <runner>
|
| }
|
| [structuredOutput] # also external effects of the actions taken
|
\====================================/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment