memra 0.1.2__tar.gz → 0.2.1__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.
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Memra SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2024-01-17
9
+
10
+ ### Added
11
+ - **MCP (Model Context Protocol) Integration**: Execute operations on local infrastructure while leveraging cloud AI processing
12
+ - New `mcp_bridge_server.py` for local resource bridging
13
+ - HMAC authentication for secure cloud-to-local communication
14
+ - Support for `hosted_by: "mcp"` in agent tool configurations
15
+ - PostgreSQL integration via MCP bridge
16
+ - Tool-level configuration support in execution engine
17
+ - New MCP tools: `PostgresInsert`, `DataValidator`
18
+
19
+ ### Enhanced
20
+ - **Execution Engine**: Updated to support tool-level configuration and MCP routing
21
+ - **Tool Registry Client**: Enhanced API client with better error handling and MCP support
22
+ - **Agent Configuration**: Added support for tool-specific configuration alongside agent-level config
23
+
24
+ ### Examples
25
+ - `examples/accounts_payable_mcp.py` - Complete invoice processing with MCP database integration
26
+ - `test_mcp_success.py` - Simple MCP integration test
27
+
28
+ ### Documentation
29
+ - `docs/mcp_integration.md` - Comprehensive MCP integration guide
30
+ - Updated README with MCP overview and quick start
31
+
32
+ ### Dependencies
33
+ - Added `aiohttp>=3.8.0` for MCP bridge server
34
+ - Added `aiohttp-cors>=0.7.0` for CORS support
35
+ - Added `psycopg2-binary>=2.9.0` for PostgreSQL integration
36
+
37
+ ## [0.1.0] - 2024-01-01
38
+
39
+ ### Added
40
+ - Initial release of Memra SDK
41
+ - Core agent and department framework
42
+ - API client for Memra cloud services
43
+ - Basic tool registry and execution engine
44
+ - Examples for accounts payable and propane delivery workflows
@@ -0,0 +1,29 @@
1
+ # Include only the client SDK files
2
+ include README.md
3
+ include LICENSE
4
+ include CHANGELOG.md
5
+ recursive-include memra *.py
6
+
7
+ # Explicitly exclude server-only files and directories
8
+ exclude app.py
9
+ exclude server_tool_registry.py
10
+ exclude mcp_bridge_server.py
11
+ exclude config.py
12
+ exclude fly.toml
13
+ exclude Dockerfile
14
+ exclude Procfile
15
+ exclude docker-compose.yml
16
+ exclude requirements.txt
17
+ recursive-exclude logic *
18
+ recursive-exclude scripts *
19
+ recursive-exclude docs *
20
+ recursive-exclude examples *
21
+ recursive-exclude tests *
22
+ recursive-exclude temp_processing *
23
+ recursive-exclude invoices *
24
+ recursive-exclude local *
25
+ recursive-exclude dist *
26
+ recursive-exclude __pycache__ *
27
+ recursive-exclude *.egg-info *
28
+ exclude .DS_Store
29
+ exclude .dockerignore
memra-0.2.1/PKG-INFO ADDED
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.1
2
+ Name: memra
3
+ Version: 0.2.1
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
+
36
+ # Memra SDK
37
+
38
+ A declarative orchestration framework for AI-powered business workflows. Think of it as "Kubernetes for business logic" where agents are the pods and departments are the deployments.
39
+
40
+ ## 🚀 Team Setup
41
+
42
+ **New team member?** See the complete setup guide: **[TEAM_SETUP.md](TEAM_SETUP.md)**
43
+
44
+ This includes:
45
+ - Database setup (PostgreSQL + Docker)
46
+ - Local development environment
47
+ - Testing instructions
48
+ - Troubleshooting guide
49
+
50
+ ## Quick Start
51
+
52
+ ```python
53
+ from memra.sdk.models import Agent, Department, Tool
54
+
55
+ # Define your agents
56
+ data_extractor = Agent(
57
+ role="Data Extraction Specialist",
58
+ job="Extract and validate data",
59
+ tools=[Tool(name="DataExtractor", hosted_by="memra")],
60
+ input_keys=["input_data"],
61
+ output_key="extracted_data"
62
+ )
63
+
64
+ # Create a department
65
+ dept = Department(
66
+ name="Data Processing",
67
+ mission="Process and validate data",
68
+ agents=[data_extractor]
69
+ )
70
+
71
+ # Run the workflow
72
+ result = dept.run({"input_data": {...}})
73
+ ```
74
+
75
+ ## Installation
76
+
77
+ ```bash
78
+ pip install memra
79
+ ```
80
+
81
+ ## API Access
82
+
83
+ Memra requires an API key to execute workflows on the hosted infrastructure.
84
+
85
+ ### Get Your API Key
86
+ Contact [info@memra.co](mailto:info@memra.co) for API access.
87
+
88
+ ### Set Your API Key
89
+ ```bash
90
+ # Set environment variable
91
+ export MEMRA_API_KEY="your-api-key-here"
92
+
93
+ # Or add to your shell profile for persistence
94
+ echo 'export MEMRA_API_KEY="your-api-key-here"' >> ~/.zshrc
95
+ ```
96
+
97
+ ### Test Your Setup
98
+ ```bash
99
+ python examples/accounts_payable_client.py
100
+ ```
101
+
102
+ ## Documentation
103
+
104
+ Documentation is coming soon. For now, see the examples below and in the `examples/` directory.
105
+
106
+ ## Example: Propane Delivery Workflow
107
+
108
+ See the `examples/propane_delivery.py` file for a complete example of how to use Memra to orchestrate a propane delivery workflow.
109
+
110
+ ## Contributing
111
+
112
+ We welcome contributions! Please see our [contributing guide](CONTRIBUTING.md) for details.
113
+
114
+ ## License
115
+
116
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
117
+
118
+ ## Examples
119
+
120
+ ```
121
+ ├── examples/
122
+ │ ├── accounts_payable_client.py # API-based example
123
+ │ ├── accounts_payable.py # Local example
124
+ │ ├── invoice_processing.py # Simple workflow
125
+ │ └── propane_delivery.py # Domain example
126
+ ├── memra/ # Core SDK
127
+ ├── logic/ # Tool implementations
128
+ ├── local/dependencies/ # Database setup & schemas
129
+ └── docker-compose.yml # Database setup
130
+ ```
memra-0.2.1/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Memra SDK
2
+
3
+ A declarative orchestration framework for AI-powered business workflows. Think of it as "Kubernetes for business logic" where agents are the pods and departments are the deployments.
4
+
5
+ ## 🚀 Team Setup
6
+
7
+ **New team member?** See the complete setup guide: **[TEAM_SETUP.md](TEAM_SETUP.md)**
8
+
9
+ This includes:
10
+ - Database setup (PostgreSQL + Docker)
11
+ - Local development environment
12
+ - Testing instructions
13
+ - Troubleshooting guide
14
+
15
+ ## Quick Start
16
+
17
+ ```python
18
+ from memra.sdk.models import Agent, Department, Tool
19
+
20
+ # Define your agents
21
+ data_extractor = Agent(
22
+ role="Data Extraction Specialist",
23
+ job="Extract and validate data",
24
+ tools=[Tool(name="DataExtractor", hosted_by="memra")],
25
+ input_keys=["input_data"],
26
+ output_key="extracted_data"
27
+ )
28
+
29
+ # Create a department
30
+ dept = Department(
31
+ name="Data Processing",
32
+ mission="Process and validate data",
33
+ agents=[data_extractor]
34
+ )
35
+
36
+ # Run the workflow
37
+ result = dept.run({"input_data": {...}})
38
+ ```
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ pip install memra
44
+ ```
45
+
46
+ ## API Access
47
+
48
+ Memra requires an API key to execute workflows on the hosted infrastructure.
49
+
50
+ ### Get Your API Key
51
+ Contact [info@memra.co](mailto:info@memra.co) for API access.
52
+
53
+ ### Set Your API Key
54
+ ```bash
55
+ # Set environment variable
56
+ export MEMRA_API_KEY="your-api-key-here"
57
+
58
+ # Or add to your shell profile for persistence
59
+ echo 'export MEMRA_API_KEY="your-api-key-here"' >> ~/.zshrc
60
+ ```
61
+
62
+ ### Test Your Setup
63
+ ```bash
64
+ python examples/accounts_payable_client.py
65
+ ```
66
+
67
+ ## Documentation
68
+
69
+ Documentation is coming soon. For now, see the examples below and in the `examples/` directory.
70
+
71
+ ## Example: Propane Delivery Workflow
72
+
73
+ See the `examples/propane_delivery.py` file for a complete example of how to use Memra to orchestrate a propane delivery workflow.
74
+
75
+ ## Contributing
76
+
77
+ We welcome contributions! Please see our [contributing guide](CONTRIBUTING.md) for details.
78
+
79
+ ## License
80
+
81
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
82
+
83
+ ## Examples
84
+
85
+ ```
86
+ ├── examples/
87
+ │ ├── accounts_payable_client.py # API-based example
88
+ │ ├── accounts_payable.py # Local example
89
+ │ ├── invoice_processing.py # Simple workflow
90
+ │ └── propane_delivery.py # Domain example
91
+ ├── memra/ # Core SDK
92
+ ├── logic/ # Tool implementations
93
+ ├── local/dependencies/ # Database setup & schemas
94
+ └── docker-compose.yml # Database setup
95
+ ```
@@ -0,0 +1,27 @@
1
+ """
2
+ Memra SDK - Declarative AI Workflows
3
+
4
+ A framework for building AI-powered business workflows using a declarative approach.
5
+ Think of it as "Kubernetes for business logic" where agents are the pods and
6
+ departments are the deployments.
7
+ """
8
+
9
+ __version__ = "0.2.1"
10
+
11
+ # Core imports
12
+ from .models import Agent, Department, Tool
13
+ from .execution import ExecutionEngine
14
+
15
+ # Make key classes available at package level
16
+ __all__ = [
17
+ "Agent",
18
+ "Department",
19
+ "Tool",
20
+ "ExecutionEngine",
21
+ "__version__"
22
+ ]
23
+
24
+ # Optional: Add version check for compatibility
25
+ import sys
26
+ if sys.version_info < (3, 8):
27
+ raise RuntimeError("Memra requires Python 3.8 or higher")
@@ -0,0 +1,15 @@
1
+ from typing import List, Dict, Any, Optional
2
+ from .tool_registry import ToolRegistry
3
+
4
+ def discover_tools(hosted_by: Optional[str] = None) -> List[Dict[str, Any]]:
5
+ """
6
+ Discover available tools in the Memra platform.
7
+
8
+ Args:
9
+ hosted_by: Filter tools by host ("memra" or "mcp"). If None, returns all tools.
10
+
11
+ Returns:
12
+ List of available tools with their metadata
13
+ """
14
+ registry = ToolRegistry()
15
+ return registry.discover_tools(hosted_by)
@@ -2,7 +2,7 @@ import time
2
2
  import logging
3
3
  from typing import Dict, Any, List, Optional
4
4
  from .models import Department, Agent, DepartmentResult, ExecutionTrace, DepartmentAudit
5
- from .tool_registry_client import ToolRegistryClient
5
+ from .tool_registry import ToolRegistry
6
6
 
7
7
  logger = logging.getLogger(__name__)
8
8
 
@@ -10,7 +10,7 @@ class ExecutionEngine:
10
10
  """Engine that executes department workflows by coordinating agents and tools"""
11
11
 
12
12
  def __init__(self):
13
- self.tool_registry = ToolRegistryClient()
13
+ self.tool_registry = ToolRegistry()
14
14
  self.last_execution_audit: Optional[DepartmentAudit] = None
15
15
 
16
16
  def execute_department(self, department: Department, input_data: Dict[str, Any]) -> DepartmentResult:
@@ -0,0 +1,70 @@
1
+ import importlib
2
+ import logging
3
+ import sys
4
+ import os
5
+ from typing import Dict, Any, List, Optional, Callable
6
+ from pathlib import Path
7
+
8
+ logger = logging.getLogger(__name__)
9
+
10
+ class ToolRegistry:
11
+ """Registry for managing and executing tools via API calls only"""
12
+
13
+ def __init__(self):
14
+ self.tools: Dict[str, Dict[str, Any]] = {}
15
+ self._register_known_tools()
16
+
17
+ def _register_known_tools(self):
18
+ """Register known tools with their metadata (no actual implementations)"""
19
+ # Server-hosted tools (executed via Memra API)
20
+ server_tools = [
21
+ ("DatabaseQueryTool", "Query database schemas and data"),
22
+ ("PDFProcessor", "Process PDF files and extract content"),
23
+ ("OCRTool", "Perform OCR on images and documents"),
24
+ ("InvoiceExtractionWorkflow", "Extract structured data from invoices"),
25
+ ("FileReader", "Read files from the filesystem"),
26
+ ]
27
+
28
+ for tool_name, description in server_tools:
29
+ self.register_tool(tool_name, None, "memra", description)
30
+
31
+ # MCP-hosted tools (executed via MCP bridge)
32
+ mcp_tools = [
33
+ ("DataValidator", "Validate data against schemas"),
34
+ ("PostgresInsert", "Insert data into PostgreSQL database"),
35
+ ]
36
+
37
+ for tool_name, description in mcp_tools:
38
+ self.register_tool(tool_name, None, "mcp", description)
39
+
40
+ logger.info(f"Registered {len(self.tools)} tool definitions")
41
+
42
+ def register_tool(self, name: str, tool_class: Optional[type], hosted_by: str, description: str):
43
+ """Register a tool in the registry (metadata only)"""
44
+ self.tools[name] = {
45
+ "class": tool_class, # Will be None for API-based tools
46
+ "hosted_by": hosted_by,
47
+ "description": description
48
+ }
49
+ logger.debug(f"Registered tool: {name} (hosted by {hosted_by})")
50
+
51
+ def discover_tools(self, hosted_by: Optional[str] = None) -> List[Dict[str, Any]]:
52
+ """Discover available tools, optionally filtered by host"""
53
+ tools = []
54
+ for name, info in self.tools.items():
55
+ if hosted_by is None or info["hosted_by"] == hosted_by:
56
+ tools.append({
57
+ "name": name,
58
+ "hosted_by": info["hosted_by"],
59
+ "description": info["description"]
60
+ })
61
+ return tools
62
+
63
+ def execute_tool(self, tool_name: str, hosted_by: str, input_data: Dict[str, Any],
64
+ config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
65
+ """Execute a tool - this should not be called directly in API-based mode"""
66
+ logger.warning(f"Direct tool execution attempted for {tool_name}. Use API client instead.")
67
+ return {
68
+ "success": False,
69
+ "error": "Direct tool execution not supported. Use API client for tool execution."
70
+ }
@@ -12,12 +12,13 @@ class ToolRegistryClient:
12
12
  def __init__(self):
13
13
  self.api_base = os.getenv("MEMRA_API_URL", "https://api.memra.co")
14
14
  self.api_key = os.getenv("MEMRA_API_KEY")
15
+ self.tools_cache = None
16
+
15
17
  if not self.api_key:
16
18
  raise ValueError(
17
19
  "MEMRA_API_KEY environment variable is required. "
18
- "Contact info@memra.co to request access."
20
+ "Please contact info@memra.co for an API key."
19
21
  )
20
- self.tools_cache = None
21
22
 
22
23
  def discover_tools(self, hosted_by: Optional[str] = None) -> List[Dict[str, Any]]:
23
24
  """Discover available tools from the API"""
@@ -0,0 +1,13 @@
1
+ CHANGELOG.md
2
+ LICENSE
3
+ MANIFEST.in
4
+ README.md
5
+ pyproject.toml
6
+ setup.py
7
+ memra/__init__.py
8
+ memra/discovery.py
9
+ memra/discovery_client.py
10
+ memra/execution.py
11
+ memra/models.py
12
+ memra/tool_registry.py
13
+ memra/tool_registry_client.py
@@ -1,40 +1,54 @@
1
1
  [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
2
+ requires = ["setuptools>=64.0", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "memra"
7
- version = "0.1.2"
8
- description = "A declarative orchestration framework for AI-powered business workflows"
7
+ version = "0.2.1"
8
+ description = "Declarative framework for enterprise workflows with MCP integration - Client SDK"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
11
11
  authors = [
12
- {name = "Memra Team", email = "info@memra.co"}
12
+ {name = "Memra", email = "support@memra.com"}
13
13
  ]
14
14
  classifiers = [
15
15
  "Development Status :: 3 - Alpha",
16
16
  "Intended Audience :: Developers",
17
17
  "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
18
19
  "Programming Language :: Python :: 3",
19
20
  "Programming Language :: Python :: 3.8",
20
21
  "Programming Language :: Python :: 3.9",
21
22
  "Programming Language :: Python :: 3.10",
22
23
  "Programming Language :: Python :: 3.11",
23
- "Programming Language :: Python :: 3.12",
24
24
  ]
25
25
  requires-python = ">=3.8"
26
26
  dependencies = [
27
- "pydantic>=2.0.0",
27
+ "pydantic>=1.8.0",
28
28
  "httpx>=0.24.0",
29
- "typing-extensions>=4.0.0"
29
+ "typing-extensions>=4.0.0",
30
+ "aiohttp>=3.8.0",
31
+ "aiohttp-cors>=0.7.0",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ dev = [
36
+ "pytest>=6.0",
37
+ "pytest-asyncio",
38
+ "black",
39
+ "flake8",
40
+ ]
41
+ mcp = [
42
+ "psycopg2-binary>=2.9.0",
30
43
  ]
31
44
 
32
45
  [project.urls]
33
46
  Homepage = "https://memra.co"
34
47
  Repository = "https://github.com/memra-platform/memra-sdk"
35
- Documentation = "https://memra.co"
36
- "Bug Reports" = "https://github.com/memra-platform/memra-sdk/issues"
48
+
49
+ [project.scripts]
50
+ memra = "memra.cli:main"
37
51
 
38
52
  [tool.setuptools.packages.find]
39
- where = ["."]
40
53
  include = ["memra*"]
54
+ exclude = ["logic*", "server*", "app*", "mcp_bridge*"]
memra-0.2.1/setup.py ADDED
@@ -0,0 +1,52 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name="memra",
8
+ version="0.2.1",
9
+ author="Memra",
10
+ author_email="support@memra.com",
11
+ description="Declarative framework for enterprise workflows with MCP integration - Client SDK",
12
+ long_description=long_description,
13
+ long_description_content_type="text/markdown",
14
+ url="https://github.com/memra/memra-sdk",
15
+ packages=find_packages(include=['memra', 'memra.*']),
16
+ classifiers=[
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.8",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ ],
27
+ python_requires=">=3.8",
28
+ install_requires=[
29
+ "pydantic>=1.8.0",
30
+ "httpx>=0.24.0",
31
+ "typing-extensions>=4.0.0",
32
+ "aiohttp>=3.8.0",
33
+ "aiohttp-cors>=0.7.0",
34
+ ],
35
+ extras_require={
36
+ "dev": [
37
+ "pytest>=6.0",
38
+ "pytest-asyncio",
39
+ "black",
40
+ "flake8",
41
+ ],
42
+ "mcp": [
43
+ "psycopg2-binary>=2.9.0",
44
+ ],
45
+ },
46
+ entry_points={
47
+ "console_scripts": [
48
+ "memra=memra.cli:main",
49
+ ],
50
+ },
51
+ )
52
+
memra-0.1.2/PKG-INFO DELETED
@@ -1,191 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: memra
3
- Version: 0.1.2
4
- Summary: A declarative orchestration framework for AI-powered business workflows
5
- Author-email: Memra Team <info@memra.co>
6
- License: MIT
7
- Project-URL: Homepage, https://memra.co
8
- Project-URL: Repository, https://github.com/memra-platform/memra-sdk
9
- Project-URL: Documentation, https://memra.co
10
- Project-URL: Bug Reports, https://github.com/memra-platform/memra-sdk/issues
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Requires-Python: >=3.8
21
- Description-Content-Type: text/markdown
22
- License-File: LICENSE
23
- Requires-Dist: pydantic>=2.0.0
24
- Requires-Dist: httpx>=0.24.0
25
- Requires-Dist: typing-extensions>=4.0.0
26
- Dynamic: license-file
27
-
28
- # Memra SDK
29
-
30
- A declarative orchestration framework for AI-powered business workflows. Think of it as "Kubernetes for business logic" where agents are the pods and departments are the deployments.
31
-
32
- ## 🚀 Quick Start
33
-
34
- ```python
35
- from memra import Agent, Department, LLM
36
- from memra.execution import ExecutionEngine
37
-
38
- # Define your agents declaratively
39
- data_engineer = Agent(
40
- role="Data Engineer",
41
- job="Extract invoice schema from database",
42
- llm=LLM(model="llama-3.2-11b-vision-preview", temperature=0.1),
43
- tools=[
44
- {"name": "DatabaseQueryTool", "hosted_by": "memra"}
45
- ],
46
- output_key="invoice_schema"
47
- )
48
-
49
- invoice_parser = Agent(
50
- role="Invoice Parser",
51
- job="Extract structured data from invoice PDF",
52
- llm=LLM(model="llama-3.2-11b-vision-preview", temperature=0.0),
53
- tools=[
54
- {"name": "PDFProcessor", "hosted_by": "memra"},
55
- {"name": "InvoiceExtractionWorkflow", "hosted_by": "memra"}
56
- ],
57
- input_keys=["file", "invoice_schema"],
58
- output_key="invoice_data"
59
- )
60
-
61
- # Create a department
62
- ap_department = Department(
63
- name="Accounts Payable",
64
- mission="Process invoices accurately into financial system",
65
- agents=[data_engineer, invoice_parser],
66
- workflow_order=["Data Engineer", "Invoice Parser"]
67
- )
68
-
69
- # Execute the workflow
70
- engine = ExecutionEngine()
71
- result = engine.execute_department(ap_department, {
72
- "file": "invoice.pdf",
73
- "connection": "postgresql://user@host/db"
74
- })
75
-
76
- if result.success:
77
- print("✅ Invoice processed successfully!")
78
- print(f"Data: {result.data}")
79
- ```
80
-
81
- ## 📦 Installation
82
-
83
- ```bash
84
- pip install memra-sdk
85
- ```
86
-
87
- ## 🔑 Configuration
88
-
89
- ### Step 1: Get Your API Key
90
- Contact **info@memra.co** to request an API key for early access.
91
-
92
- ### Step 2: Set Your API Key
93
- Once you receive your API key, configure it:
94
-
95
- ```bash
96
- export MEMRA_API_KEY="your-api-key-here"
97
- export MEMRA_API_URL="https://api.memra.co" # Optional, defaults to production
98
- ```
99
-
100
- Or in Python:
101
-
102
- ```python
103
- import os
104
- os.environ["MEMRA_API_KEY"] = "your-api-key-here"
105
- ```
106
-
107
- ## 🎯 Key Features
108
-
109
- - **Declarative**: Define workflows like Kubernetes YAML
110
- - **AI-Powered**: Built-in LLM integrations for document processing
111
- - **Conversational**: Agents explain what they're doing in real-time
112
- - **Production Ready**: Real database connectivity and file processing
113
- - **Scalable**: Tools execute on Memra's cloud infrastructure
114
-
115
- ## 🏗️ Core Concepts
116
-
117
- ### Agents
118
- Agents are the workers in your workflow. Each agent has:
119
- - **Role**: What they do (e.g., "Data Engineer")
120
- - **Job**: Their specific responsibility
121
- - **Tools**: What capabilities they use
122
- - **LLM**: Their AI model configuration
123
-
124
- ### Departments
125
- Departments coordinate multiple agents:
126
- - **Mission**: Overall goal
127
- - **Workflow Order**: Sequence of agent execution
128
- - **Manager**: Optional oversight and validation
129
-
130
- ### Tools
131
- Tools are hosted capabilities:
132
- - **memra**: Hosted by Memra (PDF processing, LLMs, databases)
133
- - **mcp**: Customer-hosted via Model Context Protocol
134
-
135
- ## 📊 Example Output
136
-
137
- ```
138
- 🏢 Starting Accounts Payable Department
139
- 📋 Mission: Process invoices accurately into financial system
140
- 👥 Team: Data Engineer, Invoice Parser
141
- 🔄 Workflow: Data Engineer → Invoice Parser
142
-
143
- 👤 Data Engineer: Hi! I'm starting my work now...
144
- 💭 Data Engineer: My job is to extract invoice schema from database
145
- ⚡ Data Engineer: Using tool 1/1: DatabaseQueryTool
146
- ✅ Data Engineer: Great! DatabaseQueryTool did real work and gave me useful results
147
- 🎉 Data Engineer: Perfect! I completed my work with real data processing
148
-
149
- 👤 Invoice Parser: Hi! I'm starting my work now...
150
- 💭 Invoice Parser: My job is to extract structured data from invoice pdf
151
- ⚡ Invoice Parser: Using tool 1/2: PDFProcessor
152
- ✅ Invoice Parser: Great! PDFProcessor did real work and gave me useful results
153
- ```
154
-
155
- ## 🔍 Tool Discovery
156
-
157
- Discover available tools:
158
-
159
- ```python
160
- from memra import discover_tools, get_api_status
161
-
162
- # Check API health
163
- status = get_api_status()
164
- print(f"API Health: {status['api_healthy']}")
165
- print(f"Tools Available: {status['tools_available']}")
166
-
167
- # Discover tools
168
- tools = discover_tools()
169
- for tool in tools:
170
- print(f"- {tool['name']}: {tool['description']}")
171
- ```
172
-
173
- ## 📚 Examples
174
-
175
- See the `examples/` directory for complete workflows:
176
-
177
- - `accounts_payable_client.py`: Invoice processing with database integration
178
- - More examples coming soon!
179
-
180
- ## 🆘 Support
181
-
182
- - **Support**: info@memra.co
183
-
184
- ## 📄 License
185
-
186
- MIT License - see LICENSE file for details.
187
-
188
- ---
189
-
190
- **Built with ❤️ by the Memra team**
191
- **Note**: The SDK will not work without a valid API key.
memra-0.1.2/README.md DELETED
@@ -1,164 +0,0 @@
1
- # Memra SDK
2
-
3
- A declarative orchestration framework for AI-powered business workflows. Think of it as "Kubernetes for business logic" where agents are the pods and departments are the deployments.
4
-
5
- ## 🚀 Quick Start
6
-
7
- ```python
8
- from memra import Agent, Department, LLM
9
- from memra.execution import ExecutionEngine
10
-
11
- # Define your agents declaratively
12
- data_engineer = Agent(
13
- role="Data Engineer",
14
- job="Extract invoice schema from database",
15
- llm=LLM(model="llama-3.2-11b-vision-preview", temperature=0.1),
16
- tools=[
17
- {"name": "DatabaseQueryTool", "hosted_by": "memra"}
18
- ],
19
- output_key="invoice_schema"
20
- )
21
-
22
- invoice_parser = Agent(
23
- role="Invoice Parser",
24
- job="Extract structured data from invoice PDF",
25
- llm=LLM(model="llama-3.2-11b-vision-preview", temperature=0.0),
26
- tools=[
27
- {"name": "PDFProcessor", "hosted_by": "memra"},
28
- {"name": "InvoiceExtractionWorkflow", "hosted_by": "memra"}
29
- ],
30
- input_keys=["file", "invoice_schema"],
31
- output_key="invoice_data"
32
- )
33
-
34
- # Create a department
35
- ap_department = Department(
36
- name="Accounts Payable",
37
- mission="Process invoices accurately into financial system",
38
- agents=[data_engineer, invoice_parser],
39
- workflow_order=["Data Engineer", "Invoice Parser"]
40
- )
41
-
42
- # Execute the workflow
43
- engine = ExecutionEngine()
44
- result = engine.execute_department(ap_department, {
45
- "file": "invoice.pdf",
46
- "connection": "postgresql://user@host/db"
47
- })
48
-
49
- if result.success:
50
- print("✅ Invoice processed successfully!")
51
- print(f"Data: {result.data}")
52
- ```
53
-
54
- ## 📦 Installation
55
-
56
- ```bash
57
- pip install memra-sdk
58
- ```
59
-
60
- ## 🔑 Configuration
61
-
62
- ### Step 1: Get Your API Key
63
- Contact **info@memra.co** to request an API key for early access.
64
-
65
- ### Step 2: Set Your API Key
66
- Once you receive your API key, configure it:
67
-
68
- ```bash
69
- export MEMRA_API_KEY="your-api-key-here"
70
- export MEMRA_API_URL="https://api.memra.co" # Optional, defaults to production
71
- ```
72
-
73
- Or in Python:
74
-
75
- ```python
76
- import os
77
- os.environ["MEMRA_API_KEY"] = "your-api-key-here"
78
- ```
79
-
80
- ## 🎯 Key Features
81
-
82
- - **Declarative**: Define workflows like Kubernetes YAML
83
- - **AI-Powered**: Built-in LLM integrations for document processing
84
- - **Conversational**: Agents explain what they're doing in real-time
85
- - **Production Ready**: Real database connectivity and file processing
86
- - **Scalable**: Tools execute on Memra's cloud infrastructure
87
-
88
- ## 🏗️ Core Concepts
89
-
90
- ### Agents
91
- Agents are the workers in your workflow. Each agent has:
92
- - **Role**: What they do (e.g., "Data Engineer")
93
- - **Job**: Their specific responsibility
94
- - **Tools**: What capabilities they use
95
- - **LLM**: Their AI model configuration
96
-
97
- ### Departments
98
- Departments coordinate multiple agents:
99
- - **Mission**: Overall goal
100
- - **Workflow Order**: Sequence of agent execution
101
- - **Manager**: Optional oversight and validation
102
-
103
- ### Tools
104
- Tools are hosted capabilities:
105
- - **memra**: Hosted by Memra (PDF processing, LLMs, databases)
106
- - **mcp**: Customer-hosted via Model Context Protocol
107
-
108
- ## 📊 Example Output
109
-
110
- ```
111
- 🏢 Starting Accounts Payable Department
112
- 📋 Mission: Process invoices accurately into financial system
113
- 👥 Team: Data Engineer, Invoice Parser
114
- 🔄 Workflow: Data Engineer → Invoice Parser
115
-
116
- 👤 Data Engineer: Hi! I'm starting my work now...
117
- 💭 Data Engineer: My job is to extract invoice schema from database
118
- ⚡ Data Engineer: Using tool 1/1: DatabaseQueryTool
119
- ✅ Data Engineer: Great! DatabaseQueryTool did real work and gave me useful results
120
- 🎉 Data Engineer: Perfect! I completed my work with real data processing
121
-
122
- 👤 Invoice Parser: Hi! I'm starting my work now...
123
- 💭 Invoice Parser: My job is to extract structured data from invoice pdf
124
- ⚡ Invoice Parser: Using tool 1/2: PDFProcessor
125
- ✅ Invoice Parser: Great! PDFProcessor did real work and gave me useful results
126
- ```
127
-
128
- ## 🔍 Tool Discovery
129
-
130
- Discover available tools:
131
-
132
- ```python
133
- from memra import discover_tools, get_api_status
134
-
135
- # Check API health
136
- status = get_api_status()
137
- print(f"API Health: {status['api_healthy']}")
138
- print(f"Tools Available: {status['tools_available']}")
139
-
140
- # Discover tools
141
- tools = discover_tools()
142
- for tool in tools:
143
- print(f"- {tool['name']}: {tool['description']}")
144
- ```
145
-
146
- ## 📚 Examples
147
-
148
- See the `examples/` directory for complete workflows:
149
-
150
- - `accounts_payable_client.py`: Invoice processing with database integration
151
- - More examples coming soon!
152
-
153
- ## 🆘 Support
154
-
155
- - **Support**: info@memra.co
156
-
157
- ## 📄 License
158
-
159
- MIT License - see LICENSE file for details.
160
-
161
- ---
162
-
163
- **Built with ❤️ by the Memra team**
164
- **Note**: The SDK will not work without a valid API key.
@@ -1,28 +0,0 @@
1
- """
2
- Memra SDK - A declarative orchestration framework for AI-powered business workflows
3
- """
4
-
5
- from .models import (
6
- Agent,
7
- Department,
8
- LLM,
9
- Tool,
10
- ExecutionPolicy,
11
- ExecutionTrace,
12
- DepartmentResult,
13
- DepartmentAudit
14
- )
15
- from .discovery_client import discover_tools, check_api_health, get_api_status
16
-
17
- __version__ = "0.1.2"
18
- __all__ = [
19
- "Agent",
20
- "Department",
21
- "LLM",
22
- "Tool",
23
- "ExecutionPolicy",
24
- "ExecutionTrace",
25
- "DepartmentResult",
26
- "DepartmentAudit",
27
- "discover_tools"
28
- ]
@@ -1,191 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: memra
3
- Version: 0.1.2
4
- Summary: A declarative orchestration framework for AI-powered business workflows
5
- Author-email: Memra Team <info@memra.co>
6
- License: MIT
7
- Project-URL: Homepage, https://memra.co
8
- Project-URL: Repository, https://github.com/memra-platform/memra-sdk
9
- Project-URL: Documentation, https://memra.co
10
- Project-URL: Bug Reports, https://github.com/memra-platform/memra-sdk/issues
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Requires-Python: >=3.8
21
- Description-Content-Type: text/markdown
22
- License-File: LICENSE
23
- Requires-Dist: pydantic>=2.0.0
24
- Requires-Dist: httpx>=0.24.0
25
- Requires-Dist: typing-extensions>=4.0.0
26
- Dynamic: license-file
27
-
28
- # Memra SDK
29
-
30
- A declarative orchestration framework for AI-powered business workflows. Think of it as "Kubernetes for business logic" where agents are the pods and departments are the deployments.
31
-
32
- ## 🚀 Quick Start
33
-
34
- ```python
35
- from memra import Agent, Department, LLM
36
- from memra.execution import ExecutionEngine
37
-
38
- # Define your agents declaratively
39
- data_engineer = Agent(
40
- role="Data Engineer",
41
- job="Extract invoice schema from database",
42
- llm=LLM(model="llama-3.2-11b-vision-preview", temperature=0.1),
43
- tools=[
44
- {"name": "DatabaseQueryTool", "hosted_by": "memra"}
45
- ],
46
- output_key="invoice_schema"
47
- )
48
-
49
- invoice_parser = Agent(
50
- role="Invoice Parser",
51
- job="Extract structured data from invoice PDF",
52
- llm=LLM(model="llama-3.2-11b-vision-preview", temperature=0.0),
53
- tools=[
54
- {"name": "PDFProcessor", "hosted_by": "memra"},
55
- {"name": "InvoiceExtractionWorkflow", "hosted_by": "memra"}
56
- ],
57
- input_keys=["file", "invoice_schema"],
58
- output_key="invoice_data"
59
- )
60
-
61
- # Create a department
62
- ap_department = Department(
63
- name="Accounts Payable",
64
- mission="Process invoices accurately into financial system",
65
- agents=[data_engineer, invoice_parser],
66
- workflow_order=["Data Engineer", "Invoice Parser"]
67
- )
68
-
69
- # Execute the workflow
70
- engine = ExecutionEngine()
71
- result = engine.execute_department(ap_department, {
72
- "file": "invoice.pdf",
73
- "connection": "postgresql://user@host/db"
74
- })
75
-
76
- if result.success:
77
- print("✅ Invoice processed successfully!")
78
- print(f"Data: {result.data}")
79
- ```
80
-
81
- ## 📦 Installation
82
-
83
- ```bash
84
- pip install memra-sdk
85
- ```
86
-
87
- ## 🔑 Configuration
88
-
89
- ### Step 1: Get Your API Key
90
- Contact **info@memra.co** to request an API key for early access.
91
-
92
- ### Step 2: Set Your API Key
93
- Once you receive your API key, configure it:
94
-
95
- ```bash
96
- export MEMRA_API_KEY="your-api-key-here"
97
- export MEMRA_API_URL="https://api.memra.co" # Optional, defaults to production
98
- ```
99
-
100
- Or in Python:
101
-
102
- ```python
103
- import os
104
- os.environ["MEMRA_API_KEY"] = "your-api-key-here"
105
- ```
106
-
107
- ## 🎯 Key Features
108
-
109
- - **Declarative**: Define workflows like Kubernetes YAML
110
- - **AI-Powered**: Built-in LLM integrations for document processing
111
- - **Conversational**: Agents explain what they're doing in real-time
112
- - **Production Ready**: Real database connectivity and file processing
113
- - **Scalable**: Tools execute on Memra's cloud infrastructure
114
-
115
- ## 🏗️ Core Concepts
116
-
117
- ### Agents
118
- Agents are the workers in your workflow. Each agent has:
119
- - **Role**: What they do (e.g., "Data Engineer")
120
- - **Job**: Their specific responsibility
121
- - **Tools**: What capabilities they use
122
- - **LLM**: Their AI model configuration
123
-
124
- ### Departments
125
- Departments coordinate multiple agents:
126
- - **Mission**: Overall goal
127
- - **Workflow Order**: Sequence of agent execution
128
- - **Manager**: Optional oversight and validation
129
-
130
- ### Tools
131
- Tools are hosted capabilities:
132
- - **memra**: Hosted by Memra (PDF processing, LLMs, databases)
133
- - **mcp**: Customer-hosted via Model Context Protocol
134
-
135
- ## 📊 Example Output
136
-
137
- ```
138
- 🏢 Starting Accounts Payable Department
139
- 📋 Mission: Process invoices accurately into financial system
140
- 👥 Team: Data Engineer, Invoice Parser
141
- 🔄 Workflow: Data Engineer → Invoice Parser
142
-
143
- 👤 Data Engineer: Hi! I'm starting my work now...
144
- 💭 Data Engineer: My job is to extract invoice schema from database
145
- ⚡ Data Engineer: Using tool 1/1: DatabaseQueryTool
146
- ✅ Data Engineer: Great! DatabaseQueryTool did real work and gave me useful results
147
- 🎉 Data Engineer: Perfect! I completed my work with real data processing
148
-
149
- 👤 Invoice Parser: Hi! I'm starting my work now...
150
- 💭 Invoice Parser: My job is to extract structured data from invoice pdf
151
- ⚡ Invoice Parser: Using tool 1/2: PDFProcessor
152
- ✅ Invoice Parser: Great! PDFProcessor did real work and gave me useful results
153
- ```
154
-
155
- ## 🔍 Tool Discovery
156
-
157
- Discover available tools:
158
-
159
- ```python
160
- from memra import discover_tools, get_api_status
161
-
162
- # Check API health
163
- status = get_api_status()
164
- print(f"API Health: {status['api_healthy']}")
165
- print(f"Tools Available: {status['tools_available']}")
166
-
167
- # Discover tools
168
- tools = discover_tools()
169
- for tool in tools:
170
- print(f"- {tool['name']}: {tool['description']}")
171
- ```
172
-
173
- ## 📚 Examples
174
-
175
- See the `examples/` directory for complete workflows:
176
-
177
- - `accounts_payable_client.py`: Invoice processing with database integration
178
- - More examples coming soon!
179
-
180
- ## 🆘 Support
181
-
182
- - **Support**: info@memra.co
183
-
184
- ## 📄 License
185
-
186
- MIT License - see LICENSE file for details.
187
-
188
- ---
189
-
190
- **Built with ❤️ by the Memra team**
191
- **Note**: The SDK will not work without a valid API key.
@@ -1,13 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- memra/__init__.py
5
- memra/discovery_client.py
6
- memra/execution.py
7
- memra/models.py
8
- memra/tool_registry_client.py
9
- memra.egg-info/PKG-INFO
10
- memra.egg-info/SOURCES.txt
11
- memra.egg-info/dependency_links.txt
12
- memra.egg-info/requires.txt
13
- memra.egg-info/top_level.txt
@@ -1,3 +0,0 @@
1
- pydantic>=2.0.0
2
- httpx>=0.24.0
3
- typing-extensions>=4.0.0
@@ -1 +0,0 @@
1
- memra
File without changes
File without changes
File without changes
File without changes