memra 0.2.7__py3-none-any.whl → 0.2.10__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.
memra/__init__.py CHANGED
@@ -6,7 +6,7 @@ Think of it as "Kubernetes for business logic" where agents are the pods and
6
6
  departments are the deployments.
7
7
  """
8
8
 
9
- __version__ = "0.2.7"
9
+ __version__ = "0.2.10"
10
10
 
11
11
  # Core imports
12
12
  from .models import Agent, Department, Tool, LLM
memra/cli.py CHANGED
@@ -24,6 +24,9 @@ def run_demo():
24
24
  print("🔧 Configuring environment...")
25
25
  setup_environment()
26
26
 
27
+ # Step 2.5: Install dependencies
28
+ install_dependencies()
29
+
27
30
  # Step 3: Start Docker containers
28
31
  print("🐳 Starting Docker services...")
29
32
  if not start_docker_services(demo_dir):
@@ -159,9 +162,41 @@ if __name__ == '__main__':
159
162
  with open(ops_dir / "mcp_bridge_server.py", "w") as f:
160
163
  f.write(mcp_content)
161
164
 
162
- # Create demo workflow
165
+ # Copy the real ETL demo if available
163
166
  demo_dir.mkdir(exist_ok=True)
164
- demo_content = """#!/usr/bin/env python3
167
+ import shutil
168
+
169
+ try:
170
+ # Try to copy from demos directory
171
+ source_demo = Path("demos/etl_invoice_processing/etl_invoice_demo.py")
172
+ if source_demo.exists():
173
+ # Copy the main demo script
174
+ shutil.copy2(source_demo, demo_dir / "etl_invoice_demo.py")
175
+ print("✅ Copied real ETL demo script")
176
+
177
+ # Copy all necessary Python dependencies
178
+ demo_files = [
179
+ "database_monitor_agent.py",
180
+ "simple_pdf_processor.py",
181
+ "setup_demo_data.py"
182
+ ]
183
+
184
+ for file_name in demo_files:
185
+ source_file = Path(f"demos/etl_invoice_processing/{file_name}")
186
+ if source_file.exists():
187
+ shutil.copy2(source_file, demo_dir / file_name)
188
+ print(f"✅ Copied {file_name}")
189
+
190
+ # Copy sample data
191
+ data_dir = demo_dir / "data"
192
+ data_dir.mkdir(exist_ok=True)
193
+ source_data = Path("demos/etl_invoice_processing/data")
194
+ if source_data.exists():
195
+ shutil.copytree(source_data, data_dir, dirs_exist_ok=True)
196
+ print("✅ Copied sample invoice data")
197
+ else:
198
+ # Create a basic demo if real one not found
199
+ demo_content = """#!/usr/bin/env python3
165
200
  import os
166
201
  import sys
167
202
  import time
@@ -194,9 +229,47 @@ def main():
194
229
  if __name__ == "__main__":
195
230
  main()
196
231
  """
232
+ with open(demo_dir / "etl_demo.py", "w") as f:
233
+ f.write(demo_content)
234
+ print("⚠️ Using simplified demo (real demo not found)")
235
+ except Exception as e:
236
+ print(f"Warning: Could not copy ETL demo: {e}")
237
+ # Fallback to basic demo
238
+ demo_content = """#!/usr/bin/env python3
239
+ import os
240
+ import sys
241
+ import time
242
+
243
+ def main():
244
+ print("🚀 Starting ETL Invoice Processing Demo...")
245
+ print("🏢 Starting ETL Invoice Processing Department")
246
+ print("📋 Mission: Complete end-to-end ETL process with comprehensive monitoring")
247
+ print("👥 Team: Pre-ETL Database Monitor, Data Engineer, Invoice Parser, Data Entry Specialist, Post-ETL Database Monitor")
248
+ print("👔 Manager: ETL Process Manager")
249
+
250
+ steps = [
251
+ ("Pre-ETL Database Monitor", "Database state captured: 2 rows"),
252
+ ("Data Engineer", "Schema extracted successfully"),
253
+ ("Invoice Parser", "Invoice data extracted: $270.57"),
254
+ ("Data Entry Specialist", "Record inserted: ID 1"),
255
+ ("Post-ETL Database Monitor", "Database state captured: 3 rows")
256
+ ]
197
257
 
198
- with open(demo_dir / "etl_demo.py", "w") as f:
199
- f.write(demo_content)
258
+ for i, (step, result) in enumerate(steps, 1):
259
+ print(f"\\n🔄 Step {i}/5: {step}")
260
+ time.sleep(1)
261
+ print(f"✅ {result}")
262
+
263
+ print("\\n🎉 ETL Invoice Processing Department workflow completed!")
264
+ print("⏱️ Total time: 5.2s")
265
+ print("\\n📊 Demo completed successfully!")
266
+ print("This was a simplified demo. For the full experience, check out the complete ETL workflow.")
267
+
268
+ if __name__ == "__main__":
269
+ main()
270
+ """
271
+ with open(demo_dir / "etl_demo.py", "w") as f:
272
+ f.write(demo_content)
200
273
 
