PocketFlow icon indicating copy to clipboard operation
PocketFlow copied to clipboard

do you have not string conditions for connection between object

Open Sandy4321 opened this issue 9 months ago • 3 comments

do you have not string conditions for connection between object is it possible to send numbers like 23.67 from one agent to another another. So for agent B 23.67 is output and for agent H 23.67 is input of even object like class: one agent output is object, for another agent this object is input

Connect nodes

prep_embeddings >> find_relevant find_relevant - "answer" >> answer find_relevant - "end" >> None answer - "continue" >> find_relevant

Sandy4321 avatar Mar 07 '25 21:03 Sandy4321

Hey @Sandy4321,

No, this is a deliberate design choice: Communication Models. Nodes and agents communicate through a shared store rather than through messages.

The short reason is that message schemas become difficult to manage as you scale to a large number of agents or nodes. Instead, the good practice is to define the shared store schema ahead of time, and all future development will use that schema.

See the example shared store schema (ask AI to help you design the schema!!): https://github.com/The-Pocket/Tutorial-Youtube-Made-Simple/blob/main/docs/design.md#data-structure https://github.com/cold-outreach/Tutorial-Cold-Email-Personalization/blob/master/docs/design.md#4-data-schema https://github.com/AI-Paul-Graham/Tutorial-YC-Partner/blob/main/docs/design.md#data-structure

In your case, you could give the number a descriptive name and store it as a key-value pair in the shared store. For example, if 23.67 represents a temperature value, you could have agent B post:

shared["temperature"] = 23.67

And then agent H could retrieve it in prep as:

temperature = shared["temperature"]

zachary62 avatar Mar 07 '25 21:03 zachary62

looks great do you have code sample for large number of agents or nodes?

Sandy4321 avatar Mar 11 '25 13:03 Sandy4321

I made some example applications: https://github.com/AI-Paul-Graham/Tutorial-YC-Partner https://github.com/The-Pocket/Tutorial-Youtube-Made-Simple https://github.com/cold-outreach/Tutorial-Cold-Email-Personalization

Also check out this community-made guide: https://github.com/alancriaxyz/pocketflow-academy

Let me know if any particular applcations you have in mind

zachary62 avatar Mar 11 '25 14:03 zachary62