Skip to content

Latest commit

 

History

History
46 lines (42 loc) · 1.42 KB

README.md

File metadata and controls

46 lines (42 loc) · 1.42 KB

surrealdb-live-message

  • demonstrates a light message layer for multi-agent interaction, based on surrealdb live query. Message records are sent by establishing a graph relation from sending agent to receiving agent.

Requirements

Test

# run the integration test
cargo test --test integration_test

Run

Terminal 1

# start the app
cargo run
# when finished with client below, hit ctrl-c to view the log outputs from the subsystem and listener shutdowns

Terminal 2

# start surrealdb client
surreal sql --user root --pass root --namespace test --database test
# message from bob to alice
RELATE agent:bob->message->agent:alice 
	CONTENT {
		created: time::now(),
        	payload: { Text: { content: 'Hello, Alice!' } },
	};
# message from alice to bob
RELATE agent:alice->message->agent:bob 
	CONTENT {
		created: time::now(),
        	payload: { Text: { content: 'Hello, Bob!' } },
	};

# check messages
select * from message

Documentation

For detailed documentation on SurrealDB, visit SurrealDB's Documentation.

Acknowledgments