201
274
  def setup_environment():
202
275
  """Set up environment variables for the demo"""
@@ -209,6 +282,38 @@ def setup_environment():
209
282
  os.environ['DATABASE_URL'] = 'postgresql://postgres:postgres@localhost:5432/local_workflow'
210
283
  print("✅ Set DATABASE_URL")
211
284
 
285
+ def install_dependencies():
286
+ """Install required dependencies for the demo"""
287
+ try:
288
+ print("📦 Installing demo dependencies...")
289
+ dependencies = [
290
+ 'requests==2.31.0',
291
+ 'fastapi==0.104.1',
292
+ 'uvicorn[standard]==0.24.0',
293
+ 'pydantic==2.5.0',
294
+ 'aiohttp',
295
+ 'psycopg2-binary',
296
+ 'httpx',
297
+ 'huggingface_hub'
298
+ ]
299
+
300
+ for dep in dependencies:
301
+ print(f" Installing {dep}...")
302
+ result = subprocess.run([
303
+ sys.executable, '-m', 'pip', 'install', dep
304
+ ], capture_output=True, text=True)
305
+
306
+ if result.returncode != 0:
307
+ print(f"⚠️ Warning: Failed to install {dep}: {result.stderr}")
308
+ else:
309
+ print(f" ✅ {dep} installed")
310
+
311
+ print("✅ Dependencies installed")
312
+
313
+ except Exception as e:
314
+ print(f"⚠️ Warning: Could not install dependencies: {e}")
315
+ print(" You may need to install them manually: pip install requests fastapi uvicorn pydantic")
316
+
212
317
  def start_docker_services(demo_dir):
213
318
  """Start Docker containers using docker-compose"""
214
319
  try:
@@ -269,14 +374,22 @@ def wait_for_services():
269
374
  def run_etl_workflow(demo_dir):
270
375
  """Run the ETL workflow"""
271
376
  try:
272
- # Run the demo script
273
- demo_script = demo_dir / "etl_demo.py"
274
- if demo_script.exists():
275
- result = subprocess.run([sys.executable, str(demo_script)], cwd=demo_dir)
377
+ # Try to run the real ETL demo first
378
+ real_demo_script = demo_dir / "etl_invoice_demo.py"
379
+ if real_demo_script.exists():
380
+ print("🎯 Running real ETL workflow...")
381
+ result = subprocess.run([sys.executable, str(real_demo_script)], cwd=demo_dir)
276
382
  return result.returncode == 0
277
383
  else:
278
- print("❌ Demo script not found")
279
- return False
384
+ # Fallback to simplified demo
385
+ demo_script = demo_dir / "etl_demo.py"
386
+ if demo_script.exists():
387
+ print("🎯 Running simplified demo...")
388
+ result = subprocess.run([sys.executable, str(demo_script)], cwd=demo_dir)
389
+ return result.returncode == 0
390
+ else:
391
+ print("❌ No demo script found")
392
+ return False
280
393
 
281
394
  except Exception as e:
