remdb 0.3.0__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 +566 -0
  44. rem/cli/commands/configure.py +497 -0
  45. rem/cli/commands/db.py +493 -0
  46. rem/cli/commands/dreaming.py +324 -0
  47. rem/cli/commands/experiments.py +1302 -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 +96 -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 +676 -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 +336 -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.3.0.dist-info/METADATA +1455 -0
  185. remdb-0.3.0.dist-info/RECORD +187 -0
  186. remdb-0.3.0.dist-info/WHEEL +4 -0
  187. remdb-0.3.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,163 @@
1
+ type: object
2
+ description: "You are a UserProfileBuilder agent that generates comprehensive user\
3
+ \ profiles from activity data.\n\nYour task is to analyze a user's recent activity\
4
+ \ (sessions, moments, resources) and create\na holistic profile that captures:\n\
5
+ 1. **Work Context**: What the user is working on, their role, responsibilities\n\
6
+ 2. **Technical Focus**: Technologies, tools, frameworks they use\n3. **Interests\
7
+ \ and Skills**: Areas of expertise and learning\n4. **Collaboration Patterns**:\
8
+ \ Teams, projects, people they work with\n5. **Work Style**: How they approach problems,\
9
+ \ communication patterns\n\n## Analysis Guidelines\n\n### Work Context\n- Identify\
10
+ \ ongoing projects and initiatives\n- Understand user's role (engineer, lead, manager,\
11
+ \ etc.)\n- Capture organizational context (team, department)\n- Note key responsibilities\
12
+ \ and priorities\n\n### Technical Focus\n- Extract technologies actively being used\n\
13
+ - Identify architectural patterns and approaches\n- Note tools and frameworks in\
14
+ \ daily workflow\n- Capture technical challenges being addressed\n\n### Interests\
15
+ \ and Skills\n- Areas of deep expertise (demonstrated through content)\n- Learning\
16
+ \ areas (questions, research, exploration)\n- Thought leadership topics (reflections,\
17
+ \ designs)\n- Technical depth vs breadth\n\n### Collaboration Patterns\n- Frequent\
18
+ \ collaborators (present_persons in moments)\n- Projects and initiatives being coordinated\n\
19
+ - Communication patterns (meetings, async, documentation)\n- Leadership and mentorship\
20
+ \ activities\n\n### Work Style\n- Problem-solving approach (analytical, experimental,\
21
+ \ collaborative)\n- Planning style (detailed vs adaptive)\n- Communication preferences\
22
+ \ (documentation, meetings, async)\n- Reflection and learning habits\n\n## Input\
23
+ \ Format\n\nYou receive user activity data:\n```json\n{\n \"user_id\": \"user-123\"\
24
+ ,\n \"tenant_id\": \"acme-corp\",\n \"time_window_days\": 30,\n \"sessions\"\
25
+ : [\n {\n \"id\": \"uuid\",\n \"query\": \"User question\",\n \
26
+ \ \"response\": \"Assistant response\",\n \"created_at\": \"2025-01-15T14:00:00Z\"\
27
+ ,\n \"metadata\": {}\n }\n ],\n \"moments\": [\n {\n \"id\": \"\
28
+ uuid\",\n \"name\": \"Team Standup\",\n \"moment_type\": \"meeting\",\n\
29
+ \ \"emotion_tags\": [\"focused\", \"collaborative\"],\n \"topic_tags\"\
30
+ : [\"api-design\", \"graphql\", \"planning\"],\n \"present_persons\": [{\"\
31
+ id\": \"alice\", \"name\": \"Alice Chen\"}],\n \"starts_timestamp\": \"2025-01-15T09:00:00Z\"\
32
+ \n }\n ],\n \"resources\": [\n {\n \"id\": \"uuid\",\n \"name\"\
33
+ : \"API Design Document\",\n \"category\": \"documentation\",\n \"content\"\
34
+ : \"Summary of content...\",\n \"resource_timestamp\": \"2025-01-15T09:00:00Z\"\
35
+ \n }\n ]\n}\n```\n\n## Output Requirements\n\nGenerate a comprehensive profile\
36
+ \ with:\n- **summary**: 2-3 paragraph high-level profile\n- **current_projects**:\
37
+ \ List of active projects/initiatives (with descriptions)\n- **technical_stack**:\
38
+ \ Technologies and tools in active use\n- **key_collaborators**: People frequently\
39
+ \ interacting with\n- **expertise_areas**: Demonstrated areas of expertise\n- **learning_interests**:\
40
+ \ Topics being explored or learned\n- **work_style_traits**: Behavioral and approach\
41
+ \ patterns\n- **recommended_tags**: 5-10 tags summarizing the profile\n\n## Example\
42
+ \ Output\n\n```json\n{\n \"summary\": \"Senior software engineer focused on API\
43
+ \ modernization and database scaling. Leading GraphQL migration while evaluating\
44
+ \ TiDB for horizontal scaling. Strong technical leadership with emphasis on documentation\
45
+ \ and collaborative decision-making.\",\n \"current_projects\": [\n {\n \
46
+ \ \"name\": \"GraphQL API Migration\",\n \"description\": \"Leading transition\
47
+ \ from REST to GraphQL for customer-facing API\",\n \"status\": \"in_progress\"\
48
+ ,\n \"technologies\": [\"GraphQL\", \"Apollo\", \"TypeScript\"]\n },\n \
49
+ \ {\n \"name\": \"TiDB Database Migration\",\n \"description\": \"Evaluating\
50
+ \ and planning migration from PostgreSQL to TiDB\",\n \"status\": \"planning\"\
51
+ ,\n \"technologies\": [\"TiDB\", \"PostgreSQL\", \"Kubernetes\"]\n }\n \
52
+ \ ],\n \"technical_stack\": [\n \"GraphQL\", \"Apollo Server\", \"TiDB\", \"\
53
+ PostgreSQL\", \"Kubernetes\",\n \"TypeScript\", \"React Native\", \"Node.js\"\
54
+ \n ],\n \"key_collaborators\": [\n {\"id\": \"mike-rodriguez\", \"name\": \"\
55
+ Mike Rodriguez\", \"context\": \"Backend engineer, GraphQL work\"},\n {\"id\"\
56
+ : \"alice-wong\", \"name\": \"Alice Wong\", \"context\": \"Frontend engineer, mobile\
57
+ \ app\"}\n ],\n \"expertise_areas\": [\n \"API design and architecture\",\n\
58
+ \ \"Database scaling and performance\",\n \"Distributed systems\",\n \"\
59
+ Technical leadership\"\n ],\n \"learning_interests\": [\n \"GraphQL federation\
60
+ \ patterns\",\n \"TiDB distributed architecture\",\n \"Kubernetes autoscaling\"\
61
+ \n ],\n \"work_style_traits\": [\n \"Documentation-first approach\",\n \"\
62
+ Collaborative decision-making\",\n \"Strategic planning with tactical execution\"\
63
+ ,\n \"Reflective and learning-oriented\"\n ],\n \"recommended_tags\": [\n \
64
+ \ \"api-architect\", \"backend-lead\", \"distributed-systems\",\n \"graphql-expert\"\
65
+ , \"kubernetes\", \"technical-leadership\",\n \"collaborative\", \"documentation-focused\"\
66
+ \n ]\n}\n```\n"
67
+ properties:
68
+ summary:
69
+ type: string
70
+ description: 2-3 paragraph high-level profile of the user
71
+ current_projects:
72
+ type: array
73
+ items:
74
+ type: object
75
+ properties:
76
+ name:
77
+ type: string
78
+ description: Project name
79
+ description:
80
+ type: string
81
+ description: What the project is about
82
+ status:
83
+ type: string
84
+ enum:
85
+ - planning
86
+ - in_progress
87
+ - completed
88
+ - paused
89
+ description: Project status
90
+ technologies:
91
+ type: array
92
+ items:
93
+ type: string
94
+ description: Technologies used in the project
95
+ required:
96
+ - name
97
+ - description
98
+ - status
99
+ description: Active projects and initiatives
100
+ technical_stack:
101
+ type: array
102
+ items:
103
+ type: string
104
+ description: Technologies, tools, and frameworks in active use
105
+ key_collaborators:
106
+ type: array
107
+ items:
108
+ type: object
109
+ properties:
110
+ id:
111
+ type: string
112
+ description: Collaborator identifier (kebab-case)
113
+ name:
114
+ type: string
115
+ description: Collaborator full name
116
+ context:
117
+ type: string
118
+ description: Context of collaboration (role, project, relationship)
119
+ required:
120
+ - id
121
+ - name
122
+ - context
123
+ description: People frequently collaborating with
124
+ expertise_areas:
125
+ type: array
126
+ items:
127
+ type: string
128
+ description: Demonstrated areas of expertise
129
+ learning_interests:
130
+ type: array
131
+ items:
132
+ type: string
133
+ description: Topics being explored or learned
134
+ work_style_traits:
135
+ type: array
136
+ items:
137
+ type: string
138
+ description: Behavioral and approach patterns
139
+ recommended_tags:
140
+ type: array
141
+ items:
142
+ type: string
143
+ description: 5-10 tags summarizing the profile (kebab-case)
144
+ minItems: 5
145
+ maxItems: 10
146
+ required:
147
+ - summary
148
+ - current_projects
149
+ - technical_stack
150
+ - key_collaborators
151
+ - expertise_areas
152
+ - learning_interests
153
+ - work_style_traits
154
+ - recommended_tags
155
+ json_schema_extra:
156
+ kind: agent
157
+ name: user-profile-builder
158
+ version: 1.0.0
159
+ tags:
160
+ - dreaming
161
+ - user-model
162
+ - profile-generation
163
+ category: agent
@@ -0,0 +1,317 @@
1
+ type: object
2
+ description: 'You are a Contract Analyzer specialized in extracting key terms from
3
+ legal agreements.
4
+
5
+
6
+ Your task is to analyze the provided contract text and extract:
7
+
8
+ - Contract type and parties involved
9
+
10
+ - Effective and termination dates
11
+
12
+ - Financial terms (amounts, payment schedules)
13
+
14
+ - Key obligations and deliverables
15
+
16
+ - Termination clauses and conditions
17
+
18
+ - Liability and indemnity provisions
19
+
20
+ - Confidentiality requirements
21
+
22
+ - Governing law and dispute resolution
23
+
24
+
25
+ Guidelines:
26
+
27
+ - Extract exact legal terms without paraphrasing
28
+
29
+ - Preserve monetary amounts with currency symbols
30
+
31
+ - Capture all parties with their legal entity names
32
+
33
+ - Identify both explicit and implicit obligations
34
+
35
+ - Flag unusual or risky clauses
36
+
37
+ - Assign confidence score based on contract clarity
38
+
39
+ - If information is ambiguous, note it in notes field
40
+
41
+
42
+ Output Format:
43
+
44
+ - Return structured JSON matching the schema below
45
+
46
+ - Ensure all dates are in ISO 8601 format (YYYY-MM-DD)
47
+
48
+ - Use arrays for lists (parties, obligations, risks)
49
+
50
+ - Include confidence_score (0.0-1.0) for overall extraction quality
51
+
52
+ '
53
+ properties:
54
+ contract_title:
55
+ type: string
56
+ description: Official contract title or name
57
+ contract_type:
58
+ type: string
59
+ description: Type of contract
60
+ enum:
61
+ - supplier_agreement
62
+ - service_agreement
63
+ - employment_contract
64
+ - nda
65
+ - partnership_agreement
66
+ - licensing_agreement
67
+ - lease_agreement
68
+ - consulting_agreement
69
+ - purchase_order
70
+ - master_services_agreement
71
+ - other
72
+ parties:
73
+ type: array
74
+ description: All parties to the contract
75
+ items:
76
+ type: object
77
+ properties:
78
+ legal_name:
79
+ type: string
80
+ description: Full legal entity name
81
+ role:
82
+ type: string
83
+ description: Party role in contract
84
+ enum:
85
+ - buyer
86
+ - seller
87
+ - supplier
88
+ - vendor
89
+ - client
90
+ - contractor
91
+ - employer
92
+ - employee
93
+ - licensor
94
+ - licensee
95
+ - lessor
96
+ - lessee
97
+ - partner
98
+ - other
99
+ address:
100
+ type: string
101
+ description: Registered address
102
+ representative:
103
+ type: string
104
+ description: Authorized representative name
105
+ required:
106
+ - legal_name
107
+ - role
108
+ effective_date:
109
+ type: string
110
+ description: Contract effective date (YYYY-MM-DD)
111
+ format: date
112
+ termination_date:
113
+ type: string
114
+ description: Contract end date (YYYY-MM-DD or "none" if perpetual)
115
+ contract_duration:
116
+ type: string
117
+ description: Duration in human-readable format (e.g., "2 years", "36 months")
118
+ auto_renewal:
119
+ type: boolean
120
+ description: Whether contract auto-renews
121
+ financial_terms:
122
+ type: object
123
+ description: Financial obligations and payment terms
124
+ properties:
125
+ total_contract_value:
126
+ type: string
127
+ description: Total contract value with currency (e.g., "$500,000 USD")
128
+ payment_schedule:
129
+ type: string
130
+ description: Payment frequency (e.g., "quarterly", "net-60")
131
+ currency:
132
+ type: string
133
+ description: Currency code (USD, EUR, GBP, etc.)
134
+ payment_method:
135
+ type: string
136
+ description: Payment method (wire transfer, check, etc.)
137
+ late_payment_penalty:
138
+ type: string
139
+ description: Late payment penalties if specified
140
+ price_escalation:
141
+ type: string
142
+ description: Price escalation clause if any
143
+ key_obligations:
144
+ type: array
145
+ description: Major obligations for each party
146
+ items:
147
+ type: object
148
+ properties:
149
+ party:
150
+ type: string
151
+ description: Which party has this obligation
152
+ obligation:
153
+ type: string
154
+ description: Description of the obligation
155
+ deadline:
156
+ type: string
157
+ description: Deadline or timeline if specified
158
+ consequences:
159
+ type: string
160
+ description: Consequences of non-performance
161
+ required:
162
+ - party
163
+ - obligation
164
+ deliverables:
165
+ type: array
166
+ description: Specific deliverables or milestones
167
+ items:
168
+ type: object
169
+ properties:
170
+ name:
171
+ type: string
172
+ description: Deliverable name
173
+ description:
174
+ type: string
175
+ description: Detailed description
176
+ due_date:
177
+ type: string
178
+ description: Due date if specified
179
+ acceptance_criteria:
180
+ type: string
181
+ description: Acceptance criteria
182
+ required:
183
+ - name
184
+ termination_clauses:
185
+ type: array
186
+ description: Conditions allowing contract termination
187
+ items:
188
+ type: object
189
+ properties:
190
+ condition:
191
+ type: string
192
+ description: Termination condition
193
+ notice_period:
194
+ type: string
195
+ description: Required notice period (e.g., "30 days")
196
+ party:
197
+ type: string
198
+ description: Which party can terminate under this condition
199
+ required:
200
+ - condition
201
+ liability_provisions:
202
+ type: object
203
+ description: Liability and indemnity provisions
204
+ properties:
205
+ liability_cap:
206
+ type: string
207
+ description: Maximum liability amount if specified
208
+ indemnification:
209
+ type: string
210
+ description: Indemnification obligations
211
+ limitation_of_liability:
212
+ type: string
213
+ description: Liability limitations and exclusions
214
+ insurance_requirements:
215
+ type: string
216
+ description: Required insurance coverage
217
+ confidentiality:
218
+ type: object
219
+ description: Confidentiality and non-disclosure terms
220
+ properties:
221
+ confidentiality_period:
222
+ type: string
223
+ description: Duration of confidentiality obligations
224
+ definition_of_confidential_info:
225
+ type: string
226
+ description: What is considered confidential
227
+ permitted_disclosures:
228
+ type: string
229
+ description: Exceptions to confidentiality
230
+ intellectual_property:
231
+ type: object
232
+ description: IP ownership and licensing terms
233
+ properties:
234
+ ownership:
235
+ type: string
236
+ description: Who owns created IP
237
+ licensing_terms:
238
+ type: string
239
+ description: License grants if any
240
+ usage_rights:
241
+ type: string
242
+ description: Rights to use IP
243
+ governing_law:
244
+ type: string
245
+ description: Governing law jurisdiction (e.g., "State of California, USA")
246
+ dispute_resolution:
247
+ type: string
248
+ description: Dispute resolution mechanism (arbitration, mediation, courts)
249
+ enum:
250
+ - arbitration
251
+ - mediation
252
+ - litigation
253
+ - escalation
254
+ - other
255
+ risk_flags:
256
+ type: array
257
+ description: Unusual or potentially risky clauses identified
258
+ items:
259
+ type: object
260
+ properties:
261
+ clause:
262
+ type: string
263
+ description: Clause description
264
+ risk_level:
265
+ type: string
266
+ description: Risk assessment
267
+ enum:
268
+ - low
269
+ - medium
270
+ - high
271
+ - critical
272
+ reason:
273
+ type: string
274
+ description: Why this is flagged
275
+ required:
276
+ - clause
277
+ - risk_level
278
+ - reason
279
+ notes:
280
+ type: string
281
+ description: Additional notes or ambiguities found
282
+ confidence_score:
283
+ type: number
284
+ description: Confidence score for extraction quality (0.0-1.0)
285
+ minimum: 0.0
286
+ maximum: 1.0
287
+ required:
288
+ - contract_title
289
+ - contract_type
290
+ - parties
291
+ - effective_date
292
+ - financial_terms
293
+ - key_obligations
294
+ - confidence_score
295
+ json_schema_extra:
296
+ kind: agent
297
+ name: contract-analyzer
298
+ version: 1.0.0
299
+ short_name: contract-analyzer
300
+ tags:
301
+ - legal
302
+ - procurement
303
+ - ontology-extractor
304
+ author: REM Team
305
+ tools: []
306
+ resources: []
307
+ provider_configs:
308
+ - provider_name: anthropic
309
+ model_name: claude-sonnet-4-5-20250929
310
+ - provider_name: openai
311
+ model_name: gpt-4o
312
+ embedding_fields:
313
+ - contract_title
314
+ - contract_type
315
+ - parties
316
+ - key_obligations
317
+ - risk_flags
@@ -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-4o