In a word, relations between Ptolemaic Egypt and the Roman Republic were complicated but I am going to force a few hundred more words on you talking about this so be warned.
From 323-225 BCE there is little to no evidence of any meaningful diplomatic contact between the two although both had an interest in what went on in Greece, Africa and Asia Minor. Rome and Egypt were for the most part indifferent to each other as the limits of the territory made them geographically and politically distant enough to not develop close bonds or serious hostilities. Even Carthage and most of the Greek city-states were too distant to come to the attention of the Ptolemies although Carthage and Egypt did struggle over Cyprus in the 3rd Century the island fell firmly into Ptolemaic hands. When it came to economy Egypt's most important exports were grain, olive oil, wine, figs and other staples but at that early stage Sicily and Italy were more important and in truth Egypt's agricultural and economic importance as a "bread-basket" did not reach the level often attributed to it until the 1st Century BCE, and particularly the latter half of the century at that. All in all, Rome and Egypt were certainly aware of each other but not particularly close in any way.
During the First Punic War Carthage did reach out to Egypt to ask for a loan to aid in their war with Rome however this was likely an indicator of desperation rather then friendly relations between Carthage and Egypt. Appian in his Histories references such an embassy being sent in 252
BOTH Romans and Carthaginians were destitute of money; and the Romans could no longer build ships, being exhausted by taxes, yet they levied foot soldiers and sent them to Africa and Sicily from year to year, while the Carthaginians sent an embassy to Ptolemy, the son of Ptolemy the son of Lagus, king of Egypt, seeking to borrow 2000 talents. He was on terms of friendship with both Romans and Carthaginians, and he sought to bring about peace between them. As he was not able to accomplish this, he said: "It behooves one to assist friends against enemies, but not against friends."
Livy states that after Rome's victory in the Second Punic War
In the meanwhile, C. Claudianus Nero, M. Aemilius Lepidus, and P. Sempronius Tuditanus were sent on a mission to Ptolemy, King of Egypt, to announce the final defeat of Hannibal and the Carthaginians and to thank the king for having remained a staunch friend to Rome at a critical time, when even her nearest allies deserted her. They were further to request him, in case Philip's aggressions compelled them to declare war against him, that he would maintain his own friendly attitude towards the Romans.
225-180: New Kings and Old Enmities
In 222 BCE Antiochus III (soon to be Antiochus the Great) is crowned king in the Seleucid Empire, in 221 Philip V is crowned king of Macedon and in the same year Ptolemy IV became king of Egypt (most of the power was then in the hands of his advisors) setting the stage for the conflicts to come. Antiochus III would form an alliance with Philip and attempt to invade and annex Coele-Syria from Ptolemy IV while Philip was also engaged with the Cretan War. Ptolemy dealt Antiochus a resounding defeat at the Battle of Raphia with the rapid conscription of maybe 30,000 Egyptian hoplites into the army who would then contribute to a domestic rebellion upon his death in 205. This rebellion would contribute to an already weakened Ptolemaic Kingdom and by 198 Coele-Syria and Ptolemaic Asia Minor would fall into his hands and Ptolemy V would put down the rebellion and then wed Antiochus III's daughter Cleopatra I ensuring a temporary peace. Although not allied with Egypt in any concerted war effort, their involvement in the Macedonian Wars against Philip and the Seleucids would help to prevent Antiochus III from pursuing further conquests in Ptolemaic territory and their subsequent wars with Macedon and the Seleucids would see the diminishing of Ptolemaic Egypt's rivals.
180-95 BCE: When it gets real
In 180 Ptolemy V dies and the crown passes to his son by Cleopatra I, Ptolemy VI who was reputed to be acting under the influence of his more experienced courtiers when he decided that the time was right to try to reclaim their lost Asiatic territories in 170. This was a serious mistake as the Seleucid grip on Syria was still strong and the new king Antiochus IV sought to flex his muscle to the west and annex Cyprus and Egypt which were still in Ptolemaic hands. Antiochus successfully invaded and conquered Egypt leaving all but Alexandria uncaptured and capturing Ptolemy VI. Ptolemy VIII Physkos and Cleopatra II the siblings of Ptolemy VI were installed as co-rulers of Egypt in Alexandria in opposition to Antiochus and the captured Ptolemy and
169 Antiochus withdrew from Egypt after attempting to lay siege against Alexandria. Ptolemy VI now free reconciles with his siblings and they rule jointly from here on. But Antiochus IV invaded again the following year, having himself coronated as Pharaoh in Memphis and attempting to conquer the whole of Egypt and Cyprus and annexing the Ptolemaic Kingdom once and for all.
Now obviously this was upsetting to the Egyptians but this also raised some serious concerns for the Roman Republic. After all, Antiochus IV had himself ambitious and by seeking new territory to the west he was positioning himself in such a way as to threaten Rome's dominance in the western Mediterranean and now he directly sought to impose himself as ruler rather than ruling through Ptolemy VI as a proxy.
At this point Rome stepped in and sought to curb the rapid expanse of Seleucid Empire. To this end they sent the Roman commander Gaius Popilius Laenas to mediate peace between both kingdoms and ensure that the Seleucid Empire did not grow too powerful through the annexation of Egypt. Polybius and Livy both state that Popilius intercepted Antiochus as he marched on Alexandria and presented him with the Senate's decree that he cease his war in Egypt which was met with reluctance by Antiochus although he was quick to offer amity to Popilius. Polybius gives the most detailed account of when Popilius forced Antiochus to make his decision
Happening to have a vine stick in his hand, he (Popilius) drew a circle round Antiochus with it, and ordered him to give his answer to the letter before he stepped out of that circumference. The king was taken aback by this haughty proceeding. After a brief interval of embarrassed silence, he replied that he would do whatever the Romans demanded
Antiochus apparently decided that Egypt was not worth making an enemy of Rome. Polybius attributed Antiochus's willingness to abandon his campaign to Rome's victory over Macedon in his account:
Popilius and his colleagues then restored order in Alexandria; and after exhorting the two kings to maintain peaceful relations with each other, and charging them at the same time to send Polyaratus to Rome, they took ship and sailed towards Cyprus, with the intention of promptly ejecting from the island the forces that were also gathered there. When they arrived, they found that Ptolemy's generals had already sustained a defeat, and that the whole island was in a state of excitement. They promptly caused the invading army to evacuate the country, and remained there to keep watch until the forces had sailed away for Syria. Thus did the Romans save the kingdom of Ptolemy, when it was all but sinking under its disasters. Fortune indeed so disposed of the fate of Perseus and the Macedonians, that the restoration of Alexandria and the whole of Egypt was decided by it; that is to say, by the fate of Perseus being decided previously: for if that had not taken place, or had not been certain, I do not think that Antiochus would have obeyed these orders.
The Seleucids would never invade Ptolemaic territory again and from here on Egyptian and Roman politics would gradually became intertwined. After this, civil war broke out between Ptolemy Physkos and Cleopatra II and Ptolemy VI was forced to flee the country and seek sanctuary in Rome in Oct. 164 BCE (the same year that Antiochus IV dies and the situation in Syria starts to unravel).
For the first but far from last time, the Roman Senate would act as guardian to the Ptolemaic Kingdom and made an arrangement of partitioning the kingdom between the warring siblings with Ptolemy VI to rule over Egypt and Cyprus with Cleopatra II and Ptolemy Physkos gaining sovereignty over Cyrene (in the area of modern Libya). As an aside, Physkos actually proposed to the prominent Roman matron Cornelia Africana but was turned down.
Ptolemy VI became embroiled in the dynastic struggles of the Seleucids by marrying his daughter Cleopatra Thea to Alexander Balas an impostor to the Seleucid throne who overthrew Demetrius I and successfully invading Syria in 145 to support Alexander Balas' claim. Alexander Balas then became afraid that Ptolemy would seek to overthrow him in turn and made an unsuccessful assassination attempt against him which prompted Ptolemy to join forces with Demetrius II and remarry his daughter to the legitimate Seleucid instead. In placing Demetrius II on the throne he passed up an opportunity to annex Syria whose populace seemed to support him in favour of a Seleucid and his primary motivation for this was fear of alarming the Roman Republic in the same fashion Antiochus III and IV had.
Ptolemy VI died within a few days of this and Ptolemy Physkos married his sister Cleopatra and further civil wars continue to divide the Ptolemaic kingdom in their reign and for the next half century. Around 140 Scipio Aemilianus was said to have made a visit to Alexandria and made a remarked "We have given the Alexandrians a rare sight; their king taking a walk" under his breath to his companions (Physkos actually means pot-bellied or blood sausage).