282
395
  print(f"❌ Error running ETL workflow: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memra
3
- Version: 0.2.7
3
+ Version: 0.2.10
4
4
  Summary: Declarative framework for enterprise workflows with MCP integration - Client SDK
5
5
  Home-page: https://github.com/memra/memra-sdk
6
6
  Author: Memra
@@ -1,12 +1,12 @@
1
- memra/__init__.py,sha256=nWJdpb-pKHUShd-LGJnKiVO0NUZS3QY0apYiLu54o2c,1108
2
- memra/cli.py,sha256=DSkgwlko8NqUMdXxt-_Y7hMdqMGkGmF6PuzhQqCyjto,10310
1
+ memra/__init__.py,sha256=8K5E9VPGIGw_qXacotFLSbmDomj7Nn9J9-vEyvkP8Sc,1109
2
+ memra/cli.py,sha256=MIiMh0ABLxsa6Vt_Kf6-_ToozO590m2UhUXYcynEm_8,14867
3
3
  memra/discovery.py,sha256=yJIQnrDQu1nyzKykCIuzG_5SW5dIXHCEBLLKRWacIoY,480
4
4
  memra/discovery_client.py,sha256=AbnKn6qhyrf7vmOvknEeDzH4tiGHsqPHtDaein_qaW0,1271
5
5
  memra/execution.py,sha256=OXpBKxwBIjhACWL_qh8KHNndO8HUgB6gBF81AiQBBm0,34751
6
6
  memra/models.py,sha256=3KvjPCaMFGIvI017AIHS23jGnEBZdKHspe1Fp8w0xa0,3418
7
7
  memra/tool_registry.py,sha256=PDuWtiX_LX-vhKnx4JeL_ndUwG-oJ6bdhGe6iQeCDBw,15361
8
8
  memra/tool_registry_client.py,sha256=dPIj6DMS5wdu99XmVm-NQYHKH_m6nsknCh4C_imTFig,4009
9
- memra-0.2.7.dist-info/licenses/LICENSE,sha256=8OrnTd8DWwLWmUEj5srSLvT4PREfW1Qo1T5gEUIHPws,1062
9
+ memra-0.2.10.dist-info/licenses/LICENSE,sha256=8OrnTd8DWwLWmUEj5srSLvT4PREfW1Qo1T5gEUIHPws,1062
10
10
  memra-ops/app.py,sha256=S8B82gOAuT9x-NhmVLL9HM03Pde3Fa7QXm6TG1PEbbU,29439
11
11
  memra-ops/config.py,sha256=6mBbS_stoEIhJDBqdJOalryAnyWeHbDy81mU1j08ids,969
12
12
  memra-ops/mcp_bridge_server.py,sha256=tDEigRstIEAEu16F1ctCor2ny9CBbEOMY046bHdzFpE,47607
@@ -61,8 +61,8 @@ memra-workflows/propane_delivery/propane_delivery.py,sha256=ryvIxDjM9GJY9T6fFIqJ
61
61
  memra-workflows/text_to_sql/complete_invoice_workflow_with_queries.py,sha256=x4wq3o_ogFnnrI6MQwEhqIiNH-NNwS5SXQUoKd_br7U,7428
62
62
  memra-workflows/text_to_sql/complete_text_to_sql_system.py,sha256=Izj4ucXDXTWFY29SWr2YrEf3ZyXH4QCDEljNk4jlpI0,8991
63
63
  memra-workflows/text_to_sql/file_discovery_demo.py,sha256=4R_QN0Y6OtHmnX6CvtwDXen122XCDrk-MRBOzxb_x_k,5306
64
- memra-0.2.7.dist-info/METADATA,sha256=TZp_c_HARduOj9mHJuWsUgCv5JeDgYjyXVQFIVdKnTQ,10736
65
- memra-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
66
- memra-0.2.7.dist-info/entry_points.txt,sha256=LBVjwWoxWJRzNLgeByPn6xUvWFIRnqnemvAZgIoSt08,41
67
- memra-0.2.7.dist-info/top_level.txt,sha256=IviXF9qSQY_BidRYund9zFaV-q1VMl6CuizwTAggQks,42
68
- memra-0.2.7.dist-info/RECORD,,
64
+ memra-0.2.10.dist-info/METADATA,sha256=_Ukg8mLK1sJ81RTTVOnx2j_n7myrLm6-QZSzcq3iChc,10737
65
+ memra-0.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
66
+ memra-0.2.10.dist-info/entry_points.txt,sha256=LBVjwWoxWJRzNLgeByPn6xUvWFIRnqnemvAZgIoSt08,41
67
+ memra-0.2.10.dist-info/top_level.txt,sha256=IviXF9qSQY_BidRYund9zFaV-q1VMl6CuizwTAggQks,42
68
+ memra-0.2.10.dist-info/RECORD,,
File without changes