remdb 0.3.242__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 (235) hide show
  1. rem/__init__.py +129 -0
  2. rem/agentic/README.md +760 -0
  3. rem/agentic/__init__.py +54 -0
  4. rem/agentic/agents/README.md +155 -0
  5. rem/agentic/agents/__init__.py +38 -0
  6. rem/agentic/agents/agent_manager.py +311 -0
  7. rem/agentic/agents/sse_simulator.py +502 -0
  8. rem/agentic/context.py +425 -0
  9. rem/agentic/context_builder.py +360 -0
  10. rem/agentic/llm_provider_models.py +301 -0
  11. rem/agentic/mcp/__init__.py +0 -0
  12. rem/agentic/mcp/tool_wrapper.py +273 -0
  13. rem/agentic/otel/__init__.py +5 -0
  14. rem/agentic/otel/setup.py +240 -0
  15. rem/agentic/providers/phoenix.py +926 -0
  16. rem/agentic/providers/pydantic_ai.py +854 -0
  17. rem/agentic/query.py +117 -0
  18. rem/agentic/query_helper.py +89 -0
  19. rem/agentic/schema.py +737 -0
  20. rem/agentic/serialization.py +245 -0
  21. rem/agentic/tools/__init__.py +5 -0
  22. rem/agentic/tools/rem_tools.py +242 -0
  23. rem/api/README.md +657 -0
  24. rem/api/deps.py +253 -0
  25. rem/api/main.py +460 -0
  26. rem/api/mcp_router/prompts.py +182 -0
  27. rem/api/mcp_router/resources.py +820 -0
  28. rem/api/mcp_router/server.py +243 -0
  29. rem/api/mcp_router/tools.py +1605 -0
  30. rem/api/middleware/tracking.py +172 -0
  31. rem/api/routers/admin.py +520 -0
  32. rem/api/routers/auth.py +898 -0
  33. rem/api/routers/chat/__init__.py +5 -0
  34. rem/api/routers/chat/child_streaming.py +394 -0
  35. rem/api/routers/chat/completions.py +702 -0
  36. rem/api/routers/chat/json_utils.py +76 -0
  37. rem/api/routers/chat/models.py +202 -0
  38. rem/api/routers/chat/otel_utils.py +33 -0
  39. rem/api/routers/chat/sse_events.py +546 -0
  40. rem/api/routers/chat/streaming.py +950 -0
  41. rem/api/routers/chat/streaming_utils.py +327 -0
  42. rem/api/routers/common.py +18 -0
  43. rem/api/routers/dev.py +87 -0
  44. rem/api/routers/feedback.py +276 -0
  45. rem/api/routers/messages.py +620 -0
  46. rem/api/routers/models.py +86 -0
  47. rem/api/routers/query.py +362 -0
  48. rem/api/routers/shared_sessions.py +422 -0
  49. rem/auth/README.md +258 -0
  50. rem/auth/__init__.py +36 -0
  51. rem/auth/jwt.py +367 -0
  52. rem/auth/middleware.py +318 -0
  53. rem/auth/providers/__init__.py +16 -0
  54. rem/auth/providers/base.py +376 -0
  55. rem/auth/providers/email.py +215 -0
  56. rem/auth/providers/google.py +163 -0
  57. rem/auth/providers/microsoft.py +237 -0
  58. rem/cli/README.md +517 -0
  59. rem/cli/__init__.py +8 -0
  60. rem/cli/commands/README.md +299 -0
  61. rem/cli/commands/__init__.py +3 -0
  62. rem/cli/commands/ask.py +549 -0
  63. rem/cli/commands/cluster.py +1808 -0
  64. rem/cli/commands/configure.py +495 -0
  65. rem/cli/commands/db.py +828 -0
  66. rem/cli/commands/dreaming.py +324 -0
  67. rem/cli/commands/experiments.py +1698 -0
  68. rem/cli/commands/mcp.py +66 -0
  69. rem/cli/commands/process.py +388 -0
  70. rem/cli/commands/query.py +109 -0
  71. rem/cli/commands/scaffold.py +47 -0
  72. rem/cli/commands/schema.py +230 -0
  73. rem/cli/commands/serve.py +106 -0
  74. rem/cli/commands/session.py +453 -0
  75. rem/cli/dreaming.py +363 -0
  76. rem/cli/main.py +123 -0
  77. rem/config.py +244 -0
  78. rem/mcp_server.py +41 -0
  79. rem/models/core/__init__.py +49 -0
  80. rem/models/core/core_model.py +70 -0
  81. rem/models/core/engram.py +333 -0
  82. rem/models/core/experiment.py +672 -0
  83. rem/models/core/inline_edge.py +132 -0
  84. rem/models/core/rem_query.py +246 -0
  85. rem/models/entities/__init__.py +68 -0
  86. rem/models/entities/domain_resource.py +38 -0
  87. rem/models/entities/feedback.py +123 -0
  88. rem/models/entities/file.py +57 -0
  89. rem/models/entities/image_resource.py +88 -0
  90. rem/models/entities/message.py +64 -0
  91. rem/models/entities/moment.py +123 -0
  92. rem/models/entities/ontology.py +181 -0
  93. rem/models/entities/ontology_config.py +131 -0
  94. rem/models/entities/resource.py +95 -0
  95. rem/models/entities/schema.py +87 -0
  96. rem/models/entities/session.py +84 -0
  97. rem/models/entities/shared_session.py +180 -0
  98. rem/models/entities/subscriber.py +175 -0
  99. rem/models/entities/user.py +93 -0
  100. rem/py.typed +0 -0
  101. rem/registry.py +373 -0
  102. rem/schemas/README.md +507 -0
  103. rem/schemas/__init__.py +6 -0
  104. rem/schemas/agents/README.md +92 -0
  105. rem/schemas/agents/core/agent-builder.yaml +235 -0
  106. rem/schemas/agents/core/moment-builder.yaml +178 -0
  107. rem/schemas/agents/core/rem-query-agent.yaml +226 -0
  108. rem/schemas/agents/core/resource-affinity-assessor.yaml +99 -0
  109. rem/schemas/agents/core/simple-assistant.yaml +19 -0
  110. rem/schemas/agents/core/user-profile-builder.yaml +163 -0
  111. rem/schemas/agents/examples/contract-analyzer.yaml +317 -0
  112. rem/schemas/agents/examples/contract-extractor.yaml +134 -0
  113. rem/schemas/agents/examples/cv-parser.yaml +263 -0
  114. rem/schemas/agents/examples/hello-world.yaml +37 -0
  115. rem/schemas/agents/examples/query.yaml +54 -0
  116. rem/schemas/agents/examples/simple.yaml +21 -0
  117. rem/schemas/agents/examples/test.yaml +29 -0
  118. rem/schemas/agents/rem.yaml +132 -0
  119. rem/schemas/evaluators/hello-world/default.yaml +77 -0
  120. rem/schemas/evaluators/rem/faithfulness.yaml +219 -0
  121. rem/schemas/evaluators/rem/lookup-correctness.yaml +182 -0
  122. rem/schemas/evaluators/rem/retrieval-precision.yaml +199 -0
  123. rem/schemas/evaluators/rem/retrieval-recall.yaml +211 -0
  124. rem/schemas/evaluators/rem/search-correctness.yaml +192 -0
  125. rem/services/__init__.py +18 -0
  126. rem/services/audio/INTEGRATION.md +308 -0
  127. rem/services/audio/README.md +376 -0
  128. rem/services/audio/__init__.py +15 -0
  129. rem/services/audio/chunker.py +354 -0
  130. rem/services/audio/transcriber.py +259 -0
  131. rem/services/content/README.md +1269 -0
  132. rem/services/content/__init__.py +5 -0
  133. rem/services/content/providers.py +760 -0
  134. rem/services/content/service.py +762 -0
  135. rem/services/dreaming/README.md +230 -0
  136. rem/services/dreaming/__init__.py +53 -0
  137. rem/services/dreaming/affinity_service.py +322 -0
  138. rem/services/dreaming/moment_service.py +251 -0
  139. rem/services/dreaming/ontology_service.py +54 -0
  140. rem/services/dreaming/user_model_service.py +297 -0
  141. rem/services/dreaming/utils.py +39 -0
  142. rem/services/email/__init__.py +10 -0
  143. rem/services/email/service.py +522 -0
  144. rem/services/email/templates.py +360 -0
  145. rem/services/embeddings/__init__.py +11 -0
  146. rem/services/embeddings/api.py +127 -0
  147. rem/services/embeddings/worker.py +435 -0
  148. rem/services/fs/README.md +662 -0
  149. rem/services/fs/__init__.py +62 -0
  150. rem/services/fs/examples.py +206 -0
  151. rem/services/fs/examples_paths.py +204 -0
  152. rem/services/fs/git_provider.py +935 -0
  153. rem/services/fs/local_provider.py +760 -0
  154. rem/services/fs/parsing-hooks-examples.md +172 -0
  155. rem/services/fs/paths.py +276 -0
  156. rem/services/fs/provider.py +460 -0
  157. rem/services/fs/s3_provider.py +1042 -0
  158. rem/services/fs/service.py +186 -0
  159. rem/services/git/README.md +1075 -0
  160. rem/services/git/__init__.py +17 -0
  161. rem/services/git/service.py +469 -0
  162. rem/services/phoenix/EXPERIMENT_DESIGN.md +1146 -0
  163. rem/services/phoenix/README.md +453 -0
  164. rem/services/phoenix/__init__.py +46 -0
  165. rem/services/phoenix/client.py +960 -0
  166. rem/services/phoenix/config.py +88 -0
  167. rem/services/phoenix/prompt_labels.py +477 -0
  168. rem/services/postgres/README.md +757 -0
  169. rem/services/postgres/__init__.py +49 -0
  170. rem/services/postgres/diff_service.py +599 -0
  171. rem/services/postgres/migration_service.py +427 -0
  172. rem/services/postgres/programmable_diff_service.py +635 -0
  173. rem/services/postgres/pydantic_to_sqlalchemy.py +562 -0
  174. rem/services/postgres/register_type.py +353 -0
  175. rem/services/postgres/repository.py +481 -0
  176. rem/services/postgres/schema_generator.py +661 -0
  177. rem/services/postgres/service.py +802 -0
  178. rem/services/postgres/sql_builder.py +355 -0
  179. rem/services/rate_limit.py +113 -0
  180. rem/services/rem/README.md +318 -0
  181. rem/services/rem/__init__.py +23 -0
  182. rem/services/rem/exceptions.py +71 -0
  183. rem/services/rem/executor.py +293 -0
  184. rem/services/rem/parser.py +180 -0
  185. rem/services/rem/queries.py +196 -0
  186. rem/services/rem/query.py +371 -0
  187. rem/services/rem/service.py +608 -0
  188. rem/services/session/README.md +374 -0
  189. rem/services/session/__init__.py +13 -0
  190. rem/services/session/compression.py +488 -0
  191. rem/services/session/pydantic_messages.py +310 -0
  192. rem/services/session/reload.py +85 -0
  193. rem/services/user_service.py +130 -0
  194. rem/settings.py +1877 -0
  195. rem/sql/background_indexes.sql +52 -0
  196. rem/sql/migrations/001_install.sql +983 -0
  197. rem/sql/migrations/002_install_models.sql +3157 -0
  198. rem/sql/migrations/003_optional_extensions.sql +326 -0
  199. rem/sql/migrations/004_cache_system.sql +282 -0
  200. rem/sql/migrations/005_schema_update.sql +145 -0
  201. rem/sql/migrations/migrate_session_id_to_uuid.sql +45 -0
  202. rem/utils/AGENTIC_CHUNKING.md +597 -0
  203. rem/utils/README.md +628 -0
  204. rem/utils/__init__.py +61 -0
  205. rem/utils/agentic_chunking.py +622 -0
  206. rem/utils/batch_ops.py +343 -0
  207. rem/utils/chunking.py +108 -0
  208. rem/utils/clip_embeddings.py +276 -0
  209. rem/utils/constants.py +97 -0
  210. rem/utils/date_utils.py +228 -0
  211. rem/utils/dict_utils.py +98 -0
  212. rem/utils/embeddings.py +436 -0
  213. rem/utils/examples/embeddings_example.py +305 -0
  214. rem/utils/examples/sql_types_example.py +202 -0
  215. rem/utils/files.py +323 -0
  216. rem/utils/markdown.py +16 -0
  217. rem/utils/mime_types.py +158 -0
  218. rem/utils/model_helpers.py +492 -0
  219. rem/utils/schema_loader.py +649 -0
  220. rem/utils/sql_paths.py +146 -0
  221. rem/utils/sql_types.py +350 -0
  222. rem/utils/user_id.py +81 -0
  223. rem/utils/vision.py +325 -0
  224. rem/workers/README.md +506 -0
  225. rem/workers/__init__.py +7 -0
  226. rem/workers/db_listener.py +579 -0
  227. rem/workers/db_maintainer.py +74 -0
  228. rem/workers/dreaming.py +502 -0
  229. rem/workers/engram_processor.py +312 -0
  230. rem/workers/sqs_file_processor.py +193 -0
  231. rem/workers/unlogged_maintainer.py +463 -0
  232. remdb-0.3.242.dist-info/METADATA +1632 -0
  233. remdb-0.3.242.dist-info/RECORD +235 -0
  234. remdb-0.3.242.dist-info/WHEEL +4 -0
  235. remdb-0.3.242.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,134 @@
