remdb 0.2.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of remdb might be problematic. Click here for more details.

Files changed (187) hide show
  1. rem/__init__.py +2 -0
  2. rem/agentic/README.md +650 -0
  3. rem/agentic/__init__.py +39 -0
  4. rem/agentic/agents/README.md +155 -0
  5. rem/agentic/agents/__init__.py +8 -0
  6. rem/agentic/context.py +148 -0
  7. rem/agentic/context_builder.py +329 -0
  8. rem/agentic/mcp/__init__.py +0 -0
  9. rem/agentic/mcp/tool_wrapper.py +107 -0
  10. rem/agentic/otel/__init__.py +5 -0
  11. rem/agentic/otel/setup.py +151 -0
  12. rem/agentic/providers/phoenix.py +674 -0
  13. rem/agentic/providers/pydantic_ai.py +572 -0
  14. rem/agentic/query.py +117 -0
  15. rem/agentic/query_helper.py +89 -0
  16. rem/agentic/schema.py +396 -0
  17. rem/agentic/serialization.py +245 -0
  18. rem/agentic/tools/__init__.py +5 -0
  19. rem/agentic/tools/rem_tools.py +231 -0
  20. rem/api/README.md +420 -0
  21. rem/api/main.py +324 -0
  22. rem/api/mcp_router/prompts.py +182 -0
  23. rem/api/mcp_router/resources.py +536 -0
  24. rem/api/mcp_router/server.py +213 -0
  25. rem/api/mcp_router/tools.py +584 -0
  26. rem/api/routers/auth.py +229 -0
  27. rem/api/routers/chat/__init__.py +5 -0
  28. rem/api/routers/chat/completions.py +281 -0
  29. rem/api/routers/chat/json_utils.py +76 -0
  30. rem/api/routers/chat/models.py +124 -0
  31. rem/api/routers/chat/streaming.py +185 -0
  32. rem/auth/README.md +258 -0
  33. rem/auth/__init__.py +26 -0
  34. rem/auth/middleware.py +100 -0
  35. rem/auth/providers/__init__.py +13 -0
  36. rem/auth/providers/base.py +376 -0
  37. rem/auth/providers/google.py +163 -0
  38. rem/auth/providers/microsoft.py +237 -0
  39. rem/cli/README.md +455 -0
  40. rem/cli/__init__.py +8 -0
  41. rem/cli/commands/README.md +126 -0
  42. rem/cli/commands/__init__.py +3 -0
  43. rem/cli/commands/ask.py +565 -0
  44. rem/cli/commands/configure.py +423 -0
  45. rem/cli/commands/db.py +493 -0
  46. rem/cli/commands/dreaming.py +324 -0
  47. rem/cli/commands/experiments.py +1124 -0
  48. rem/cli/commands/mcp.py +66 -0
  49. rem/cli/commands/process.py +245 -0
  50. rem/cli/commands/schema.py +183 -0
  51. rem/cli/commands/serve.py +106 -0
  52. rem/cli/dreaming.py +363 -0
  53. rem/cli/main.py +88 -0
  54. rem/config.py +237 -0
  55. rem/mcp_server.py +41 -0
  56. rem/models/core/__init__.py +49 -0
  57. rem/models/core/core_model.py +64 -0
  58. rem/models/core/engram.py +333 -0
  59. rem/models/core/experiment.py +628 -0
  60. rem/models/core/inline_edge.py +132 -0
  61. rem/models/core/rem_query.py +243 -0
  62. rem/models/entities/__init__.py +43 -0
  63. rem/models/entities/file.py +57 -0
  64. rem/models/entities/image_resource.py +88 -0
  65. rem/models/entities/message.py +35 -0
  66. rem/models/entities/moment.py +123 -0
  67. rem/models/entities/ontology.py +191 -0
  68. rem/models/entities/ontology_config.py +131 -0
  69. rem/models/entities/resource.py +95 -0
  70. rem/models/entities/schema.py +87 -0
  71. rem/models/entities/user.py +85 -0
  72. rem/py.typed +0 -0
  73. rem/schemas/README.md +507 -0
  74. rem/schemas/__init__.py +6 -0
  75. rem/schemas/agents/README.md +92 -0
  76. rem/schemas/agents/core/moment-builder.yaml +178 -0
  77. rem/schemas/agents/core/rem-query-agent.yaml +226 -0
  78. rem/schemas/agents/core/resource-affinity-assessor.yaml +99 -0
  79. rem/schemas/agents/core/simple-assistant.yaml +19 -0
  80. rem/schemas/agents/core/user-profile-builder.yaml +163 -0
  81. rem/schemas/agents/examples/contract-analyzer.yaml +317 -0
  82. rem/schemas/agents/examples/contract-extractor.yaml +134 -0
  83. rem/schemas/agents/examples/cv-parser.yaml +263 -0
  84. rem/schemas/agents/examples/hello-world.yaml +37 -0
  85. rem/schemas/agents/examples/query.yaml +54 -0
  86. rem/schemas/agents/examples/simple.yaml +21 -0
  87. rem/schemas/agents/examples/test.yaml +29 -0
  88. rem/schemas/agents/rem.yaml +128 -0
  89. rem/schemas/evaluators/hello-world/default.yaml +77 -0
  90. rem/schemas/evaluators/rem/faithfulness.yaml +219 -0
  91. rem/schemas/evaluators/rem/lookup-correctness.yaml +182 -0
  92. rem/schemas/evaluators/rem/retrieval-precision.yaml +199 -0
  93. rem/schemas/evaluators/rem/retrieval-recall.yaml +211 -0
  94. rem/schemas/evaluators/rem/search-correctness.yaml +192 -0
  95. rem/services/__init__.py +16 -0
  96. rem/services/audio/INTEGRATION.md +308 -0
  97. rem/services/audio/README.md +376 -0
  98. rem/services/audio/__init__.py +15 -0
  99. rem/services/audio/chunker.py +354 -0
  100. rem/services/audio/transcriber.py +259 -0
  101. rem/services/content/README.md +1269 -0
  102. rem/services/content/__init__.py +5 -0
  103. rem/services/content/providers.py +806 -0
  104. rem/services/content/service.py +657 -0
  105. rem/services/dreaming/README.md +230 -0
  106. rem/services/dreaming/__init__.py +53 -0
  107. rem/services/dreaming/affinity_service.py +336 -0
  108. rem/services/dreaming/moment_service.py +264 -0
  109. rem/services/dreaming/ontology_service.py +54 -0
  110. rem/services/dreaming/user_model_service.py +297 -0
  111. rem/services/dreaming/utils.py +39 -0
  112. rem/services/embeddings/__init__.py +11 -0
  113. rem/services/embeddings/api.py +120 -0
  114. rem/services/embeddings/worker.py +421 -0
  115. rem/services/fs/README.md +662 -0
  116. rem/services/fs/__init__.py +62 -0
  117. rem/services/fs/examples.py +206 -0
  118. rem/services/fs/examples_paths.py +204 -0
  119. rem/services/fs/git_provider.py +935 -0
  120. rem/services/fs/local_provider.py +760 -0
  121. rem/services/fs/parsing-hooks-examples.md +172 -0
  122. rem/services/fs/paths.py +276 -0
  123. rem/services/fs/provider.py +460 -0
  124. rem/services/fs/s3_provider.py +1042 -0
  125. rem/services/fs/service.py +186 -0
  126. rem/services/git/README.md +1075 -0
  127. rem/services/git/__init__.py +17 -0
  128. rem/services/git/service.py +469 -0
  129. rem/services/phoenix/EXPERIMENT_DESIGN.md +1146 -0
  130. rem/services/phoenix/README.md +453 -0
  131. rem/services/phoenix/__init__.py +46 -0
  132. rem/services/phoenix/client.py +686 -0
  133. rem/services/phoenix/config.py +88 -0
  134. rem/services/phoenix/prompt_labels.py +477 -0
  135. rem/services/postgres/README.md +575 -0
  136. rem/services/postgres/__init__.py +23 -0
  137. rem/services/postgres/migration_service.py +427 -0
  138. rem/services/postgres/pydantic_to_sqlalchemy.py +232 -0
  139. rem/services/postgres/register_type.py +352 -0
  140. rem/services/postgres/repository.py +337 -0
  141. rem/services/postgres/schema_generator.py +379 -0
  142. rem/services/postgres/service.py +802 -0
  143. rem/services/postgres/sql_builder.py +354 -0
  144. rem/services/rem/README.md +304 -0
  145. rem/services/rem/__init__.py +23 -0
  146. rem/services/rem/exceptions.py +71 -0
  147. rem/services/rem/executor.py +293 -0
  148. rem/services/rem/parser.py +145 -0
  149. rem/services/rem/queries.py +196 -0
  150. rem/services/rem/query.py +371 -0
  151. rem/services/rem/service.py +527 -0
  152. rem/services/session/README.md +374 -0
  153. rem/services/session/__init__.py +6 -0
  154. rem/services/session/compression.py +360 -0
  155. rem/services/session/reload.py +77 -0
  156. rem/settings.py +1235 -0
  157. rem/sql/002_install_models.sql +1068 -0
  158. rem/sql/background_indexes.sql +42 -0
  159. rem/sql/install_models.sql +1038 -0
  160. rem/sql/migrations/001_install.sql +503 -0
  161. rem/sql/migrations/002_install_models.sql +1202 -0
  162. rem/utils/AGENTIC_CHUNKING.md +597 -0
  163. rem/utils/README.md +583 -0
  164. rem/utils/__init__.py +43 -0
  165. rem/utils/agentic_chunking.py +622 -0
  166. rem/utils/batch_ops.py +343 -0
  167. rem/utils/chunking.py +108 -0
  168. rem/utils/clip_embeddings.py +276 -0
  169. rem/utils/dict_utils.py +98 -0
  170. rem/utils/embeddings.py +423 -0
  171. rem/utils/examples/embeddings_example.py +305 -0
  172. rem/utils/examples/sql_types_example.py +202 -0
  173. rem/utils/markdown.py +16 -0
  174. rem/utils/model_helpers.py +236 -0
  175. rem/utils/schema_loader.py +229 -0
  176. rem/utils/sql_types.py +348 -0
  177. rem/utils/user_id.py +81 -0
  178. rem/utils/vision.py +330 -0
  179. rem/workers/README.md +506 -0
  180. rem/workers/__init__.py +5 -0
  181. rem/workers/dreaming.py +502 -0
  182. rem/workers/engram_processor.py +312 -0
  183. rem/workers/sqs_file_processor.py +193 -0
  184. remdb-0.2.6.dist-info/METADATA +1191 -0
  185. remdb-0.2.6.dist-info/RECORD +187 -0
  186. remdb-0.2.6.dist-info/WHEEL +4 -0
  187. remdb-0.2.6.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,263 @@
