| Name | moa-sdk JSON | 
            
| Version | 
                  0.1.0
                   
                  JSON | 
            
 | download  | 
            
| home_page | None  | 
            
| Summary | Python SDK for MOA (Memory Of Agents) - Revolutionary dual-track AI memory infrastructure | 
            | upload_time | 2025-08-03 11:26:42 | 
            | maintainer | None | 
            
            | docs_url | None | 
            | author | None | 
            
            | requires_python | >=3.8 | 
            
            
            | license | MIT | 
            | keywords | 
                
                    agents
                
                     ai
                
                     memory
                
                     moa
                
                     sdk
                 | 
            | VCS | 
                
                     | 
                
            
            | bugtrack_url | 
                
                 | 
             
            
            | requirements | 
                
                  No requirements were recorded.
                
             | 
            
| Travis-CI | 
                
                   No Travis.
                
             | 
            | coveralls test coverage | 
                
                   No coveralls.
                
             | 
        
        
            
            # MOA Python SDK
A comprehensive Python SDK for the MOA (Memory Of Agents) API - Revolutionary dual-track AI memory infrastructure with zero information loss.
[](https://badge.fury.io/py/moa-sdk)
[](https://pypi.org/project/moa-sdk/)
[](https://opensource.org/licenses/MIT)
## Features
- π§  **Memory Operations**: Create, read, update, delete memories with rich metadata
- π **Hybrid Search**: Vector similarity, keyword matching, fuzzy search, temporal relevance
- πΈοΈ **Graph Search**: Advanced graph-based search with multiple algorithms
- π **Relationship Management**: AI-powered relationship generation and cleanup
- π **Multi-Environment**: Support for alpha, beta, and production environments
- π **Analytics**: Memory and relationship statistics
- β‘ **Async Support**: Full async/await support for high-performance applications
- π **Retry Logic**: Built-in retry mechanisms with exponential backoff
- π‘οΈ **Type Safety**: Complete type hints and Pydantic models
- π **Rich Documentation**: Comprehensive examples and API reference
## Installation
```bash
pip install moa-sdk
```
For development with all optional dependencies:
```bash
pip install moa-sdk[dev,docs]
```
## Quick Start
### Basic Usage
```python
from moa import MOAClient, Environment
# Initialize client
client = MOAClient(
    api_key="your-api-key",
    environment=Environment.BETA
)
# Create a memory
response = client.memory.create_memory({
    "content": "Important meeting notes from today",
    "tags": ["meeting", "important"],
    "metadata": {"source": "daily-standup", "attendees": 5}
})
print(f"Created memory: {response.memory_id}")
# Search memories
results = client.memory.search_memories(
    query="meeting notes",
    max_results=10,
    vector_weight=0.7,  # Emphasize semantic similarity
    keyword_weight=0.3
)
for result in results.results:
    print(f"Score: {result.score:.2f} - {result.memory.content[:100]}")
# Close the client
client.close()
```
### Environment-Specific Clients
```python
from moa import MOAClient
# Direct environment methods
alpha_client = MOAClient.for_alpha("your-alpha-key")
beta_client = MOAClient.for_beta("your-beta-key") 
prod_client = MOAClient.for_production("your-prod-key")
# Or using environment variables
# Set MOA_API_KEY, MOA_ENVIRONMENT, etc.
client = MOAClient.from_env()
```
### Async Usage
```python
import asyncio
from moa import MOAClient
async def main():
    async with MOAClient(api_key="your-api-key") as client:
        # Async memory operations
        response = await client.memory.acreate_memory({
            "content": "Async memory creation",
            "tags": ["async", "example"]
        })
        
        # Async search
        results = await client.memory.asearch_memories(
            query="async example",
            max_results=5
        )
        
        print(f"Found {len(results.results)} memories")
asyncio.run(main())
```
### Graph Search
```python
# Find shortest paths between memories
graph_results = client.graph.search_shortest_path(
    query="project updates",
    max_depth=3,
    min_relationship_strength=0.5
)
# Find semantic clusters
clusters = client.graph.search_similarity_cluster(
    query="machine learning concepts",
    max_depth=2,
    min_concept_relevance=0.6
)
# Temporal flow analysis
temporal_results = client.graph.search_temporal_flow(
    query="product development timeline",
    weight_by_recency=True
)
```
### Relationship Management
```python
# Generate relationships for all memories
response = client.relationships.generate_all_relationships(
    force_regenerate=False,
    batch_size=10
)
print(f"Generated {response.stats['created']} new relationships")
# Get relationship statistics
stats = client.relationships.get_relationship_stats()
print(f"Total relationships: {stats.total_relationships}")
print(f"Average strength: {stats.average_strength:.2f}")
# Clean up weak relationships
cleanup = client.relationships.cleanup_weak_relationships(
    min_strength=0.3
)
print(f"Removed {cleanup.removed_count} weak relationships")
```
## Configuration
### Environment Variables
Set these environment variables to configure the SDK:
```bash
export MOA_API_KEY="your-api-key"
export MOA_ENVIRONMENT="beta"  # alpha, beta, production
export MOA_API_VERSION="v1"
export MOA_TIMEOUT="30.0"
export MOA_MAX_RETRIES="3"
export MOA_RETRY_DELAY="1.0"
export MOA_DEBUG="false"
```
### Programmatic Configuration
```python
from moa import MOAClient, Environment
client = MOAClient(
    api_key="your-api-key",
    environment=Environment.PRODUCTION,
    api_version="v1",
    timeout=60.0,
    max_retries=5,
    retry_delay=2.0,
    debug=True
)
```
## API Reference
### Memory Operations
- `create_memory(request)` - Create a new memory
- `get_memory(memory_id)` - Retrieve a specific memory
- `update_memory(memory_id, request)` - Update an existing memory
- `delete_memory(memory_id)` - Delete a memory
- `search_memories(query, **params)` - Search memories with hybrid approach
- `get_analytics()` - Get memory analytics
### Graph Search Operations
- `graph_search(request)` - Perform advanced graph search
- `search_shortest_path(query, **params)` - Find shortest paths
- `search_similarity_cluster(query, **params)` - Find semantic clusters
- `search_concept_traversal(query, **params)` - Concept-based search
- `search_temporal_flow(query, **params)` - Temporal sequence search
- `search_causal_chain(query, **params)` - Causal relationship discovery
- `get_search_types()` - Get available search types
### Relationship Operations
- `generate_relationships(request)` - Generate relationships with AI
- `generate_all_relationships(**params)` - Generate for all memories
- `generate_relationships_for_memories(memory_ids, **params)` - Generate for specific memories
- `get_relationship_stats()` - Get relationship statistics
- `cleanup_relationships(min_strength)` - Clean up weak relationships
- `optimize_graph(**params)` - Full graph optimization
## Examples
Check out the [examples](examples/) directory for more comprehensive examples:
- [basic_usage.py](examples/basic_usage.py) - Basic memory operations
- [graph_search_example.py](examples/graph_search_example.py) - Graph search patterns
- [memory_management.py](examples/memory_management.py) - Advanced memory management
## Error Handling
The SDK provides specific exception types for different error scenarios:
```python
from moa import MOAClient
from moa.exceptions import (
    MOAAuthError,
    MOANotFoundError,
    MOARateLimitError,
    MOAValidationError,
    MOAConnectionError,
    MOATimeoutError
)
try:
    client = MOAClient(api_key="invalid-key")
    response = client.memory.create_memory({"content": "test"})
except MOAAuthError:
    print("Authentication failed - check your API key")
except MOAValidationError as e:
    print(f"Validation error: {e.message}")
    print(f"Details: {e.details}")
except MOARateLimitError as e:
    print(f"Rate limited - retry after {e.retry_after} seconds")
except Exception as e:
    print(f"Unexpected error: {e}")
```
## Development
### Setup Development Environment
```bash
git clone https://github.com/memof-ai/moa-sdk-python.git
cd moa-sdk-python
# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev,docs]"
# Install pre-commit hooks
pre-commit install
```
### Running Tests
```bash
# Run all tests
pytest
# Run with coverage
pytest --cov=moa --cov-report=html
# Run specific test file
pytest tests/test_memory.py -v
```
### Code Quality
```bash
# Format code
black moa/ tests/ examples/
# Lint code
ruff check moa/ tests/ examples/
# Type checking
mypy moa/
```
## Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
1. Fork the repository
2. Create a feature branch: `git checkout -b feature-name`
3. Make your changes and add tests
4. Ensure tests pass: `pytest`
5. Submit a pull request
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Support
- π§ Email: [hello@memof.ai](mailto:hello@memof.ai)
- π Website: [https://memof.ai](https://memof.ai)
- π Documentation: [https://docs.memof.ai](https://docs.memof.ai)
- π Issues: [GitHub Issues](https://github.com/memof-ai/moa-sdk-python/issues)
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for a list of changes and version history.
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": null,
    "name": "moa-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "agents, ai, memory, moa, sdk",
    "author": null,
    "author_email": "MOA Team <hello@memof.ai>",
    "download_url": "https://files.pythonhosted.org/packages/d7/41/0f42e6497ebbae1699f0f11f53fdf53a060890a8835953f0b925163c07ef/moa_sdk-0.1.0.tar.gz",
    "platform": null,
    "description": "# MOA Python SDK\n\nA comprehensive Python SDK for the MOA (Memory Of Agents) API - Revolutionary dual-track AI memory infrastructure with zero information loss.\n\n[](https://badge.fury.io/py/moa-sdk)\n[](https://pypi.org/project/moa-sdk/)\n[](https://opensource.org/licenses/MIT)\n\n## Features\n\n- \ud83e\udde0 **Memory Operations**: Create, read, update, delete memories with rich metadata\n- \ud83d\udd0d **Hybrid Search**: Vector similarity, keyword matching, fuzzy search, temporal relevance\n- \ud83d\udd78\ufe0f **Graph Search**: Advanced graph-based search with multiple algorithms\n- \ud83d\udd17 **Relationship Management**: AI-powered relationship generation and cleanup\n- \ud83c\udf0d **Multi-Environment**: Support for alpha, beta, and production environments\n- \ud83d\udcca **Analytics**: Memory and relationship statistics\n- \u26a1 **Async Support**: Full async/await support for high-performance applications\n- \ud83d\udd04 **Retry Logic**: Built-in retry mechanisms with exponential backoff\n- \ud83d\udee1\ufe0f **Type Safety**: Complete type hints and Pydantic models\n- \ud83d\udcdd **Rich Documentation**: Comprehensive examples and API reference\n\n## Installation\n\n```bash\npip install moa-sdk\n```\n\nFor development with all optional dependencies:\n\n```bash\npip install moa-sdk[dev,docs]\n```\n\n## Quick Start\n\n### Basic Usage\n\n```python\nfrom moa import MOAClient, Environment\n\n# Initialize client\nclient = MOAClient(\n    api_key=\"your-api-key\",\n    environment=Environment.BETA\n)\n\n# Create a memory\nresponse = client.memory.create_memory({\n    \"content\": \"Important meeting notes from today\",\n    \"tags\": [\"meeting\", \"important\"],\n    \"metadata\": {\"source\": \"daily-standup\", \"attendees\": 5}\n})\n\nprint(f\"Created memory: {response.memory_id}\")\n\n# Search memories\nresults = client.memory.search_memories(\n    query=\"meeting notes\",\n    max_results=10,\n    vector_weight=0.7,  # Emphasize semantic similarity\n    keyword_weight=0.3\n)\n\nfor result in results.results:\n    print(f\"Score: {result.score:.2f} - {result.memory.content[:100]}\")\n\n# Close the client\nclient.close()\n```\n\n### Environment-Specific Clients\n\n```python\nfrom moa import MOAClient\n\n# Direct environment methods\nalpha_client = MOAClient.for_alpha(\"your-alpha-key\")\nbeta_client = MOAClient.for_beta(\"your-beta-key\") \nprod_client = MOAClient.for_production(\"your-prod-key\")\n\n# Or using environment variables\n# Set MOA_API_KEY, MOA_ENVIRONMENT, etc.\nclient = MOAClient.from_env()\n```\n\n### Async Usage\n\n```python\nimport asyncio\nfrom moa import MOAClient\n\nasync def main():\n    async with MOAClient(api_key=\"your-api-key\") as client:\n        # Async memory operations\n        response = await client.memory.acreate_memory({\n            \"content\": \"Async memory creation\",\n            \"tags\": [\"async\", \"example\"]\n        })\n        \n        # Async search\n        results = await client.memory.asearch_memories(\n            query=\"async example\",\n            max_results=5\n        )\n        \n        print(f\"Found {len(results.results)} memories\")\n\nasyncio.run(main())\n```\n\n### Graph Search\n\n```python\n# Find shortest paths between memories\ngraph_results = client.graph.search_shortest_path(\n    query=\"project updates\",\n    max_depth=3,\n    min_relationship_strength=0.5\n)\n\n# Find semantic clusters\nclusters = client.graph.search_similarity_cluster(\n    query=\"machine learning concepts\",\n    max_depth=2,\n    min_concept_relevance=0.6\n)\n\n# Temporal flow analysis\ntemporal_results = client.graph.search_temporal_flow(\n    query=\"product development timeline\",\n    weight_by_recency=True\n)\n```\n\n### Relationship Management\n\n```python\n# Generate relationships for all memories\nresponse = client.relationships.generate_all_relationships(\n    force_regenerate=False,\n    batch_size=10\n)\n\nprint(f\"Generated {response.stats['created']} new relationships\")\n\n# Get relationship statistics\nstats = client.relationships.get_relationship_stats()\nprint(f\"Total relationships: {stats.total_relationships}\")\nprint(f\"Average strength: {stats.average_strength:.2f}\")\n\n# Clean up weak relationships\ncleanup = client.relationships.cleanup_weak_relationships(\n    min_strength=0.3\n)\nprint(f\"Removed {cleanup.removed_count} weak relationships\")\n```\n\n## Configuration\n\n### Environment Variables\n\nSet these environment variables to configure the SDK:\n\n```bash\nexport MOA_API_KEY=\"your-api-key\"\nexport MOA_ENVIRONMENT=\"beta\"  # alpha, beta, production\nexport MOA_API_VERSION=\"v1\"\nexport MOA_TIMEOUT=\"30.0\"\nexport MOA_MAX_RETRIES=\"3\"\nexport MOA_RETRY_DELAY=\"1.0\"\nexport MOA_DEBUG=\"false\"\n```\n\n### Programmatic Configuration\n\n```python\nfrom moa import MOAClient, Environment\n\nclient = MOAClient(\n    api_key=\"your-api-key\",\n    environment=Environment.PRODUCTION,\n    api_version=\"v1\",\n    timeout=60.0,\n    max_retries=5,\n    retry_delay=2.0,\n    debug=True\n)\n```\n\n## API Reference\n\n### Memory Operations\n\n- `create_memory(request)` - Create a new memory\n- `get_memory(memory_id)` - Retrieve a specific memory\n- `update_memory(memory_id, request)` - Update an existing memory\n- `delete_memory(memory_id)` - Delete a memory\n- `search_memories(query, **params)` - Search memories with hybrid approach\n- `get_analytics()` - Get memory analytics\n\n### Graph Search Operations\n\n- `graph_search(request)` - Perform advanced graph search\n- `search_shortest_path(query, **params)` - Find shortest paths\n- `search_similarity_cluster(query, **params)` - Find semantic clusters\n- `search_concept_traversal(query, **params)` - Concept-based search\n- `search_temporal_flow(query, **params)` - Temporal sequence search\n- `search_causal_chain(query, **params)` - Causal relationship discovery\n- `get_search_types()` - Get available search types\n\n### Relationship Operations\n\n- `generate_relationships(request)` - Generate relationships with AI\n- `generate_all_relationships(**params)` - Generate for all memories\n- `generate_relationships_for_memories(memory_ids, **params)` - Generate for specific memories\n- `get_relationship_stats()` - Get relationship statistics\n- `cleanup_relationships(min_strength)` - Clean up weak relationships\n- `optimize_graph(**params)` - Full graph optimization\n\n## Examples\n\nCheck out the [examples](examples/) directory for more comprehensive examples:\n\n- [basic_usage.py](examples/basic_usage.py) - Basic memory operations\n- [graph_search_example.py](examples/graph_search_example.py) - Graph search patterns\n- [memory_management.py](examples/memory_management.py) - Advanced memory management\n\n## Error Handling\n\nThe SDK provides specific exception types for different error scenarios:\n\n```python\nfrom moa import MOAClient\nfrom moa.exceptions import (\n    MOAAuthError,\n    MOANotFoundError,\n    MOARateLimitError,\n    MOAValidationError,\n    MOAConnectionError,\n    MOATimeoutError\n)\n\ntry:\n    client = MOAClient(api_key=\"invalid-key\")\n    response = client.memory.create_memory({\"content\": \"test\"})\nexcept MOAAuthError:\n    print(\"Authentication failed - check your API key\")\nexcept MOAValidationError as e:\n    print(f\"Validation error: {e.message}\")\n    print(f\"Details: {e.details}\")\nexcept MOARateLimitError as e:\n    print(f\"Rate limited - retry after {e.retry_after} seconds\")\nexcept Exception as e:\n    print(f\"Unexpected error: {e}\")\n```\n\n## Development\n\n### Setup Development Environment\n\n```bash\ngit clone https://github.com/memof-ai/moa-sdk-python.git\ncd moa-sdk-python\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install development dependencies\npip install -e \".[dev,docs]\"\n\n# Install pre-commit hooks\npre-commit install\n```\n\n### Running Tests\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=moa --cov-report=html\n\n# Run specific test file\npytest tests/test_memory.py -v\n```\n\n### Code Quality\n\n```bash\n# Format code\nblack moa/ tests/ examples/\n\n# Lint code\nruff check moa/ tests/ examples/\n\n# Type checking\nmypy moa/\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make your changes and add tests\n4. Ensure tests pass: `pytest`\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- \ud83d\udce7 Email: [hello@memof.ai](mailto:hello@memof.ai)\n- \ud83c\udf10 Website: [https://memof.ai](https://memof.ai)\n- \ud83d\udcd6 Documentation: [https://docs.memof.ai](https://docs.memof.ai)\n- \ud83d\udc1b Issues: [GitHub Issues](https://github.com/memof-ai/moa-sdk-python/issues)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a list of changes and version history.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for MOA (Memory Of Agents) - Revolutionary dual-track AI memory infrastructure",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/memof-ai/moa-sdk-python/issues",
        "Documentation": "https://docs.memof.ai",
        "Homepage": "https://memof.ai",
        "Repository": "https://github.com/memof-ai/moa-sdk-python"
    },
    "split_keywords": [
        "agents",
        " ai",
        " memory",
        " moa",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "635ad539e7c0e8d2a52f902cd074ae0e674dfb9430a8e09c134ca3bc1f823566",
                "md5": "e59c764269e3c1b2e5beba31be8babd0",
                "sha256": "8a5ba478028e87c270cb8c0a3361e7a85ba6136f63653e36b2d852ba5b744683"
            },
            "downloads": -1,
            "filename": "moa_sdk-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e59c764269e3c1b2e5beba31be8babd0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 21120,
            "upload_time": "2025-08-03T11:26:40",
            "upload_time_iso_8601": "2025-08-03T11:26:40.830916Z",
            "url": "https://files.pythonhosted.org/packages/63/5a/d539e7c0e8d2a52f902cd074ae0e674dfb9430a8e09c134ca3bc1f823566/moa_sdk-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d7410f42e6497ebbae1699f0f11f53fdf53a060890a8835953f0b925163c07ef",
                "md5": "c49e6aa3545443d43c75ea75167d6c01",
                "sha256": "041dcbc40b93d0e8e784404cf3a45043b6fc122cbf3d6b4176803ae10bd0c226"
            },
            "downloads": -1,
            "filename": "moa_sdk-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c49e6aa3545443d43c75ea75167d6c01",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 28683,
            "upload_time": "2025-08-03T11:26:42",
            "upload_time_iso_8601": "2025-08-03T11:26:42.648198Z",
            "url": "https://files.pythonhosted.org/packages/d7/41/0f42e6497ebbae1699f0f11f53fdf53a060890a8835953f0b925163c07ef/moa_sdk-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 11:26:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "memof-ai",
    "github_project": "moa-sdk-python",
    "github_not_found": true,
    "lcname": "moa-sdk"
}