2626
2727-- Memories with PostGIS Point locations for spatial-filter tests.
2828-- SF and Oakland are in the Bay Area bbox; NYC is the negative control.
29+ -- Coordinates are chosen so SF <-> Oakland is ~13 km apart (outside 5 km
30+ -- radius of each other) and NYC is ~4100 km from SF.
2931INSERT INTO " agentic_db_app_public" .memories (id, agent_id, title, content, location, location_geo)
3032VALUES
3133 (
@@ -51,4 +53,147 @@ VALUES
5153 ' Agent-infra meetup in Manhattan.' ,
5254 ' New York, NY' ,
5355 ST_SetSRID(ST_MakePoint(- 74 .0060 , 40 .7128 ), 4326 )::geography
56+ ),
57+ -- Fourth memory ~260 m from the SF memory, so the self-referential
58+ -- `nearby_memories` relation has a matching "other" row for the
59+ -- "within 1 km of MEMORY_SF" test (the plugin excludes the owner row
60+ -- itself from self-relations). Coordinates are intentionally close to
61+ -- SF memory (-122.4194, 37.7749) and NOT the same as the Ferry Building
62+ -- Marketplace place (-122.3937, 37.7956), which is ~3.2 km away.
63+ (
64+ ' eeeeeeee-eeee-eeee-eeee-eeeeeeee0004' ,
65+ ' cccccccc-cccc-cccc-cccc-cccccccccccc' ,
66+ ' Quick walk nearby' ,
67+ ' Short walk a few blocks from the coffee spot.' ,
68+ ' San Francisco, CA' ,
69+ ST_SetSRID(ST_MakePoint(- 122 .4180 , 37 .7770 ), 4326 )::geography
70+ );
71+
72+ -- -----------------------------------------------------------------------
73+ -- Seed data for the RelationSpatial tests
74+ --
75+ -- Places: one next to the SF memory (~200 m), one next to NYC (~300 m),
76+ -- one in Tokyo (negative control). The SF place is ~13 km from Oakland,
77+ -- so "memories within 5 km of places" should pick up SF memory only for
78+ -- the first place, Oakland for none, and NYC for the NYC place.
79+ -- -----------------------------------------------------------------------
80+ INSERT INTO " agentic_db_app_public" .places (id, name, address, category, location_geo)
81+ VALUES
82+ (
83+ ' dddddddd-dddd-dddd-dddd-dddddddd0001' ,
84+ ' Ferry Building Marketplace' ,
85+ ' 1 Ferry Building, San Francisco, CA' ,
86+ ' market' ,
87+ ST_SetSRID(ST_MakePoint(- 122 .3937 , 37 .7956 ), 4326 )::geography
88+ ),
89+ (
90+ ' dddddddd-dddd-dddd-dddd-dddddddd0002' ,
91+ ' Bryant Park' ,
92+ ' NYC, NY' ,
93+ ' park' ,
94+ ST_SetSRID(ST_MakePoint(- 73 .9832 , 40 .7536 ), 4326 )::geography
95+ ),
96+ (
97+ ' dddddddd-dddd-dddd-dddd-dddddddd0003' ,
98+ ' Shibuya Crossing' ,
99+ ' Tokyo, Japan' ,
100+ ' landmark' ,
101+ ST_SetSRID(ST_MakePoint(139 .7005 , 35 .6595 ), 4326 )::geography
102+ );
103+
104+ -- Update the two seeded contacts with location_geo so the
105+ -- memories.nearby_contacts relation has something to match.
106+ -- Alice near the SF memory (~250 m), Bob in NYC (~400 m).
107+ UPDATE " agentic_db_app_public" .contacts
108+ SET location = ' San Francisco, CA' ,
109+ location_geo = ST_SetSRID(ST_MakePoint(- 122 .4214 , 37 .7775 ), 4326 )::geography
110+ WHERE id = ' 11111111-1111-1111-1111-111111111111' ;
111+
112+ UPDATE " agentic_db_app_public" .contacts
113+ SET location = ' New York, NY' ,
114+ location_geo = ST_SetSRID(ST_MakePoint(- 74 .0021 , 40 .7105 ), 4326 )::geography
115+ WHERE id = ' 22222222-2222-2222-2222-222222222222' ;
116+
117+ -- Venues: Bay Area SoMa (~1 km from SF memory), NYC (~350 m from NYC
118+ -- memory), London (negative control).
119+ INSERT INTO " agentic_db_app_public" .venues (id, name, address, neighborhood, category, location)
120+ VALUES
121+ (
122+ ' ffffffff-ffff-ffff-ffff-ffffffff0001' ,
123+ ' SoMa Coffee Bar' ,
124+ ' 500 Howard St, San Francisco, CA' ,
125+ ' SoMa' ,
126+ ' cafe' ,
127+ ST_SetSRID(ST_MakePoint(- 122 .3985 , 37 .7879 ), 4326 )::geography
128+ ),
129+ (
130+ ' ffffffff-ffff-ffff-ffff-ffffffff0002' ,
131+ ' Times Square Diner' ,
132+ ' 1500 Broadway, New York, NY' ,
133+ ' Midtown' ,
134+ ' restaurant' ,
135+ ST_SetSRID(ST_MakePoint(- 73 .9855 , 40 .7580 ), 4326 )::geography
136+ ),
137+ (
138+ ' ffffffff-ffff-ffff-ffff-ffffffff0003' ,
139+ ' London Bridge Pub' ,
140+ ' Tooley St, London' ,
141+ ' London Bridge' ,
142+ ' bar' ,
143+ ST_SetSRID(ST_MakePoint(- 0 .0877 , 51 .5045 ), 4326 )::geography
144+ );
145+
146+ -- Trips: one destined SF (near SoMa venue), one destined NYC, one
147+ -- destined Paris (negative control).
148+ INSERT INTO " agentic_db_app_public" .trips (id, name, destination, description, destination_geo)
149+ VALUES
150+ (
151+ ' 99999999-9999-9999-9999-999999990001' ,
152+ ' SF Retrieval Summit' ,
153+ ' San Francisco, CA' ,
154+ ' Week-long onsite with the retrieval team.' ,
155+ ST_SetSRID(ST_MakePoint(- 122 .3990 , 37 .7880 ), 4326 )::geography
156+ ),
157+ (
158+ ' 99999999-9999-9999-9999-999999990002' ,
159+ ' NYC AI Conf' ,
160+ ' New York, NY' ,
161+ ' Speaker slot at AI Conf.' ,
162+ ST_SetSRID(ST_MakePoint(- 73 .9860 , 40 .7585 ), 4326 )::geography
163+ ),
164+ (
165+ ' 99999999-9999-9999-9999-999999990003' ,
166+ ' Paris Offsite' ,
167+ ' Paris, France' ,
168+ ' Engineering offsite.' ,
169+ ST_SetSRID(ST_MakePoint(2 .3522 , 48 .8566 ), 4326 )::geography
170+ );
171+
172+ -- Events: one right at the NYC venue (~50 m), one in SF far from SoMa
173+ -- (~2 km away, outside 500 m), one in Berlin (negative control).
174+ INSERT INTO " agentic_db_app_public" .events (id, name, event_type, location, city, location_geo)
175+ VALUES
176+ (
177+ ' 88888888-8888-8888-8888-888888880001' ,
178+ ' AI Conf Welcome Reception' ,
179+ ' conference' ,
180+ ' Times Square' ,
181+ ' New York' ,
182+ ST_SetSRID(ST_MakePoint(- 73 .9853 , 40 .7582 ), 4326 )::geography
183+ ),
184+ (
185+ ' 88888888-8888-8888-8888-888888880002' ,
186+ ' SF Ferry Building Mixer' ,
187+ ' meetup' ,
188+ ' Ferry Building' ,
189+ ' San Francisco' ,
190+ ST_SetSRID(ST_MakePoint(- 122 .3937 , 37 .7956 ), 4326 )::geography
191+ ),
192+ (
193+ ' 88888888-8888-8888-8888-888888880003' ,
194+ ' Berlin Hackathon' ,
195+ ' hackathon' ,
196+ ' Kreuzberg' ,
197+ ' Berlin' ,
198+ ST_SetSRID(ST_MakePoint(13 .4050 , 52 .5200 ), 4326 )::geography
54199 );
0 commit comments