MPS Engine
The official engine implementation of Context Meta Pattern Strategy (MPS) architecture.
Context is an extension of the MPS architecture built on top of Markitdown, its whole purpose is to allow you to freely input any kind of file and the mps-engine automatically fit it into the MPS architecture.
MPS
from mps import Mps, MPSHierarchy
mps = MPS()
# uses default hierarchy, you can import it and see it at <mps.MPSLocatorDefaults>
# or
mps = Mps.from_location("path/to/project/mps")
# or
mps = Mps.from_location(MPSHierarchy(
base_dir = "mps",
meta_dir = "meta",
pattern_dir = "pattern",
context_dir = "context",
strategy_dir = "strategy"
))
Context
Example
from mps import context
# => Markdown file placed under mps/context/my_finances.md
c = context(name="my-finances") # Context object
Supported Formats
- xml
- html
- .mp4
- .mp3
Pattern
Example
from mps import pattern, inject
ta = pattern(name="teacher-assistant") # => Pattern object
# or if a variable exist in the pattern
p = inject(pattern("translate"), lang_code="en-US")
Strategy
Example
from mps import strategy
cot = strategy(name="CoT") # => Strategy object
Integration
Semantic Kernel
- Supplying kernel functions with more context
@context(name="my-details")
@kernel_function(name="greeter", description="Greets people")
def greet(name: str) -> str:
return f"Hello {name}"
- Personalizing agents
from semantic_kernel.agents import ChatCompletionAgent
from mps import pattern
p = pattern("student-tutor")
# or
p = pattern("www.mydrive.com/student-tutor.md")
# or
p = pattern("www.mydrive.com/student-tutor.md", nopersist=True) #* (not recommended)
# by default the engine thinks the url that you used for a pattern is useful so it persists
# this is due to the [reusability philosophy](<../../README.md#reusability-philosophy>)
# and the [insurance phiolosophy](<../../README.md#insurance-philosophy>)
# in the MPS architecture
student_tutor_agent = ChatCompletionAgent(
instructions=pattern("student-tutor"),
)
- Giving agents a personality
from semantic_kernel.agents import ChatCompletionAgent
from mps import strategy, strategizer, context, pattern
finance_agent = ChatCompletionAgent(
instructions=strategizer(
context=context("my-monthly-billings"),
pattern=pattern("finance-consultant"),
strategy=startegy("AoT"),
)
)
Interfaces (Miniatures & MPS)
Miniatures
from mps import get_minatures_homeland, set_minatures_homeland, Miniatures
get_minatures_homeland()
set_minatures_homeland("path/to/project/miniatures/")
# or
Miniatures.homeland = "path/to/project/miniatures/"
print(Miniatures.homeland)
MPS
from mps import get_mps_basedir, set_mps_basedir, Mps
get_mps_basedir()
set_mps_basedir("path/to/project/mps/")
Mps.basedir = "/path/to/project/mps"
print(Mps.basedir)
Roadmap
The following features are planned for future releases:
- Complete core functionality - Finish any
NotImplementedErroror@futuredecorated functions - Documentation sprint - Focus on comprehensive documentation (also including CHANGELOG.md and breaking changes)
- Test coverage - Aim for 80%+ test coverage on core functionality
- Community preparation - Code of conduct, contribution guidelines
- CI/CD setup - GitHub Actions for testing, linting, and deployment to PyPI
Nice to have
- AsyncIO Support: Full async API for all MPS operations
- Cache Support: Cache frequently requested miniatures via HTTP
- Compilation Support: Compile the mps/ directory into a python script to reduce io overhead, and a potentially use for direct imports.
- MPS Interface: A friendly UI to show/filter/add/modify miniatures in your local mps collection.
- MPS Shop: A remote website where you can pull miniatures made by community to your local mps collection.
- MCP Integration: Have your local mps collection converted as MCP prompts.
Metadata
Release files for mps-engine 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mps_engine-0.0.3.tar.gz | 5.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mps_engine-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 MB
Release files / mps_engine-0.0.3.tar.gz
| Download URL | mps_engine-0.0.3.tar.gz |
|---|---|
| Size | 5.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5f3eda822667b4b9ca8e91e2d34addc38a20e6963db4ce02aad2869d1223cd4
|
|
BLAKE2b-256 checksum How to use checksums |
8903680d191de91f8ac7e69fe3a6c605c37858f3268c855e901c521c60bfde1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.18
|
Release files / mps_engine-0.0.3-py3-none-any.whl
| Download URL | mps_engine-0.0.3-py3-none-any.whl |
|---|---|
| Size | 233.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af0650c9524ac16bd5bc85bc35dbe2dbb565c9c3253b27ad0c9f5828cc4b13c8
|
|
BLAKE2b-256 checksum How to use checksums |
8568c76c6c305abb5f68e8b038564b4a94de69cedd81f70746d1cac72c356fbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.18
|