In most cases you would run the ag pipe under the wall, from the lowest point to a drain point in the yard.
If you don't have a stormwater in the yard then......your stuffed! (well, not really)
What you are trying to avoid here is having your garden bed act like a pool and retain any water and then have the wall fall over.