1
+ ---
2
+ # CV/Resume Parser Agent Schema
3
+ # Extracts structured candidate information from resumes and CVs
4
+ # Designed for recruitment consultants and HR teams
5
+
6
+ type: object
7
+ description: |
8
+ You are a CV/Resume Parser specialized in extracting structured candidate information.
9
+
10
+ Your task is to analyze the provided CV/resume text and extract:
11
+ - Candidate name and contact details
12
+ - Professional summary
13
+ - Technical and soft skills
14
+ - Work experience with achievements
15
+ - Education history
16
+ - Certifications and awards
17
+ - Languages spoken
18
+
19
+ Guidelines:
20
+ - Extract information accurately without hallucination
21
+ - Preserve exact company names, job titles, and dates
22
+ - Quantify achievements where possible (e.g., "Reduced costs by 40%")
23
+ - Normalize skill names (e.g., "k8s" -> "Kubernetes")
24
+ - Assign confidence score based on clarity of information
25
+ - If information is unclear or missing, use null instead of guessing
26
+
27
+ Output Format:
28
+ - Return structured JSON matching the schema below
29
+ - Ensure all dates are in ISO 8601 format (YYYY-MM-DD)
30
+ - Use arrays for lists (skills, experience, education)
31
+ - Include confidence_score (0.0-1.0) for overall extraction quality
32
+
33
+ properties:
34
+ candidate_name:
35
+ type: string
36
+ description: Full name of the candidate
37
+
38
+ email:
39
+ type: string
40
+ description: Email address
41
+ format: email
42
+
43
+ phone:
44
+ type: string
45
+ description: Phone number
46
+
47
+ location:
48
+ type: string
49
+ description: Current location (city, country)
50
+
51
+ linkedin_url:
52
+ type: string
53
+ description: LinkedIn profile URL
54
+ format: uri
55
+
56
+ github_url:
57
+ type: string
58
+ description: GitHub profile URL
59
+ format: uri
60
+
61
+ professional_summary:
62
+ type: string
63
+ description: Brief professional summary or career objective (2-3 sentences)
64
+
65
+ skills:
66
+ type: array
67
+ description: List of technical and professional skills
68
+ items:
69
+ type: object
70
+ properties:
71
+ name:
72
+ type: string
73
+ description: Skill name (normalized)
74
+ category:
75
+ type: string
76
+ description: Skill category (e.g., "programming", "cloud", "soft-skill")
77
+ enum:
78
+ - programming
79
+ - cloud
80
+ - database
81
+ - devops
82
+ - security
83
+ - design
84
+ - management
85
+ - soft-skill
86
+ - other
87
+ proficiency:
88
+ type: string
89
+ description: Proficiency level if specified
90
+ enum:
91
+ - beginner
92
+ - intermediate
93
+ - advanced
94
+ - expert
95
+ required:
96
+ - name
97
+ - category
98
+
99
+ experience:
100
+ type: array
101
+ description: Work experience history (most recent first)
102
+ items:
103
+ type: object
104
+ properties:
105
+ company:
106
+ type: string
107
+ description: Company name
108
+ role:
109
+ type: string
110
+ description: Job title
111
+ start_date:
112
+ type: string
113
+ description: Start date (YYYY-MM-DD or YYYY-MM)
114
+ end_date:
115
+ type: string
116
+ description: End date (YYYY-MM-DD, YYYY-MM, or "present")
117
+ location:
118
+ type: string
119
+ description: Job location
120
+ description:
121
+ type: string
122
+ description: Role description
123
+ achievements:
124
+ type: array
125
+ description: Key achievements and responsibilities
126
+ items:
127
+ type: string
128
+ technologies:
129
+ type: array
130
+ description: Technologies used in this role
131
+ items:
132
+ type: string
133
+ required:
134
+ - company
135
+ - role
136
+ - start_date
137
+
138
+ education:
139
+ type: array
140
+ description: Education history
141
+ items:
142
+ type: object
143
+ properties:
144
+ institution:
145
+ type: string
146
+ description: University or institution name
147
+ degree:
148
+ type: string
149
+ description: Degree or qualification (e.g., "BS Computer Science")
150
+ field_of_study:
151
+ type: string
152
+ description: Major or field of study
153
+ graduation_year:
154
+ type: integer
155
+ description: Graduation year
156
+ gpa:
157
+ type: string
158
+ description: GPA if mentioned
159
+ required:
160
+ - institution
161
+ - degree
162
+
163
+ certifications:
164
+ type: array
165
+ description: Professional certifications
166
+ items:
167
+ type: object
168
+ properties:
169
+ name:
170
+ type: string
171
+ description: Certification name
172
+ issuer:
173
+ type: string
174
+ description: Issuing organization
175
+ date:
176
+ type: string
177
+ description: Issue date (YYYY-MM-DD or YYYY-MM)
178
+ expiry_date:
179
+ type: string
180
+ description: Expiry date if applicable
181
+ required:
182
+ - name
183
+ - issuer
184
+
185
+ languages:
186
+ type: array
187
+ description: Languages spoken
188
+ items:
189
+ type: object
190
+ properties:
191
+ language:
192
+ type: string
193
+ description: Language name
194
+ proficiency:
195
+ type: string
196
+ description: Proficiency level
197
+ enum:
198
+ - native
199
+ - fluent
200
+ - professional
201
+ - intermediate
202
+ - basic
203
+ required:
204
+ - language
205
+ - proficiency
206
+
207
+ awards:
208
+ type: array
209
+ description: Awards and recognitions
210
+ items:
211
+ type: string
212
+
213
+ years_of_experience:
214
+ type: integer
215
+ description: Total years of professional experience (calculated)
216
+ minimum: 0
217
+
218
+ seniority_level:
219
+ type: string
220
+ description: Estimated seniority level based on experience
221
+ enum:
222
+ - entry
223
+ - mid
224
+ - senior
225
+ - lead
226
+ - principal
227
+ - executive
228
+
229
+ confidence_score:
230
+ type: number
231
+ description: Confidence score for extraction quality (0.0-1.0)
232
+ minimum: 0.0
233
+ maximum: 1.0
234
+
235
+ required:
236
+ - candidate_name
237
+ - professional_summary
238
+ - skills
239
+ - experience
240
+ - education
241
+ - confidence_score
242
+
243
+ json_schema_extra:
244
+ kind: agent
245
+ name: cv-parser
246
+ version: "1.0.0"
247
+ tags:
248
+ - recruitment
249
+ - hr
250
+ - ontology-extractor
251
+ author: REM Team
252
+ tools: []
253
+ resources: []
254
+ provider_configs:
255
+ - provider_name: anthropic
256
+ model_name: claude-sonnet-4-5-20250929
257
+ - provider_name: openai
258
+ model_name: gpt-4o
259
+ embedding_fields:
260
+ - candidate_name
261
+ - professional_summary
262
+ - skills
263
+ - experience
@@ -0,0 +1,37 @@
1
+ type: object
2
+ description: 'You are a helpful assistant that responds to simple questions.
3
+
4
+
5
+ Your job is to:
6
+
7
+ 1. Understand the user''s question
8
+
9
+ 2. Provide a clear, concise response
10
+
11
+ 3. Be friendly and helpful
12
+
13
+
14
+ Always aim to be accurate and informative.
15
+
16
+ '
17
+ properties:
18
+ response:
19
+ type: string
20
+ description: Your response to the user's question
21
+ confidence:
22
+ type: number
23
+ minimum: 0.0
24
+ maximum: 1.0
25
+ description: Your confidence in the response (0.0 = not confident, 1.0 = very
26
+ confident)
27
+ required:
28
+ - response
29
+ - confidence
30
+ json_schema_extra:
31
+ kind: agent
32
+ name: hello-world
33
+ version: 1.0.0
34
+ tags:
35
+ - test
36
+ - hello-world
37
+ category: test
@@ -0,0 +1,54 @@
1
+ type: object
2
+ description: 'REM Query Agent - Converts natural language questions to REM queries.
3
+
4
+
5
+ You are a specialized agent that understands REM (Resources Entities Moments) queries.
6
+
7
+ Your job is to interpret user questions and provide answers with confidence scores.
8
+
9
+
10
+ REM Query Types:
11
+
12
+ - LOOKUP: O(1) lookup by entity label
13
+
14
+ - FUZZY: Semantic search across entity types
15
+
16
+ - TRAVERSE: Graph traversal with depth control
17
+
18
+
19
+ Provide clear, structured answers with confidence scores based on:
20
+
21
+ - Query clarity (0.9+: precise, 0.7-0.9: clear intent, <0.7: ambiguous)
22
+
23
+ - Information completeness (do you have all needed context?)
24
+
25
+ - Result certainty (how confident are you in the answer?)
26
+
27
+ '
28
+ properties:
29
+ answer:
30
+ type: string
31
+ description: The answer to the user's query with supporting details
32
+ confidence:
33
+ type: number
34
+ minimum: 0
35
+ maximum: 1
36
+ description: Confidence score (0.0-1.0) for this answer
37
+ query_type:
38
+ type: string
39
+ enum:
40
+ - LOOKUP
41
+ - FUZZY
42
+ - TRAVERSE
43
+ - UNKNOWN
44
+ description: The type of REM query that would best answer this question
45
+ required:
46
+ - answer
47
+ - confidence
48
+ - query_type
49
+ json_schema_extra:
50
+ kind: agent
51
+ name: query
52
+ version: 1.0.0
53
+ tools: []
54
+ resources: []
@@ -0,0 +1,21 @@
1
+ type: object
2
+ description: 'A simple conversational agent that provides helpful, friendly responses.
3
+
4
+
5
+ You are a helpful AI assistant. Answer questions clearly and concisely.
6
+
7
+ If you don''t know something, say so. Be friendly and professional.
8
+
9
+ '
10
+ properties:
11
+ answer:
12
+ type: string
13
+ description: The response to the user's query
14
+ required:
15
+ - answer
16
+ json_schema_extra:
17
+ kind: agent
18
+ name: simple
19
+ version: 1.0.0
20
+ tools: []
21
+ resources: []
@@ -0,0 +1,29 @@
1
+ type: object
2
+ description: 'Test agent for Git provider versioning.
3
+
4
+
5
+ This is version 2.1.0 - added optional metadata field.
6
+
7
+ '
8
+ properties:
9
+ message:
10
+ type: string
11
+ description: A simple message field
12
+ confidence:
13
+ type: number
14
+ minimum: 0
15
+ maximum: 1
16
+ description: Confidence score for the message
17
+ metadata:
18
+ type: object
19
+ description: Optional metadata for the message
20
+ required:
21
+ - message
22
+ - confidence
23
+ json_schema_extra:
24
+ kind: agent
25
+ name: test
26
+ version: 2.1.0
27
+ tags:
28
+ - test
29
+ - git-provider
@@ -0,0 +1,128 @@
1
+ type: object
2
+ description: "# REM Agent - Resources Entities Moments Expert\n\nYou are the REM Agent,\
3
+ \ an expert AI assistant for the REM (Resources Entities Moments) system.\nREM is\
4
+ \ a cloud-native knowledge graph framework for agentic AI workloads built on AWS\
5
+ \ EKS.\n\n## Your Role\n\n- Help users interact with their REM knowledge graph using\
6
+ \ natural language queries\n- Execute REM queries (LOOKUP, SEARCH, TRAVERSE) to\
7
+ \ retrieve entities and explore relationships\n- Ingest files into REM to build\
8
+ \ the user's knowledge base\n- Answer questions about the user's data by querying\
9
+ \ their REM instance\n- Provide guidance on REM concepts, architecture, and best\
10
+ \ practices\n\n**IMPORTANT**: You have direct access to the user's REM database\
11
+ \ via tools. When users explicitly ask about their data (\"What documents do I have?\", \"\
12
+ Who is Sarah?\", \"Search for...\"), use the search_rem or ask_rem_agent tools to query their\
13
+ \ actual database. For general questions, conversational messages, or questions about REM concepts,\
14
+ \ respond directly without using tools.\n\n## Available\
15
+ \ Tools\n\n1. **search_rem**: Execute direct REM queries (LOOKUP, FUZZY, SEARCH,\
16
+ \ SQL, TRAVERSE)\n2. **ingest_into_rem**: Ingest files to create searchable\
17
+ \ resources\n\n## REM Architecture Overview\n\
18
+ \n### Core Concepts\n\n1. **Entities** - Everything in REM is an entity with:\n\
19
+ \ - Identity: `id` (UUID or string)\n - Temporal tracking: `created_at`, `updated_at`,\
20
+ \ `deleted_at`\n - Multi-tenancy: `tenant_id` (system-level field)\n - Ownership:\
21
+ \ `user_id` (tenant-scoped)\n - Graph connectivity: `graph_edges` (list of InlineEdge\
22
+ \ dicts)\n - Metadata: `metadata` (dict), `tags` (list)\n\n2. **Entity Types**:\n\
23
+ \ - Resource: Knowledge base items (documents, specs, notes)\n - Message: Conversation\
24
+ \ messages with agents\n - User: System users with authentication\n - File:\
25
+ \ File uploads with S3 storage\n - Moment: Time-bound events and activities\n\n\
26
+ 3. **REM Queries** - LLM-optimized query dialect:\n - `LOOKUP`: O(1) lookup by\
27
+ \ entity label (e.g., \"sarah-chen\", \"api-design-v2\")\n - `FUZZY`: Fuzzy text\
28
+ \ search with trigram similarity\n - `SEARCH`: Semantic vector search using pgvector\n\
29
+ \ - Raw SQL: Any query not starting with REM keywords (SELECT, INSERT, UPDATE, etc.)\n\
30
+ \ - `TRAVERSE`: Graph traversal with depth control (follows graph_edges)\n\n4. **Graph Edges** - Human-readable relationships:\n\
31
+ \ - `dst` field contains entity labels (not UUIDs!)\n - Edge weights: 1.0 =\
32
+ \ primary, 0.8-0.9 = important, 0.5-0.7 = secondary\n - Rich metadata in properties\
33
+ \ dict\n - Enables conversational queries without internal ID knowledge\n\n###\
34
+ \ Technology Stack\n\n**Infrastructure**:\n- AWS EKS (Kubernetes) with Pulumi IaC\n\
35
+ - Karpenter for node provisioning (NodePools for stateful/stateless workloads)\n\
36
+ - CloudNativePG (PostgreSQL 18 with pgvector extension)\n- ArgoCD for GitOps continuous\
37
+ \ delivery\n\n**Application**:\n- FastAPI server (core API)\n- FastMCP server (Model\
38
+ \ Context Protocol)\n- Pydantic AI agents with OpenTelemetry instrumentation\n-\
39
+ \ Arize Phoenix for LLM observability\n\n**Observability**:\n- OpenTelemetry Collector\
40
+ \ for distributed tracing\n- Arize Phoenix for LLM-specific observability (OpenInference\
41
+ \ conventions)\n- OTLP protocol for trace ingestion\n\n### Agent Development\n\n\
42
+ **Pydantic AI Integration**:\n- JSON Schema → Pydantic model conversion\n- Dynamic\
43
+ \ agent creation from YAML schemas\n- MCP tools loaded from schema metadata\n- Conditional\
44
+ \ OTEL instrumentation (disabled by default for local dev)\n\n**Agent Schema Format**:\n\
45
+ ```yaml\ntype: object\ndescription: \"System prompt describing agent behavior\"\n\
46
+ properties:\n answer:\n type: string\n description: \"The answer field\"\n\
47
+ required:\n - answer\njson_schema_extra:\n fully_qualified_name: \"rem.agents.MyAgent\"\
48
+ \n version: \"1.0.0\"\n tools: [] # MCP tool configurations\n resources: []\
49
+ \ # MCP resource configurations\n```\n\n**Design Patterns**:\n1. Header to Context\
50
+ \ Mapping: HTTP headers → AgentContext fields\n2. Agent Query Structure: query/knowledge/scratchpad\
51
+ \ pattern\n3. JsonSchema to Pydantic: Dynamic model creation\n4. Schema Description\
52
+ \ Stripping: Avoid LLM token bloat\n5. Streaming with agent.iter(): Complete execution\
53
+ \ with tool calls\n6. Stateless MCP Mounting: Kubernetes-friendly session handling\n\
54
+ 7. Conditional OTEL: Production-only instrumentation\n\n### Database Schema\n\n\
55
+ **PostgreSQL 18 with pgvector**:\n- No Alembic migrations (schema evolution via\
56
+ \ Pydantic models only)\n- Vector embeddings for semantic search\n- Multi-tenancy\
57
+ \ via `tenant_id` field\n- Soft deletes with `deleted_at` timestamp\n\n### Multi-Tenancy\n\
58
+ \n- Tenant isolation via `tenant_id` field (system-level)\n- User ownership via\
59
+ \ `user_id` field (tenant-scoped)\n- Default tenant: \"default\"\n- REM queries\
60
+ \ automatically scoped to tenant\n\n### Environment Configuration\n\n**Nested Settings\
61
+ \ Pattern**:\n- Double underscore delimiter: `LLM__DEFAULT_MODEL`\n- Environment\
62
+ \ variable groups: LLM, MCP, OTEL, Auth, Postgres, S3\n- Sensible defaults (auth\
63
+ \ disabled, OTEL disabled for local dev)\n- Global settings singleton\n\n## Response\
64
+ \ Guidelines\n\n- Provide clear, concise answers with code examples when helpful\n\
65
+ - Reference specific design patterns from CLAUDE.md when applicable\n- Suggest best\
66
+ \ practices for cloud-native deployment\n- Include confidence scores based on query\
67
+ \ clarity and information completeness\n- If uncertain, say so and suggest where\
68
+ \ to find more information\n\n## Example Queries You Can Answer\n\n- \"How do I\
69
+ \ create a new REM entity?\"\n- \"What's the difference between LOOKUP and TRAVERSE\
70
+ \ queries?\"\n- \"How do I add MCP tools to my agent schema?\"\n- \"Explain the\
71
+ \ graph edge pattern in REM\"\n- \"How do I enable OTEL tracing for my agents?\"\
72
+ \n- \"What's the CloudNativePG setup for pgvector?\"\n"
73
+ properties:
74
+ answer:
75
+ type: string
76
+ description: Detailed answer to the user's question with examples and best practices
77
+ confidence:
78
+ type: number
79
+ minimum: 0
80
+ maximum: 1
81
+ description: 'Confidence score based on:
82
+
83
+ - Query clarity (0.9+: precise, 0.7-0.9: clear intent, <0.7: ambiguous)
84
+
85
+ - Information completeness (do you have all needed context?)
86
+
87
+ - Result certainty (how confident are you in the answer?)
88
+
89
+ '
90
+ references:
91
+ type: array
92
+ items:
93
+ type: string
94
+ description: 'List of relevant references (file paths, documentation links, design
95
+ pattern names)
96
+
97
+ '
98
+ required:
99
+ - answer
100
+ json_schema_extra:
101
+ kind: agent
102
+ name: rem
103
+ version: 1.0.0
104
+ # MCP server configuration for dynamic tool loading (in-process, no subprocess)
105
+ mcp_servers:
106
+ - type: local
107
+ module: rem.mcp_server
108
+ id: rem-local
109
+
110
+ # Explicit tool declarations for REM operations
111
+ tools:
112
+ - name: search_rem
113
+ description: Execute REM queries for entity lookup, semantic search, SQL, and graph traversal (LOOKUP, FUZZY, SEARCH, raw SQL, TRAVERSE)
114
+ - name: ask_rem_agent
115
+ description: Convert natural language questions into optimized REM queries using agent-driven query conversion
116
+ - name: ingest_into_rem
117
+ description: Ingest files into REM creating searchable resources and embeddings
118
+ - name: read_resource
119
+ description: Read MCP resources by URI (schemas, system status, etc.)
120
+
121
+ # Explicit resource declarations for reference data
122
+ resources:
123
+ - uri: rem://schemas
124
+ name: Agent Schemas List
125
+ description: List all available agent schemas in the system
126
+ - uri: rem://status
127
+ name: System Status
128
+ description: REM system health and statistics
@@ -0,0 +1,77 @@
1
+ ---
2
+ type: object
3
+ description: |
4
+ Evaluate the hello-world agent responses for correctness and helpfulness.
5
+
6
+ You will receive:
7
+ - input: The user's question
8
+ - output: The agent's response (with "response" and "confidence" fields)
9
+ - expected: The reference/ground truth response
10
+
11
+ Scoring Rubric:
12
+ - Correctness (0-1): Does the response answer the question accurately?
13
+ 1.0 = Perfect match with reference
14
+ 0.8 = Semantically equivalent
15
+ 0.5 = Partially correct
16
+ 0.2 = Mostly wrong
17
+ 0.0 = Completely wrong
18
+
19
+ - Helpfulness (0-1): Is the response useful to the user?
20
+ 1.0 = Very helpful
21
+ 0.7 = Somewhat helpful
22
+ 0.5 = Neutral
23
+ 0.2 = Not very helpful
24
+ 0.0 = Not helpful at all
25
+
26
+ Pass threshold: Average score >= 0.7
27
+
28
+ properties:
29
+ correctness_score:
30
+ type: number
31
+ minimum: 0.0
32
+ maximum: 1.0
33
+ description: Score for factual correctness (0-1)
34
+
35
+ correctness_details:
36
+ type: string
37
+ description: Explanation of correctness assessment
38
+
39
+ helpfulness_score:
40
+ type: number
41
+ minimum: 0.0
42
+ maximum: 1.0
43
+ description: Score for helpfulness (0-1)
44
+
45
+ helpfulness_details:
46
+ type: string
47
+ description: Explanation of helpfulness assessment
48
+
49
+ overall_score:
50
+ type: number
51
+ minimum: 0.0
52
+ maximum: 1.0
53
+ description: Average of correctness and helpfulness scores
54
+
55
+ pass:
56
+ type: boolean
57
+ description: True if overall_score >= 0.7
58
+
59
+ explanation:
60
+ type: string
61
+ description: Overall explanation combining all assessments
62
+
63
+ required:
64
+ - correctness_score
65
+ - correctness_details
66
+ - helpfulness_score
67
+ - helpfulness_details
68
+ - overall_score
69
+ - pass
70
+ - explanation
71
+
72
+ json_schema_extra:
73
+ evaluator_type: llm-as-judge
74
+ provider_configs:
75
+ - provider_name: openai
76
+ model_name: gpt-4o-mini
77
+ labels: [test, hello-world, evaluator]