memra 0.2.12__py3-none-any.whl → 0.2.14__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.
Files changed (115) hide show
  1. memra/cli.py +143 -9
  2. memra/demos/etl_invoice_processing/check_after_workflow.py +50 -0
  3. memra/demos/etl_invoice_processing/check_database.py +44 -0
  4. memra/demos/etl_invoice_processing/check_recent_db.py +42 -0
  5. memra/demos/etl_invoice_processing/data/README.md +112 -0
  6. memra/demos/etl_invoice_processing/data/invoices/10352259401.PDF +0 -0
  7. memra/demos/etl_invoice_processing/data/invoices/10352259823.PDF +0 -0
  8. memra/demos/etl_invoice_processing/data/invoices/10352260169.PDF +0 -0
  9. memra/demos/etl_invoice_processing/data/invoices/10352260417.PDF +0 -0
  10. memra/demos/etl_invoice_processing/data/invoices/10352260599.PDF +0 -0
  11. memra/demos/etl_invoice_processing/data/invoices/10352260912.PDF +0 -0
  12. memra/demos/etl_invoice_processing/data/invoices/10352261134.PDF +0 -0
  13. memra/demos/etl_invoice_processing/data/invoices/10352261563.PDF +0 -0
  14. memra/demos/etl_invoice_processing/data/invoices/10352261647.PDF +0 -0
  15. memra/demos/etl_invoice_processing/data/invoices/10352261720.PDF +0 -0
  16. memra/demos/etl_invoice_processing/data/invoices/10352261811.PDF +0 -0
  17. memra/demos/etl_invoice_processing/data/invoices/10352262025.PDF +0 -0
  18. memra/demos/etl_invoice_processing/data/invoices/10352262454.PDF +0 -0
  19. memra/demos/etl_invoice_processing/data/invoices/10352262702.PDF +0 -0
  20. memra/demos/etl_invoice_processing/data/invoices/10352262884.PDF +0 -0
  21. memra/demos/etl_invoice_processing/data/invoices/10352263346.PDF +0 -0
  22. memra/demos/etl_invoice_processing/data/invoices/10352263429.PDF +0 -0
  23. memra/demos/etl_invoice_processing/database_monitor_agent.py +89 -0
  24. memra/demos/etl_invoice_processing/debug_mcp.py +66 -0
  25. memra/demos/etl_invoice_processing/debug_schema.py +45 -0
  26. memra/demos/etl_invoice_processing/etl_invoice_demo.py +1233 -0
  27. memra/demos/etl_invoice_processing/modify_database.py +65 -0
  28. memra/demos/etl_invoice_processing/run_etl_batch.py +60 -0
  29. memra/demos/etl_invoice_processing/setup_demo_data.py +154 -0
  30. memra/demos/etl_invoice_processing/simple_pdf_processor.py +181 -0
  31. memra/demos/etl_invoice_processing/test_agent3.py +56 -0
  32. memra/demos/etl_invoice_processing/test_agent3_v2.py +32 -0
  33. memra/demos/etl_invoice_processing/test_api.py +28 -0
  34. memra/demos/etl_invoice_processing/test_api_client_direct.py +89 -0
  35. memra/demos/etl_invoice_processing/test_conversion.py +172 -0
  36. memra/demos/etl_invoice_processing/test_debug.py +41 -0
  37. memra/demos/etl_invoice_processing/test_direct_vision.py +114 -0
  38. memra/demos/etl_invoice_processing/test_full_response.py +22 -0
  39. memra/demos/etl_invoice_processing/test_memra_response.py +124 -0
  40. memra/demos/etl_invoice_processing/test_pdf_processor_response.py +118 -0
  41. memra/demos/etl_invoice_processing/test_pdfprocessor_direct.py +96 -0
  42. memra/demos/etl_invoice_processing/test_postgres_insert.py +120 -0
  43. memra/demos/etl_invoice_processing/test_remote_upload.py +143 -0
  44. memra/demos/etl_invoice_processing/test_schema_format.py +39 -0
  45. memra/demos/etl_invoice_processing/test_sql_executor.py +58 -0
  46. memra/demos/etl_invoice_processing/test_sql_executor_extra_fields.py +61 -0
  47. memra/demos/etl_invoice_processing/test_sql_executor_fix.py +40 -0
  48. memra/demos/etl_invoice_processing/test_updated_server.py +50 -0
  49. memra/demos/etl_invoice_processing/test_upload_functionality.py +156 -0
  50. memra/demos/etl_invoice_processing/test_upload_server.py +232 -0
  51. memra/demos/etl_invoice_processing/test_vision_output.py +75 -0
  52. memra/demos/etl_invoice_processing/test_vision_prompt.py +43 -0
  53. memra/demos/etl_invoice_processing/test_vision_simple.py +60 -0
  54. {memra-0.2.12.dist-info → memra-0.2.14.dist-info}/METADATA +53 -78
  55. memra-0.2.14.dist-info/RECORD +66 -0
  56. {memra-0.2.12.dist-info → memra-0.2.14.dist-info}/WHEEL +1 -1
  57. memra-0.2.14.dist-info/top_level.txt +1 -0
  58. memra-0.2.12.dist-info/RECORD +0 -68
  59. memra-0.2.12.dist-info/top_level.txt +0 -4
  60. memra-ops/app.py +0 -808
  61. memra-ops/config/config.py +0 -25
  62. memra-ops/config.py +0 -34
  63. memra-ops/logic/__init__.py +0 -1
  64. memra-ops/logic/file_tools.py +0 -43
  65. memra-ops/logic/invoice_tools.py +0 -668
  66. memra-ops/logic/invoice_tools_fix.py +0 -66
  67. memra-ops/mcp_bridge_server.py +0 -1178
  68. memra-ops/scripts/check_database.py +0 -37
  69. memra-ops/scripts/clear_database.py +0 -48
  70. memra-ops/scripts/monitor_database.py +0 -67
  71. memra-ops/scripts/release.py +0 -133
  72. memra-ops/scripts/reset_database.py +0 -65
  73. memra-ops/scripts/start_memra.py +0 -334
  74. memra-ops/scripts/stop_memra.py +0 -132
  75. memra-ops/server_tool_registry.py +0 -190
  76. memra-ops/tests/test_llm_text_to_sql.py +0 -115
  77. memra-ops/tests/test_llm_vs_pattern.py +0 -130
  78. memra-ops/tests/test_mcp_schema_aware.py +0 -124
  79. memra-ops/tests/test_schema_aware_sql.py +0 -139
  80. memra-ops/tests/test_schema_aware_sql_simple.py +0 -66
  81. memra-ops/tests/test_text_to_sql_demo.py +0 -140
  82. memra-ops/tools/mcp_bridge_server.py +0 -851
  83. memra-sdk/examples/accounts_payable.py +0 -215
  84. memra-sdk/examples/accounts_payable_client.py +0 -217
  85. memra-sdk/examples/accounts_payable_mcp.py +0 -200
  86. memra-sdk/examples/ask_questions.py +0 -123
  87. memra-sdk/examples/invoice_processing.py +0 -116
  88. memra-sdk/examples/propane_delivery.py +0 -87
  89. memra-sdk/examples/simple_text_to_sql.py +0 -158
  90. memra-sdk/memra/__init__.py +0 -31
  91. memra-sdk/memra/discovery.py +0 -15
  92. memra-sdk/memra/discovery_client.py +0 -49
  93. memra-sdk/memra/execution.py +0 -481
  94. memra-sdk/memra/models.py +0 -99
  95. memra-sdk/memra/tool_registry.py +0 -343
  96. memra-sdk/memra/tool_registry_client.py +0 -106
  97. memra-sdk/scripts/release.py +0 -133
  98. memra-sdk/setup.py +0 -52
  99. memra-workflows/accounts_payable/accounts_payable.py +0 -215
  100. memra-workflows/accounts_payable/accounts_payable_client.py +0 -216
  101. memra-workflows/accounts_payable/accounts_payable_mcp.py +0 -200
  102. memra-workflows/accounts_payable/accounts_payable_smart.py +0 -221
  103. memra-workflows/invoice_processing/invoice_processing.py +0 -116
  104. memra-workflows/invoice_processing/smart_invoice_processor.py +0 -220
  105. memra-workflows/logic/__init__.py +0 -1
  106. memra-workflows/logic/file_tools.py +0 -50
  107. memra-workflows/logic/invoice_tools.py +0 -501
  108. memra-workflows/logic/propane_agents.py +0 -52
  109. memra-workflows/mcp_bridge_server.py +0 -230
  110. memra-workflows/propane_delivery/propane_delivery.py +0 -87
  111. memra-workflows/text_to_sql/complete_invoice_workflow_with_queries.py +0 -208
  112. memra-workflows/text_to_sql/complete_text_to_sql_system.py +0 -266
  113. memra-workflows/text_to_sql/file_discovery_demo.py +0 -156
  114. {memra-0.2.12.dist-info/licenses → memra-0.2.14.dist-info}/LICENSE +0 -0
  115. {memra-0.2.12.dist-info → memra-0.2.14.dist-info}/entry_points.txt +0 -0