1
+ type: object
2
+ description: 'You are a contract analysis agent with access to legal knowledge base
3
+ and document parsing tools.
4
+
5
+
6
+ Your purpose is to extract structured information from contracts and legal documents.
7
+
8
+
9
+ ## Your Capabilities
10
+
11
+
12
+ - Extract parties, dates, and key terms from contracts
13
+
14
+ - Search legal knowledge base for best practices and definitions
15
+
16
+ - Parse additional documents when needed
17
+
18
+ - Identify and categorize contract clauses
19
+
20
+ - Assess risk levels in contract provisions
21
+
22
+
23
+ ## Output Format
24
+
25
+
26
+ You MUST provide all of the following:
27
+
28
+
29
+ 1. **document_title**: The title or name of the contract
30
+
31
+ 2. **parties**: List of parties involved in the contract
32
+
33
+ 3. **effective_date**: The effective date of the contract (YYYY-MM-DD or descriptive
34
+ text)
35
+
36
+ 4. **key_terms**: List of important defined terms
37
+
38
+ 5. **key_clauses**: List of important clauses with summaries
39
+
40
+ 6. **risk_assessment**: Overall risk assessment (low, medium, high, critical)
41
+
42
+ 7. **tools_used**: List of tools you called during analysis
43
+
44
+
45
+ ## Tool Usage Guidelines
46
+
47
+
48
+ - Use **search_rem** to look up legal terms, clause best practices, or risk factors
49
+
50
+ - Use **ingest_to_rem** if you need to extract text from referenced documents
51
+
52
+ - Always cite which tools you used in the tools_used field
53
+
54
+ '
55
+ properties:
56
+ document_title:
57
+ type: string
58
+ description: The title or name of the contract
59
+ parties:
60
+ type: array
61
+ items:
62
+ type: string
63
+ description: List of parties involved in the contract
64
+ effective_date:
65
+ type: string
66
+ description: The effective date of the contract
67
+ key_terms:
68
+ type: array
69
+ items:
70
+ type: string
71
+ description: List of important defined terms from the contract
72
+ key_clauses:
73
+ type: array
74
+ items:
75
+ type: object
76
+ properties:
77
+ type:
78
+ type: string
79
+ description: Type of clause (e.g., Indemnification, Confidentiality)
80
+ section:
81
+ type: string
82
+ description: Section reference in the document
83
+ summary:
84
+ type: string
85
+ description: Brief summary of the clause
86
+ description: List of important clauses with their summaries
87
+ risk_assessment:
88
+ type: string
89
+ enum:
90
+ - low
91
+ - medium
92
+ - high
93
+ - critical
94
+ description: Overall risk assessment of the contract
95
+ tools_used:
96
+ type: array
97
+ items:
98
+ type: string
99
+ description: List of tools that were called during analysis
100
+ required:
101
+ - document_title
102
+ - parties
103
+ - effective_date
104
+ - key_terms
105
+ - key_clauses
106
+ - risk_assessment
107
+ - tools_used
108
+ json_schema_extra:
109
+ kind: agent
110
+ name: contract-extractor
111
+ version: 1.0.0
112
+ tags:
113
+ - legal
114
+ - contract-analysis
115
+ author: User-provided
116
+ tools:
117
+ - name: search_rem
118
+ mcp_server: rem
119
+ description: Use this to search the legal knowledge base for relevant information
120
+ about contract clauses, legal terms, and best practices
121
+ - name: ingest_to_rem
122
+ mcp_server: rem
123
+ description: Use this to parse and extract text from PDF or other document files
124
+ when you need to read referenced documents
125
+ resources: []
126
+ embedding_fields:
127
+ - document_title
128
+ - key_terms
129
+ - key_clauses
130
+ provider_configs:
131
+ - provider_name: anthropic
132
+ model_name: claude-sonnet-4-5-20250929
133
+ - provider_name: openai
134
+ model_name: gpt-4.1
@@ -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-4.1
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,132 @@
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- If uncertain, say so and suggest where\
67
+ \ to find more information\n\n## Metadata Registration\n\nBefore generating your final response, call the `register_metadata` tool to provide confidence scores and source attribution.\n\n## Example Queries You Can Answer\n\n- \"How do I\
68
+ \ create a new REM entity?\"\n- \"What's the difference between LOOKUP and TRAVERSE\
69
+ \ queries?\"\n- \"How do I add MCP tools to my agent schema?\"\n- \"Explain the\
70
+ \ graph edge pattern in REM\"\n- \"How do I enable OTEL tracing for my agents?\"\
71
+ \n- \"What's the CloudNativePG setup for pgvector?\"\n"
72
+ properties:
73
+ answer:
74
+ type: string
75
+ description: Detailed answer to the user's question with examples and best practices
76
+ confidence:
77
+ type: number
78
+ minimum: 0
79
+ maximum: 1
80
+ description: 'Confidence score based on:
81
+
82
+ - Query clarity (0.9+: precise, 0.7-0.9: clear intent, <0.7: ambiguous)
83
+
84
+ - Information completeness (do you have all needed context?)
85
+
86
+ - Result certainty (how confident are you in the answer?)
87
+
88
+ '
89
+ references:
90
+ type: array
91
+ items:
92
+ type: string
93
+ description: 'List of relevant references (file paths, documentation links, design
94
+ pattern names)
95
+
96
+ '
97
+ required:
98
+ - answer
99
+ json_schema_extra:
100
+ kind: agent
101
+ name: rem
102
+ version: 1.0.0
103
+ # Disable structured output - properties become prompt guidance instead of JSON schema
104
+ # This enables natural language streaming while still informing the agent about expected elements
105
+ structured_output: false
106
+ # MCP server configuration for dynamic tool loading (in-process, no subprocess)
107
+ mcp_servers:
108
+ - type: local
109
+ module: rem.mcp_server
110
+ id: rem-local
111
+
112
+ # Explicit tool declarations for REM operations
113
+ tools:
114
+ - name: search_rem
115
+ description: Execute REM queries for entity lookup, semantic search, SQL, and graph traversal (LOOKUP, FUZZY, SEARCH, raw SQL, TRAVERSE)
116
+ - name: ask_rem_agent
117
+ description: Convert natural language questions into optimized REM queries using agent-driven query conversion
118
+ - name: ingest_into_rem
119
+ description: Ingest files into REM creating searchable resources and embeddings
120
+ - name: read_resource
121
+ description: Read MCP resources by URI (schemas, system status, etc.)
122
+ - name: register_metadata
123
+ description: Register response metadata (confidence, sources, references) to be emitted as SSE MetadataEvent. Call BEFORE generating final response.
124
+
125
+ # Explicit resource declarations for reference data
126
+ resources:
127
+ - uri: rem://agents
128
+ name: Agent Schemas List
129
+ description: List all available agent schemas in the system
130
+ - uri: rem://status
131
+ name: System Status
132
+ description: REM system health and statistics