memra 0.2.12__tar.gz → 0.2.13__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.12 → memra-0.2.13}/PKG-INFO +43 -68
- {memra-0.2.12 → memra-0.2.13}/README.md +41 -62
- {memra-0.2.12 → memra-0.2.13}/memra/cli.py +114 -8
- memra-0.2.13/memra/demos/etl_invoice_processing/check_after_workflow.py +50 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/check_database.py +44 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/check_recent_db.py +42 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/README.md +112 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352259401.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352259823.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352260169.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352260417.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352260599.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352260912.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352261134.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352261563.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352261647.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352261720.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352261811.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352262025.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352262454.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352262702.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352262884.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352263346.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/data/invoices/10352263429.PDF +0 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/database_monitor_agent.py +89 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/debug_mcp.py +66 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/debug_schema.py +45 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/etl_invoice_demo.py +1233 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/modify_database.py +65 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/run_etl_batch.py +60 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/setup_demo_data.py +154 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/simple_pdf_processor.py +181 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_agent3.py +56 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_agent3_v2.py +32 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_api.py +28 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_api_client_direct.py +89 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_conversion.py +172 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_debug.py +41 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_direct_vision.py +114 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_full_response.py +22 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_memra_response.py +124 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_pdf_processor_response.py +118 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_pdfprocessor_direct.py +96 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_postgres_insert.py +120 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_remote_upload.py +143 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_schema_format.py +39 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_sql_executor.py +58 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_sql_executor_extra_fields.py +61 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_sql_executor_fix.py +40 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_updated_server.py +50 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_upload_functionality.py +156 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_upload_server.py +232 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_vision_output.py +75 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_vision_prompt.py +43 -0
- memra-0.2.13/memra/demos/etl_invoice_processing/test_vision_simple.py +60 -0
- {memra-0.2.12 → memra-0.2.13}/memra.egg-info/SOURCES.txt +53 -1
- {memra-0.2.12 → memra-0.2.13}/pyproject.toml +9 -2
- {memra-0.2.12 → memra-0.2.13}/setup.py +9 -1
- {memra-0.2.12 → memra-0.2.13}/CHANGELOG.md +0 -0
- {memra-0.2.12 → memra-0.2.13}/LICENSE +0 -0
- {memra-0.2.12 → memra-0.2.13}/MANIFEST.in +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/.DS_Store +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/README.md +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/.DS_Store +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352259401.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352259823.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352260169.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352260417.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352260599.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352260912.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352261134.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352261563.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352261647.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352261720.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352261811.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352262025.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352262454.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352262702.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352262884.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352263346.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/10352263429.PDF +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/data/invoices/invoice_005.pdf +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/database_monitor_agent.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/etl_invoice_demo.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/setup_demo_data.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/demos/etl_invoice_processing/simple_pdf_processor.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/mcp_bridge_server.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/__init__.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/discovery.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/discovery_client.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/execution.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/models.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/tool_registry.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra/tool_registry_client.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/app.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/config/config.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/config.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/logic/__init__.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/logic/file_tools.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/logic/invoice_tools.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/logic/invoice_tools_fix.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/mcp_bridge_server.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/check_database.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/clear_database.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/monitor_database.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/release.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/reset_database.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/start_memra.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/scripts/stop_memra.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/server_tool_registry.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tests/test_llm_text_to_sql.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tests/test_llm_vs_pattern.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tests/test_mcp_schema_aware.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tests/test_schema_aware_sql.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tests/test_schema_aware_sql_simple.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tests/test_text_to_sql_demo.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-ops/tools/mcp_bridge_server.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/accounts_payable.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/accounts_payable_client.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/accounts_payable_mcp.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/ask_questions.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/invoice_processing.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/propane_delivery.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/examples/simple_text_to_sql.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/__init__.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/discovery.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/discovery_client.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/execution.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/models.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/tool_registry.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/memra/tool_registry_client.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/scripts/release.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-sdk/setup.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/accounts_payable/accounts_payable.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/accounts_payable/accounts_payable_client.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/accounts_payable/accounts_payable_mcp.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/accounts_payable/accounts_payable_smart.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/invoice_processing/invoice_processing.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/invoice_processing/smart_invoice_processor.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/logic/__init__.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/logic/file_tools.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/logic/invoice_tools.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/logic/propane_agents.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/mcp_bridge_server.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/propane_delivery/propane_delivery.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/text_to_sql/complete_invoice_workflow_with_queries.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/text_to_sql/complete_text_to_sql_system.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/memra-workflows/text_to_sql/file_discovery_demo.py +0 -0
- {memra-0.2.12 → memra-0.2.13}/requirements.txt +0 -0
- {memra-0.2.12 → memra-0.2.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.1
|
2
2
|
Name: memra
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.13
|
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
|
@@ -32,10 +32,6 @@ Requires-Dist: black; extra == "dev"
|
|
32
32
|
Requires-Dist: flake8; extra == "dev"
|
33
33
|
Provides-Extra: mcp
|
34
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
35
|
|
40
36
|
# Memra SDK
|
41
37
|
|
@@ -56,24 +52,26 @@ Building AI-powered business workflows is hard. You need to:
|
|
56
52
|
|
57
53
|
**Memra solves these challenges** by providing a declarative framework that lets you focus on *what* you want to accomplish, not *how* to wire everything together.
|
58
54
|
|
59
|
-
## 🚀 Quick Start (
|
55
|
+
## 🚀 Quick Start (2 minutes!)
|
60
56
|
|
61
|
-
**Want to see Memra in action immediately?**
|
62
|
-
|
63
|
-
### Installation
|
57
|
+
**Want to see Memra in action immediately?**
|
64
58
|
|
65
59
|
```bash
|
60
|
+
# Install Memra
|
66
61
|
pip install memra
|
67
|
-
```
|
68
62
|
|
69
|
-
|
70
|
-
|
71
|
-
```bash
|
72
|
-
# Automated setup for new users
|
73
|
-
bash scripts/setup_newbie.sh
|
63
|
+
# Run the ETL demo
|
64
|
+
memra demo
|
74
65
|
```
|
75
66
|
|
76
|
-
|
67
|
+
**That's it!** The demo will automatically:
|
68
|
+
- ✅ Set up PostgreSQL database
|
69
|
+
- ✅ Start MCP bridge server
|
70
|
+
- ✅ Process PDF invoices with AI vision
|
71
|
+
- ✅ Store data in the database
|
72
|
+
- ✅ Show you the results
|
73
|
+
|
74
|
+
**📖 Need more details?** Check out our [Quick Start Guide](QUICK_START.md) for step-by-step instructions.
|
77
75
|
|
78
76
|
### Basic Example
|
79
77
|
|
@@ -139,7 +137,7 @@ Configuration for language models used by agents, supporting:
|
|
139
137
|
|
140
138
|
```bash
|
141
139
|
# Run the ETL demo
|
142
|
-
|
140
|
+
memra demo
|
143
141
|
```
|
144
142
|
|
145
143
|
This demo showcases:
|
@@ -241,43 +239,19 @@ Scale from prototype to production:
|
|
241
239
|
## 📚 Documentation
|
242
240
|
|
243
241
|
- **[Quick Start Guide](QUICK_START.md)** - Get up and running in 5 minutes
|
244
|
-
- **[
|
242
|
+
- **[Installation Guide](INSTALLATION_GUIDE.md)** - Detailed setup instructions
|
243
|
+
- **[Text-to-SQL Guide](TEXT_TO_SQL_USAGE_GUIDE.md)** - Build SQL queries with natural language
|
244
|
+
- **[Contributing](CONTRIBUTING.md)** - How to contribute to Memra
|
245
245
|
- **[System Architecture](memra_system_architecture.md)** - Deep dive into Memra's design
|
246
|
-
- **[Text-to-SQL Guide](TEXT_TO_SQL_USAGE_GUIDE.md)** - Building database query workflows
|
247
|
-
- **[Examples Directory](examples/)** - Complete working examples
|
248
|
-
- **[Demos Directory](demos/)** - Advanced workflow demonstrations
|
249
|
-
|
250
|
-
## 🏢 Use Cases
|
251
|
-
|
252
|
-
### Financial Services
|
253
|
-
- **Invoice processing** and accounts payable automation
|
254
|
-
- **Document classification** and routing
|
255
|
-
- **Compliance monitoring** and reporting
|
256
|
-
- **Risk assessment** and fraud detection
|
257
|
-
|
258
|
-
### Healthcare
|
259
|
-
- **Medical record processing** and data extraction
|
260
|
-
- **Claims processing** and validation
|
261
|
-
- **Patient data analysis** and insights
|
262
|
-
- **Regulatory compliance** workflows
|
263
|
-
|
264
|
-
### Manufacturing
|
265
|
-
- **Quality control** and inspection workflows
|
266
|
-
- **Supply chain** optimization and monitoring
|
267
|
-
- **Equipment maintenance** scheduling
|
268
|
-
- **Production planning** and optimization
|
269
|
-
|
270
|
-
### Retail & E-commerce
|
271
|
-
- **Order processing** and fulfillment
|
272
|
-
- **Customer service** automation
|
273
|
-
- **Inventory management** and forecasting
|
274
|
-
- **Market analysis** and trend detection
|
275
246
|
|
276
|
-
##
|
247
|
+
## 🔧 Development
|
277
248
|
|
278
|
-
|
249
|
+
### Prerequisites
|
250
|
+
- Python 3.8+
|
251
|
+
- Docker (for database and services)
|
252
|
+
- Git
|
279
253
|
|
280
|
-
### Development Setup
|
254
|
+
### Local Development Setup
|
281
255
|
|
282
256
|
```bash
|
283
257
|
# Clone the repository
|
@@ -287,33 +261,34 @@ cd memra-sdk
|
|
287
261
|
# Install in development mode
|
288
262
|
pip install -e .
|
289
263
|
|
290
|
-
# Run
|
291
|
-
|
264
|
+
# Run the demo
|
265
|
+
memra demo
|
266
|
+
```
|
267
|
+
|
268
|
+
### Running Tests
|
269
|
+
|
270
|
+
```bash
|
271
|
+
# Run all tests
|
272
|
+
python -m pytest tests/
|
273
|
+
|
274
|
+
# Run specific test file
|
275
|
+
python -m pytest tests/test_execution.py
|
292
276
|
```
|
293
277
|
|
294
278
|
## 📄 License
|
295
279
|
|
296
280
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
297
281
|
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
- ✅ **Distribution** - Distribute copies
|
302
|
-
- ✅ **Private use** - Use privately
|
303
|
-
- ❌ **Liability** - No warranty provided
|
304
|
-
- ❌ **Warranty** - No warranty provided
|
282
|
+
## 🤝 Contributing
|
283
|
+
|
284
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to submit pull requests, report issues, and contribute to the project.
|
305
285
|
|
306
|
-
##
|
286
|
+
## 📞 Support
|
307
287
|
|
288
|
+
- **Documentation**: Check our guides above
|
308
289
|
- **Issues**: [GitHub Issues](https://github.com/memra-platform/memra-sdk/issues)
|
309
290
|
- **Discussions**: [GitHub Discussions](https://github.com/memra-platform/memra-sdk/discussions)
|
310
|
-
- **Email**: hello@memra.com
|
311
|
-
|
312
|
-
## 🔗 Related Projects
|
313
|
-
|
314
|
-
- **[memra-workflows](https://github.com/memra-platform/memra-workflows)** - Production workflow templates
|
315
|
-
- **[memra-ops](https://github.com/memra-platform/memra-ops)** - Operations and deployment tools
|
316
291
|
|
317
292
|
---
|
318
293
|
|
319
|
-
**
|
294
|
+
**Ready to build AI workflows that scale?** Start with `pip install memra` and `memra demo`! 🚀
|
@@ -17,24 +17,26 @@ Building AI-powered business workflows is hard. You need to:
|
|
17
17
|
|
18
18
|
**Memra solves these challenges** by providing a declarative framework that lets you focus on *what* you want to accomplish, not *how* to wire everything together.
|
19
19
|
|
20
|
-
## 🚀 Quick Start (
|
20
|
+
## 🚀 Quick Start (2 minutes!)
|
21
21
|
|
22
|
-
**Want to see Memra in action immediately?**
|
23
|
-
|
24
|
-
### Installation
|
22
|
+
**Want to see Memra in action immediately?**
|
25
23
|
|
26
24
|
```bash
|
25
|
+
# Install Memra
|
27
26
|
pip install memra
|
28
|
-
```
|
29
27
|
|
30
|
-
|
31
|
-
|
32
|
-
```bash
|
33
|
-
# Automated setup for new users
|
34
|
-
bash scripts/setup_newbie.sh
|
28
|
+
# Run the ETL demo
|
29
|
+
memra demo
|
35
30
|
```
|
36
31
|
|
37
|
-
|
32
|
+
**That's it!** The demo will automatically:
|
33
|
+
- ✅ Set up PostgreSQL database
|
34
|
+
- ✅ Start MCP bridge server
|
35
|
+
- ✅ Process PDF invoices with AI vision
|
36
|
+
- ✅ Store data in the database
|
37
|
+
- ✅ Show you the results
|
38
|
+
|
39
|
+
**📖 Need more details?** Check out our [Quick Start Guide](QUICK_START.md) for step-by-step instructions.
|
38
40
|
|
39
41
|
### Basic Example
|
40
42
|
|
@@ -100,7 +102,7 @@ Configuration for language models used by agents, supporting:
|
|
100
102
|
|
101
103
|
```bash
|
102
104
|
# Run the ETL demo
|
103
|
-
|
105
|
+
memra demo
|
104
106
|
```
|
105
107
|
|
106
108
|
This demo showcases:
|
@@ -202,43 +204,19 @@ Scale from prototype to production:
|
|
202
204
|
## 📚 Documentation
|
203
205
|
|
204
206
|
- **[Quick Start Guide](QUICK_START.md)** - Get up and running in 5 minutes
|
205
|
-
- **[
|
207
|
+
- **[Installation Guide](INSTALLATION_GUIDE.md)** - Detailed setup instructions
|
208
|
+
- **[Text-to-SQL Guide](TEXT_TO_SQL_USAGE_GUIDE.md)** - Build SQL queries with natural language
|
209
|
+
- **[Contributing](CONTRIBUTING.md)** - How to contribute to Memra
|
206
210
|
- **[System Architecture](memra_system_architecture.md)** - Deep dive into Memra's design
|
207
|
-
- **[Text-to-SQL Guide](TEXT_TO_SQL_USAGE_GUIDE.md)** - Building database query workflows
|
208
|
-
- **[Examples Directory](examples/)** - Complete working examples
|
209
|
-
- **[Demos Directory](demos/)** - Advanced workflow demonstrations
|
210
|
-
|
211
|
-
## 🏢 Use Cases
|
212
|
-
|
213
|
-
### Financial Services
|
214
|
-
- **Invoice processing** and accounts payable automation
|
215
|
-
- **Document classification** and routing
|
216
|
-
- **Compliance monitoring** and reporting
|
217
|
-
- **Risk assessment** and fraud detection
|
218
|
-
|
219
|
-
### Healthcare
|
220
|
-
- **Medical record processing** and data extraction
|
221
|
-
- **Claims processing** and validation
|
222
|
-
- **Patient data analysis** and insights
|
223
|
-
- **Regulatory compliance** workflows
|
224
|
-
|
225
|
-
### Manufacturing
|
226
|
-
- **Quality control** and inspection workflows
|
227
|
-
- **Supply chain** optimization and monitoring
|
228
|
-
- **Equipment maintenance** scheduling
|
229
|
-
- **Production planning** and optimization
|
230
|
-
|
231
|
-
### Retail & E-commerce
|
232
|
-
- **Order processing** and fulfillment
|
233
|
-
- **Customer service** automation
|
234
|
-
- **Inventory management** and forecasting
|
235
|
-
- **Market analysis** and trend detection
|
236
211
|
|
237
|
-
##
|
212
|
+
## 🔧 Development
|
238
213
|
|
239
|
-
|
214
|
+
### Prerequisites
|
215
|
+
- Python 3.8+
|
216
|
+
- Docker (for database and services)
|
217
|
+
- Git
|
240
218
|
|
241
|
-
### Development Setup
|
219
|
+
### Local Development Setup
|
242
220
|
|
243
221
|
```bash
|
244
222
|
# Clone the repository
|
@@ -248,33 +226,34 @@ cd memra-sdk
|
|
248
226
|
# Install in development mode
|
249
227
|
pip install -e .
|
250
228
|
|
251
|
-
# Run
|
252
|
-
|
229
|
+
# Run the demo
|
230
|
+
memra demo
|
231
|
+
```
|
232
|
+
|
233
|
+
### Running Tests
|
234
|
+
|
235
|
+
```bash
|
236
|
+
# Run all tests
|
237
|
+
python -m pytest tests/
|
238
|
+
|
239
|
+
# Run specific test file
|
240
|
+
python -m pytest tests/test_execution.py
|
253
241
|
```
|
254
242
|
|
255
243
|
## 📄 License
|
256
244
|
|
257
245
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
258
246
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
- ✅ **Distribution** - Distribute copies
|
263
|
-
- ✅ **Private use** - Use privately
|
264
|
-
- ❌ **Liability** - No warranty provided
|
265
|
-
- ❌ **Warranty** - No warranty provided
|
247
|
+
## 🤝 Contributing
|
248
|
+
|
249
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to submit pull requests, report issues, and contribute to the project.
|
266
250
|
|
267
|
-
##
|
251
|
+
## 📞 Support
|
268
252
|
|
253
|
+
- **Documentation**: Check our guides above
|
269
254
|
- **Issues**: [GitHub Issues](https://github.com/memra-platform/memra-sdk/issues)
|
270
255
|
- **Discussions**: [GitHub Discussions](https://github.com/memra-platform/memra-sdk/discussions)
|
271
|
-
- **Email**: hello@memra.com
|
272
|
-
|
273
|
-
## 🔗 Related Projects
|
274
|
-
|
275
|
-
- **[memra-workflows](https://github.com/memra-platform/memra-workflows)** - Production workflow templates
|
276
|
-
- **[memra-ops](https://github.com/memra-platform/memra-ops)** - Operations and deployment tools
|
277
256
|
|
278
257
|
---
|
279
258
|
|
280
|
-
**
|
259
|
+
**Ready to build AI workflows that scale?** Start with `pip install memra` and `memra demo`! 🚀
|
@@ -79,15 +79,121 @@ def setup_demo_environment():
|
|
79
79
|
def extract_bundled_files(demo_dir):
|
80
80
|
"""Extract files bundled with the PyPI package"""
|
81
81
|
try:
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
import pkg_resources
|
83
|
+
import shutil
|
84
|
+
from pathlib import Path
|
85
|
+
|
86
|
+
# Extract demo files from package data
|
87
|
+
demo_dir.mkdir(exist_ok=True)
|
88
|
+
|
89
|
+
# Copy the main ETL demo script
|
90
|
+
try:
|
91
|
+
demo_script = pkg_resources.resource_filename('memra', 'demos/etl_invoice_processing/etl_invoice_demo.py')
|
92
|
+
if Path(demo_script).exists():
|
93
|
+
shutil.copy2(demo_script, demo_dir / "etl_invoice_demo.py")
|
94
|
+
print("✅ Copied ETL demo script")
|
95
|
+
else:
|
96
|
+
print("⚠️ ETL demo script not found in package")
|
97
|
+
except Exception as e:
|
98
|
+
print(f"⚠️ Could not copy ETL demo script: {e}")
|
99
|
+
|
100
|
+
# Copy supporting Python files
|
101
|
+
demo_files = [
|
102
|
+
"database_monitor_agent.py",
|
103
|
+
"simple_pdf_processor.py",
|
104
|
+
"setup_demo_data.py"
|
105
|
+
]
|
106
|
+
|
107
|
+
for file_name in demo_files:
|
108
|
+
try:
|
109
|
+
file_path = pkg_resources.resource_filename('memra', f'demos/etl_invoice_processing/{file_name}')
|
110
|
+
if Path(file_path).exists():
|
111
|
+
shutil.copy2(file_path, demo_dir / file_name)
|
112
|
+
print(f"✅ Copied {file_name}")
|
113
|
+
else:
|
114
|
+
print(f"⚠️ {file_name} not found in package")
|
115
|
+
except Exception as e:
|
116
|
+
print(f"⚠️ Could not copy {file_name}: {e}")
|
117
|
+
|
118
|
+
# Copy sample data directory
|
119
|
+
try:
|
120
|
+
data_source = pkg_resources.resource_filename('memra', 'demos/etl_invoice_processing/data')
|
121
|
+
if Path(data_source).exists():
|
122
|
+
data_dir = demo_dir / "data"
|
123
|
+
shutil.copytree(data_source, data_dir, dirs_exist_ok=True)
|
124
|
+
print("✅ Copied sample invoice data")
|
87
125
|
else:
|
88
|
-
|
89
|
-
|
90
|
-
|
126
|
+
print("⚠️ Sample data not found in package")
|
127
|
+
except Exception as e:
|
128
|
+
print(f"⚠️ Could not copy sample data: {e}")
|
129
|
+
|
130
|
+
# Create memra-ops directory with docker-compose
|
131
|
+
ops_dir = demo_dir / "memra-ops"
|
132
|
+
ops_dir.mkdir(exist_ok=True)
|
133
|
+
|
134
|
+
# Create basic docker-compose.yml
|
135
|
+
compose_content = """version: '3.8'
|
136
|
+
services:
|
137
|
+
postgres:
|
138
|
+
image: postgres:15
|
139
|
+
environment:
|
140
|
+
POSTGRES_DB: local_workflow
|
141
|
+
POSTGRES_USER: postgres
|
142
|
+
POSTGRES_PASSWORD: postgres
|
143
|
+
ports:
|
144
|
+
- "5432:5432"
|
145
|
+
volumes:
|
146
|
+
- postgres_data:/var/lib/postgresql/data
|
147
|
+
|
148
|
+
volumes:
|
149
|
+
postgres_data:
|
150
|
+
"""
|
151
|
+
|
152
|
+
with open(ops_dir / "docker-compose.yml", "w") as f:
|
153
|
+
f.write(compose_content)
|
154
|
+
|
155
|
+
# Create basic MCP bridge server
|
156
|
+
mcp_content = """#!/usr/bin/env python3
|
157
|
+
import asyncio
|
158
|
+
import aiohttp
|
159
|
+
from aiohttp import web
|
160
|
+
import json
|
161
|
+
|
162
|
+
async def health_handler(request):
|
163
|
+
return web.json_response({"status": "healthy"})
|
164
|
+
|
165
|
+
async def execute_tool_handler(request):
|
166
|
+
data = await request.json()
|
167
|
+
tool_name = data.get('tool_name', 'unknown')
|
168
|
+
|
169
|
+
# Mock responses for demo
|
170
|
+
if tool_name == 'SQLExecutor':
|
171
|
+
return web.json_response({
|
172
|
+
"success": True,
|
173
|
+
"results": [{"message": "Demo SQL executed"}]
|
174
|
+
})
|
175
|
+
elif tool_name == 'PostgresInsert':
|
176
|
+
return web.json_response({
|
177
|
+
"success": True,
|
178
|
+
"id": 1
|
179
|
+
})
|
180
|
+
else:
|
181
|
+
return web.json_response({
|
182
|
+
"success": True,
|
183
|
+
"message": f"Demo {tool_name} executed"
|
184
|
+
})
|
185
|
+
|
186
|
+
app = web.Application()
|
187
|
+
app.router.add_get('/health', health_handler)
|
188
|
+
app.router.add_post('/execute_tool', execute_tool_handler)
|
189
|
+
|
190
|
+
if __name__ == '__main__':
|
191
|
+
web.run_app(app, host='0.0.0.0', port=8081)
|
192
|
+
"""
|
193
|
+
|
194
|
+
with open(ops_dir / "mcp_bridge_server.py", "w") as f:
|
195
|
+
f.write(mcp_content)
|
196
|
+
|
91
197
|
except Exception as e:
|
92
198
|
print(f"⚠️ Could not extract bundled files: {e}")
|
93
199
|
print("Creating minimal demo structure...")
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
Check database after workflow
|
4
|
+
"""
|
5
|
+
|
6
|
+
import requests
|
7
|
+
import json
|
8
|
+
|
9
|
+
def check_database_after():
|
10
|
+
"""Show table contents after workflow"""
|
11
|
+
|
12
|
+
bridge_url = "http://localhost:8081"
|
13
|
+
bridge_secret = "test-secret-for-development"
|
14
|
+
|
15
|
+
headers = {
|
16
|
+
"Content-Type": "application/json",
|
17
|
+
"X-Bridge-Secret": bridge_secret
|
18
|
+
}
|
19
|
+
|
20
|
+
print("📊 Database contents AFTER workflow:")
|
21
|
+
payload = {
|
22
|
+
"tool_name": "SQLExecutor",
|
23
|
+
"input_data": {
|
24
|
+
"sql_query": "SELECT * FROM invoices ORDER BY id;"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
response = requests.post(f"{bridge_url}/execute_tool", json=payload, headers=headers)
|
29
|
+
if response.status_code == 200:
|
30
|
+
result = response.json()
|
31
|
+
if result.get("success"):
|
32
|
+
data = result["data"]
|
33
|
+
print(f"Query: {data['query']}")
|
34
|
+
print(f"Total Rows: {data['row_count']}")
|
35
|
+
print("\nAll records:")
|
36
|
+
for i, row in enumerate(data['results'], 1):
|
37
|
+
print(f"\n{i}. ID: {row['id']}")
|
38
|
+
print(f" Invoice Number: {row['invoice_number']}")
|
39
|
+
print(f" Vendor: {row['vendor_name']}")
|
40
|
+
print(f" Date: {row['invoice_date']}")
|
41
|
+
print(f" Amount: ${row['total_amount']}")
|
42
|
+
print(f" Status: {row['status']}")
|
43
|
+
print(f" Created: {row['created_at']}")
|
44
|
+
else:
|
45
|
+
print(f"Error: {result.get('error')}")
|
46
|
+
else:
|
47
|
+
print(f"HTTP Error: {response.status_code}")
|
48
|
+
|
49
|
+
if __name__ == "__main__":
|
50
|
+
check_database_after()
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import psycopg2
|
2
|
+
import json
|
3
|
+
|
4
|
+
try:
|
5
|
+
conn = psycopg2.connect(
|
6
|
+
host='localhost',
|
7
|
+
port=5432,
|
8
|
+
database='memra_invoice_db',
|
9
|
+
user='memra',
|
10
|
+
password='memra123'
|
11
|
+
)
|
12
|
+
|
13
|
+
cursor = conn.cursor()
|
14
|
+
|
15
|
+
# Get detailed records
|
16
|
+
cursor.execute('SELECT * FROM invoices ORDER BY created_at DESC LIMIT 5;')
|
17
|
+
rows = cursor.fetchall()
|
18
|
+
|
19
|
+
print('📄 Detailed Invoice Records:')
|
20
|
+
for row in rows:
|
21
|
+
print(f'\nID: {row[0]}')
|
22
|
+
print(f' Invoice Number: {row[1]}')
|
23
|
+
print(f' Vendor: {row[2]}')
|
24
|
+
print(f' Invoice Date: {row[3]}')
|
25
|
+
print(f' Due Date: {row[4]}')
|
26
|
+
print(f' Total Amount: ${row[5]}')
|
27
|
+
print(f' Tax Amount: ${row[6]}')
|
28
|
+
print(f' Status: {row[8]}')
|
29
|
+
print(f' Created: {row[9]}')
|
30
|
+
|
31
|
+
if row[7]: # line_items
|
32
|
+
try:
|
33
|
+
line_items = json.loads(row[7])
|
34
|
+
print(f' Line Items: {len(line_items)} items')
|
35
|
+
for i, item in enumerate(line_items[:2]): # Show first 2 items
|
36
|
+
print(f' {i+1}. {item.get("description", "N/A")} - Qty: {item.get("quantity", "N/A")} @ ${item.get("unit_price", "N/A")}')
|
37
|
+
except:
|
38
|
+
print(f' Line Items: {row[7]}')
|
39
|
+
|
40
|
+
cursor.close()
|
41
|
+
conn.close()
|
42
|
+
|
43
|
+
except Exception as e:
|
44
|
+
print(f'❌ Database connection failed: {e}')
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import psycopg2
|
2
|
+
from datetime import datetime
|
3
|
+
|
4
|
+
# Database connection
|
5
|
+
conn = psycopg2.connect(
|
6
|
+
host="localhost",
|
7
|
+
database="local_workflow",
|
8
|
+
user="postgres",
|
9
|
+
password="postgres",
|
10
|
+
port=5433
|
11
|
+
)
|
12
|
+
|
13
|
+
try:
|
14
|
+
with conn.cursor() as cur:
|
15
|
+
# Get the 10 most recent records
|
16
|
+
cur.execute("""
|
17
|
+
SELECT id, vendor_name, invoice_number, invoice_date, due_date,
|
18
|
+
total_amount, tax_amount, created_at
|
19
|
+
FROM invoices
|
20
|
+
ORDER BY id DESC
|
21
|
+
LIMIT 10
|
22
|
+
""")
|
23
|
+
|
24
|
+
records = cur.fetchall()
|
25
|
+
|
26
|
+
if records:
|
27
|
+
print("🔍 Most Recent Invoice Records:\n")
|
28
|
+
for record in records:
|
29
|
+
id, vendor, invoice_num, inv_date, due_date, total, tax, created = record
|
30
|
+
print(f"ID: {id} (Created: {created})")
|
31
|
+
print(f" Vendor: {vendor}")
|
32
|
+
print(f" Invoice #: {invoice_num}")
|
33
|
+
print(f" Invoice Date: {inv_date}")
|
34
|
+
print(f" Due Date: {due_date}")
|
35
|
+
print(f" Total: ${total:.2f}")
|
36
|
+
print(f" Tax: ${tax:.2f}")
|
37
|
+
print("-" * 40)
|
38
|
+
else:
|
39
|
+
print("No records found in database")
|
40
|
+
|
41
|
+
finally:
|
42
|
+
conn.close()
|