@@ -1,25 +0,0 @@
1
- """
2
- Configuration for Memra SDK examples
3
- Contains LLM configurations for different agent types
4
- """
5
-
6
- # Default LLM configuration for general use
7
- DEFAULT_LLM_CONFIG = {
8
- "model": "llama-3.2-11b-vision-preview",
9
- "temperature": 0.1,
10
- "max_tokens": 2000
11
- }
12
-
13
- # Specialized LLM configurations for different agent types
14
- AGENT_LLM_CONFIG = {
15
- "parsing": {
16
- "model": "llama-3.2-11b-vision-preview",
17
- "temperature": 0.0,
18
- "max_tokens": 4000
19
- },
20
- "manager": {
21
- "model": "llama-3.2-11b-vision-preview",
22
- "temperature": 0.2,
23
- "max_tokens": 1000
24
- }
25
- }
memra-ops/config.py DELETED
@@ -1,34 +0,0 @@
1
- # Memra SDK Configuration
2
- # LLM API Configuration for agent processing
3
-
4
- API_CONFIG = {
5
- "huggingface": {
6
- "api_key": "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",
7
- "model": "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
8
- "max_tokens": 2000
9
- }
10
- }
11
-
12
- # Default LLM settings for agents
13
- DEFAULT_LLM_CONFIG = {
14
- "provider": "huggingface",
15
- "model": "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
16
- "temperature": 0.1,
17
- "max_tokens": 2000
18
- }
19
-
20
- # Agent-specific LLM configurations
21
- AGENT_LLM_CONFIG = {
22
- "parsing": {
23
- "provider": "huggingface",
24
- "model": "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
25
- "temperature": 0.0, # More deterministic for data extraction
26
- "max_tokens": 2000
27
- },
28
- "manager": {
29
- "provider": "huggingface",
30
- "model": "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
31
- "temperature": 0.3, # More flexible for decision making
32
- "max_tokens": 1500
33
- }
34
- }
@@ -1 +0,0 @@
1
- # Logic package for Memra API server tools
@@ -1,43 +0,0 @@
1
- """
2
- File handling tools for the Memra API server
3
- """
4
-
5
- import os
6
- import logging
7
- from typing import Dict, Any
8
-
9
- logger = logging.getLogger(__name__)
10
-
11
- class FileReader:
12
- """Read files from the filesystem"""
13
-
14
- def __init__(self):
15
- pass
16
-
17
- def read_file(self, file_path: str) -> Dict[str, Any]:
18
- """Read a file and return its contents"""
19
- try:
20
- if not os.path.exists(file_path):
21
- return {
22
- "success": False,
23
- "error": f"File not found: {file_path}"
24
- }
25
-
26
- with open(file_path, 'r', encoding='utf-8') as f:
27
- content = f.read()
28
-
29
- return {
30
- "success": True,
31
- "data": {
32
- "file_path": file_path,
33
- "content": content,
34
- "size": len(content)
35
- }
36
- }
37
-
38
- except Exception as e:
39
- logger.error(f"File reading failed: {str(e)}")
40
- return {
41
- "success": False,
42
- "error": str(e)
43
- }