memra 0.2.2__tar.gz → 0.2.4__tar.gz
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-0.2.4/PKG-INFO +145 -0
- memra-0.2.4/README.md +106 -0
- memra-0.2.4/mcp_bridge_server.py +851 -0
- memra-0.2.4/memra/__init__.py +31 -0
- memra-0.2.4/memra/discovery.py +15 -0
- memra-0.2.4/memra/discovery_client.py +49 -0
- memra-0.2.4/memra/execution.py +491 -0
- memra-0.2.4/memra/models.py +99 -0
- memra-0.2.4/memra/tool_registry.py +351 -0
- memra-0.2.4/memra/tool_registry_client.py +106 -0
- memra-0.2.4/memra-ops/app.py +710 -0
- memra-0.2.4/memra-ops/config/config.py +25 -0
- memra-0.2.4/memra-ops/config.py +34 -0
- memra-0.2.4/memra-ops/scripts/release.py +133 -0
- memra-0.2.4/memra-ops/scripts/start_memra.py +334 -0
- memra-0.2.4/memra-ops/scripts/stop_memra.py +132 -0
- memra-0.2.4/memra-ops/server_tool_registry.py +188 -0
- memra-0.2.4/memra-ops/tests/test_llm_text_to_sql.py +115 -0
- memra-0.2.4/memra-ops/tests/test_llm_vs_pattern.py +130 -0
- memra-0.2.4/memra-ops/tests/test_mcp_schema_aware.py +124 -0
- memra-0.2.4/memra-ops/tests/test_schema_aware_sql.py +139 -0
- memra-0.2.4/memra-ops/tests/test_schema_aware_sql_simple.py +66 -0
- memra-0.2.4/memra-ops/tests/test_text_to_sql_demo.py +140 -0
- memra-0.2.4/memra-ops/tools/mcp_bridge_server.py +851 -0
- memra-0.2.4/memra-sdk/examples/accounts_payable.py +215 -0
- memra-0.2.4/memra-sdk/examples/accounts_payable_client.py +217 -0
- memra-0.2.4/memra-sdk/examples/accounts_payable_mcp.py +200 -0
- memra-0.2.4/memra-sdk/examples/ask_questions.py +123 -0
- memra-0.2.4/memra-sdk/examples/invoice_processing.py +116 -0
- memra-0.2.4/memra-sdk/examples/propane_delivery.py +87 -0
- memra-0.2.4/memra-sdk/examples/simple_text_to_sql.py +158 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/__init__.py +6 -2
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/execution.py +43 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/tool_registry.py +154 -0
- memra-0.2.4/memra-sdk/scripts/release.py +133 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/setup.py +1 -1
- memra-0.2.4/memra-workflows/accounts_payable/accounts_payable.py +215 -0
- memra-0.2.4/memra-workflows/accounts_payable/accounts_payable_client.py +216 -0
- memra-0.2.4/memra-workflows/accounts_payable/accounts_payable_mcp.py +200 -0
- memra-0.2.4/memra-workflows/accounts_payable/accounts_payable_smart.py +221 -0
- memra-0.2.4/memra-workflows/invoice_processing/invoice_processing.py +116 -0
- memra-0.2.4/memra-workflows/invoice_processing/smart_invoice_processor.py +220 -0
- memra-0.2.4/memra-workflows/logic/__init__.py +1 -0
- memra-0.2.4/memra-workflows/logic/file_tools.py +50 -0
- memra-0.2.4/memra-workflows/logic/invoice_tools.py +501 -0
- memra-0.2.4/memra-workflows/logic/propane_agents.py +52 -0
- memra-0.2.4/memra-workflows/propane_delivery/propane_delivery.py +87 -0
- memra-0.2.4/memra-workflows/text_to_sql/complete_invoice_workflow_with_queries.py +208 -0
- memra-0.2.4/memra-workflows/text_to_sql/complete_text_to_sql_system.py +266 -0
- memra-0.2.4/memra-workflows/text_to_sql/file_discovery_demo.py +156 -0
- memra-0.2.4/memra.egg-info/SOURCES.txt +60 -0
- {memra-0.2.2 → memra-0.2.4}/pyproject.toml +1 -1
- memra-0.2.4/requirements.txt +6 -0
- memra-0.2.4/setup.py +52 -0
- memra-0.2.2/PKG-INFO +0 -148
- memra-0.2.2/README.md +0 -113
- memra-0.2.2/memra.egg-info/SOURCES.txt +0 -14
- {memra-0.2.2 → memra-0.2.4}/CHANGELOG.md +0 -0
- {memra-0.2.2 → memra-0.2.4}/LICENSE +0 -0
- {memra-0.2.2 → memra-0.2.4}/MANIFEST.in +0 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/discovery.py +0 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/discovery_client.py +0 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/models.py +0 -0
- {memra-0.2.2 → memra-0.2.4/memra-sdk}/memra/tool_registry_client.py +0 -0
- {memra-0.2.2 → memra-0.2.4/memra-workflows}/mcp_bridge_server.py +0 -0
- {memra-0.2.2 → memra-0.2.4}/setup.cfg +0 -0
memra-0.2.4/PKG-INFO
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: memra
|
3
|
+
Version: 0.2.4
|
4
|
+
Summary: Declarative framework for enterprise workflows with MCP integration - Client SDK
|
5
|
+
Home-page: https://github.com/memra/memra-sdk
|
6
|
+
Author: Memra
|
7
|
+
Author-email: Memra <support@memra.com>
|
8
|
+
License: MIT
|
9
|
+
Project-URL: Homepage, https://memra.co
|
10
|
+
Project-URL: Repository, https://github.com/memra-platform/memra-sdk
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Operating System :: OS Independent
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
20
|
+
Requires-Python: >=3.8
|
21
|
+
Description-Content-Type: text/markdown
|
22
|
+
License-File: LICENSE
|
23
|
+
Requires-Dist: pydantic>=1.8.0
|
24
|
+
Requires-Dist: httpx>=0.24.0
|
25
|
+
Requires-Dist: typing-extensions>=4.0.0
|
26
|
+
Requires-Dist: aiohttp>=3.8.0
|
27
|
+
Requires-Dist: aiohttp-cors>=0.7.0
|
28
|
+
Provides-Extra: dev
|
29
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
30
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
31
|
+
Requires-Dist: black; extra == "dev"
|
32
|
+
Requires-Dist: flake8; extra == "dev"
|
33
|
+
Provides-Extra: mcp
|
34
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "mcp"
|
35
|
+
Dynamic: author
|
36
|
+
Dynamic: home-page
|
37
|
+
Dynamic: license-file
|
38
|
+
Dynamic: requires-python
|
39
|
+
|
40
|
+
# Memra SDK
|
41
|
+
|
42
|
+
The core Memra framework for building AI-powered business workflows.
|
43
|
+
|
44
|
+
## Installation
|
45
|
+
|
46
|
+
```bash
|
47
|
+
pip install memra
|
48
|
+
```
|
49
|
+
|
50
|
+
## Quick Start
|
51
|
+
|
52
|
+
```python
|
53
|
+
from memra import Agent, Department, LLM, ExecutionEngine
|
54
|
+
|
55
|
+
# Define an agent
|
56
|
+
agent = Agent(
|
57
|
+
role="Data Analyst",
|
58
|
+
job="Analyze customer data",
|
59
|
+
llm=LLM(model="llama-3.2-11b-vision-preview"),
|
60
|
+
sops=["Load data", "Perform analysis", "Generate report"],
|
61
|
+
output_key="analysis_result"
|
62
|
+
)
|
63
|
+
|
64
|
+
# Create a department
|
65
|
+
department = Department(
|
66
|
+
name="Analytics",
|
67
|
+
mission="Provide data insights",
|
68
|
+
agents=[agent],
|
69
|
+
workflow_order=["Data Analyst"]
|
70
|
+
)
|
71
|
+
|
72
|
+
# Execute the workflow
|
73
|
+
engine = ExecutionEngine()
|
74
|
+
result = engine.execute_department(department, {"data": "customer_data.csv"})
|
75
|
+
```
|
76
|
+
|
77
|
+
## Core Components
|
78
|
+
|
79
|
+
### Agent
|
80
|
+
An AI worker that performs specific tasks using LLMs and tools.
|
81
|
+
|
82
|
+
### Department
|
83
|
+
A team of agents working together to accomplish a mission.
|
84
|
+
|
85
|
+
### ExecutionEngine
|
86
|
+
Orchestrates the execution of departments and their workflows.
|
87
|
+
|
88
|
+
### LLM
|
89
|
+
Configuration for language models used by agents.
|
90
|
+
|
91
|
+
## Examples
|
92
|
+
|
93
|
+
See the `examples/` directory for basic usage examples:
|
94
|
+
- `simple_text_to_sql.py` - Basic text-to-SQL conversion
|
95
|
+
- `ask_questions.py` - Simple question answering
|
96
|
+
|
97
|
+
## Documentation
|
98
|
+
|
99
|
+
For detailed documentation, visit [docs.memra.co](https://docs.memra.co)
|
100
|
+
|
101
|
+
Documentation is also available locally in the `examples/` directory.
|
102
|
+
|
103
|
+
## Example: Propane Delivery Workflow
|
104
|
+
|
105
|
+
See the `examples/propane_delivery.py` file for a complete example of how to use Memra to orchestrate a propane delivery workflow.
|
106
|
+
|
107
|
+
## 🔍 Smart File Discovery
|
108
|
+
|
109
|
+
Memra includes intelligent file discovery and management capabilities:
|
110
|
+
|
111
|
+
### File Discovery Tools
|
112
|
+
- **FileDiscovery**: Automatically scan directories for files matching patterns
|
113
|
+
- **FileCopy**: Copy files from external locations to standard processing directories
|
114
|
+
- **Smart Routing**: Automatically handle file paths and directory management
|
115
|
+
|
116
|
+
### Example: Smart Invoice Processing
|
117
|
+
```python
|
118
|
+
from memra import Agent
|
119
|
+
|
120
|
+
# Smart agent that discovers and processes files automatically
|
121
|
+
smart_parser = Agent(
|
122
|
+
role="Smart Invoice Parser",
|
123
|
+
job="Discover and process invoice files intelligently",
|
124
|
+
tools=[
|
125
|
+
{"name": "FileDiscovery", "hosted_by": "memra"},
|
126
|
+
{"name": "FileCopy", "hosted_by": "memra"},
|
127
|
+
{"name": "InvoiceExtractionWorkflow", "hosted_by": "memra"}
|
128
|
+
]
|
129
|
+
)
|
130
|
+
|
131
|
+
# Three modes of operation:
|
132
|
+
# 1. Auto-discovery: Scan invoices/ directory
|
133
|
+
# 2. External file: Copy from Downloads to invoices/
|
134
|
+
# 3. Specific file: Process exact file path
|
135
|
+
```
|
136
|
+
|
137
|
+
See `examples/accounts_payable_smart.py` for a complete implementation.
|
138
|
+
|
139
|
+
## Contributing
|
140
|
+
|
141
|
+
We welcome contributions! Please see our [contributing guide](CONTRIBUTING.md) for details.
|
142
|
+
|
143
|
+
## License
|
144
|
+
|
145
|
+
MIT License - see LICENSE file for details.
|
memra-0.2.4/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
# Memra SDK
|
2
|
+
|
3
|
+
The core Memra framework for building AI-powered business workflows.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
pip install memra
|
9
|
+
```
|
10
|
+
|
11
|
+
## Quick Start
|
12
|
+
|
13
|
+
```python
|
14
|
+
from memra import Agent, Department, LLM, ExecutionEngine
|
15
|
+
|
16
|
+
# Define an agent
|
17
|
+
agent = Agent(
|
18
|
+
role="Data Analyst",
|
19
|
+
job="Analyze customer data",
|
20
|
+
llm=LLM(model="llama-3.2-11b-vision-preview"),
|
21
|
+
sops=["Load data", "Perform analysis", "Generate report"],
|
22
|
+
output_key="analysis_result"
|
23
|
+
)
|
24
|
+
|
25
|
+
# Create a department
|
26
|
+
department = Department(
|
27
|
+
name="Analytics",
|
28
|
+
mission="Provide data insights",
|
29
|
+
agents=[agent],
|
30
|
+
workflow_order=["Data Analyst"]
|
31
|
+
)
|
32
|
+
|
33
|
+
# Execute the workflow
|
34
|
+
engine = ExecutionEngine()
|
35
|
+
result = engine.execute_department(department, {"data": "customer_data.csv"})
|
36
|
+
```
|
37
|
+
|
38
|
+
## Core Components
|
39
|
+
|
40
|
+
### Agent
|
41
|
+
An AI worker that performs specific tasks using LLMs and tools.
|
42
|
+
|
43
|
+
### Department
|
44
|
+
A team of agents working together to accomplish a mission.
|
45
|
+
|
46
|
+
### ExecutionEngine
|
47
|
+
Orchestrates the execution of departments and their workflows.
|
48
|
+
|
49
|
+
### LLM
|
50
|
+
Configuration for language models used by agents.
|
51
|
+
|
52
|
+
## Examples
|
53
|
+
|
54
|
+
See the `examples/` directory for basic usage examples:
|
55
|
+
- `simple_text_to_sql.py` - Basic text-to-SQL conversion
|
56
|
+
- `ask_questions.py` - Simple question answering
|
57
|
+
|
58
|
+
## Documentation
|
59
|
+
|
60
|
+
For detailed documentation, visit [docs.memra.co](https://docs.memra.co)
|
61
|
+
|
62
|
+
Documentation is also available locally in the `examples/` directory.
|
63
|
+
|
64
|
+
## Example: Propane Delivery Workflow
|
65
|
+
|
66
|
+
See the `examples/propane_delivery.py` file for a complete example of how to use Memra to orchestrate a propane delivery workflow.
|
67
|
+
|
68
|
+
## 🔍 Smart File Discovery
|
69
|
+
|
70
|
+
Memra includes intelligent file discovery and management capabilities:
|
71
|
+
|
72
|
+
### File Discovery Tools
|
73
|
+
- **FileDiscovery**: Automatically scan directories for files matching patterns
|
74
|
+
- **FileCopy**: Copy files from external locations to standard processing directories
|
75
|
+
- **Smart Routing**: Automatically handle file paths and directory management
|
76
|
+
|
77
|
+
### Example: Smart Invoice Processing
|
78
|
+
```python
|
79
|
+
from memra import Agent
|
80
|
+
|
81
|
+
# Smart agent that discovers and processes files automatically
|
82
|
+
smart_parser = Agent(
|
83
|
+
role="Smart Invoice Parser",
|
84
|
+
job="Discover and process invoice files intelligently",
|
85
|
+
tools=[
|
86
|
+
{"name": "FileDiscovery", "hosted_by": "memra"},
|
87
|
+
{"name": "FileCopy", "hosted_by": "memra"},
|
88
|
+
{"name": "InvoiceExtractionWorkflow", "hosted_by": "memra"}
|
89
|
+
]
|
90
|
+
)
|
91
|
+
|
92
|
+
# Three modes of operation:
|
93
|
+
# 1. Auto-discovery: Scan invoices/ directory
|
94
|
+
# 2. External file: Copy from Downloads to invoices/
|
95
|
+
# 3. Specific file: Process exact file path
|
96
|
+
```
|
97
|
+
|
98
|
+
See `examples/accounts_payable_smart.py` for a complete implementation.
|
99
|
+
|
100
|
+
## Contributing
|
101
|
+
|
102
|
+
We welcome contributions! Please see our [contributing guide](CONTRIBUTING.md) for details.
|
103
|
+
|
104
|
+
## License
|
105
|
+
|
106
|
+
MIT License - see LICENSE file for details.
|