memra 0.2.3__py3-none-any.whl → 0.2.5__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 +16 -2
- memra/cli.py +286 -0
- memra/execution.py +222 -41
- memra/models.py +1 -0
- memra/tool_registry.py +8 -0
- memra/tool_registry_client.py +2 -2
- memra-0.2.5.dist-info/METADATA +319 -0
- memra-0.2.5.dist-info/RECORD +68 -0
- memra-0.2.5.dist-info/entry_points.txt +2 -0
- memra-0.2.5.dist-info/licenses/LICENSE +21 -0
- memra-0.2.5.dist-info/top_level.txt +4 -0
- memra-ops/app.py +808 -0
- memra-ops/config/config.py +25 -0
- memra-ops/config.py +34 -0
- memra-ops/logic/__init__.py +1 -0
- memra-ops/logic/file_tools.py +43 -0
- memra-ops/logic/invoice_tools.py +668 -0
- memra-ops/logic/invoice_tools_fix.py +66 -0
- memra-ops/mcp_bridge_server.py +1178 -0
- memra-ops/scripts/check_database.py +37 -0
- memra-ops/scripts/clear_database.py +48 -0
- memra-ops/scripts/monitor_database.py +67 -0
- memra-ops/scripts/release.py +133 -0
- memra-ops/scripts/reset_database.py +65 -0
- memra-ops/scripts/start_memra.py +334 -0
- memra-ops/scripts/stop_memra.py +132 -0
- memra-ops/server_tool_registry.py +190 -0
- memra-ops/tests/test_llm_text_to_sql.py +115 -0
- memra-ops/tests/test_llm_vs_pattern.py +130 -0
- memra-ops/tests/test_mcp_schema_aware.py +124 -0
- memra-ops/tests/test_schema_aware_sql.py +139 -0
- memra-ops/tests/test_schema_aware_sql_simple.py +66 -0
- memra-ops/tests/test_text_to_sql_demo.py +140 -0
- memra-ops/tools/mcp_bridge_server.py +851 -0
- memra-sdk/examples/accounts_payable.py +215 -0
- memra-sdk/examples/accounts_payable_client.py +217 -0
- memra-sdk/examples/accounts_payable_mcp.py +200 -0
- memra-sdk/examples/ask_questions.py +123 -0
- memra-sdk/examples/invoice_processing.py +116 -0
- memra-sdk/examples/propane_delivery.py +87 -0
- memra-sdk/examples/simple_text_to_sql.py +158 -0
- memra-sdk/memra/__init__.py +31 -0
- memra-sdk/memra/discovery.py +15 -0
- memra-sdk/memra/discovery_client.py +49 -0
- memra-sdk/memra/execution.py +481 -0
- memra-sdk/memra/models.py +99 -0
- memra-sdk/memra/tool_registry.py +343 -0
- memra-sdk/memra/tool_registry_client.py +106 -0
- memra-sdk/scripts/release.py +133 -0
- memra-sdk/setup.py +52 -0
- memra-workflows/accounts_payable/accounts_payable.py +215 -0
- memra-workflows/accounts_payable/accounts_payable_client.py +216 -0
- memra-workflows/accounts_payable/accounts_payable_mcp.py +200 -0
- memra-workflows/accounts_payable/accounts_payable_smart.py +221 -0
- memra-workflows/invoice_processing/invoice_processing.py +116 -0
- memra-workflows/invoice_processing/smart_invoice_processor.py +220 -0
- memra-workflows/logic/__init__.py +1 -0
- memra-workflows/logic/file_tools.py +50 -0
- memra-workflows/logic/invoice_tools.py +501 -0
- memra-workflows/logic/propane_agents.py +52 -0
- memra-workflows/mcp_bridge_server.py +230 -0
- memra-workflows/propane_delivery/propane_delivery.py +87 -0
- memra-workflows/text_to_sql/complete_invoice_workflow_with_queries.py +208 -0
- memra-workflows/text_to_sql/complete_text_to_sql_system.py +266 -0
- memra-workflows/text_to_sql/file_discovery_demo.py +156 -0
- memra-0.2.3.dist-info/METADATA +0 -101
- memra-0.2.3.dist-info/RECORD +0 -12
- memra-0.2.3.dist-info/entry_points.txt +0 -2
- memra-0.2.3.dist-info/top_level.txt +0 -1
- {memra-0.2.3.dist-info → memra-0.2.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,25 @@
|
|
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
ADDED
@@ -0,0 +1,34 @@
|
|
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
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
# Logic package for Memra API server tools
|
@@ -0,0 +1,43 @@
|
|
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
|
+
}
|