# Memara Python SDK
[](https://pypi.org/project/memara/)
[](https://pypi.org/project/memara/)
[](https://pypi.org/project/memara/)
[](https://opensource.org/licenses/MIT)
[](https://memara.io/docs)
The official Python SDK for the [Memara API](https://memara.io) - Give your AI a perfect memory.
## 🚀 Quick Start
### Installation
```bash
pip install memara
```
✅ **Now Available on PyPI!** Install with confidence - the package is live and ready to use.
### Basic Usage
```python
from memara import Memara
# Initialize the client
client = Memara(api_key="your_api_key_here")
# Create a memory
memory = client.create_memory(
content="Important meeting notes from today",
tags=["work", "meeting", "important"],
importance=8
)
# Search memories
results = client.search_memories(
query="meeting notes",
limit=10
)
# List all memories
memories = client.list_memories(page=1, size=20)
# Close the client when done
client.close()
# Or use as a context manager (recommended)
with Memara(api_key="your_api_key") as client:
memory = client.create_memory("Hello from Python SDK!")
```
## 📖 Documentation
### Authentication
Get your API key from [Memara Dashboard](https://memara.io/dashboard) and set it either:
1. **As environment variable** (recommended):
```bash
export MEMARA_API_KEY="your_api_key_here"
```
2. **Or pass directly**:
```python
client = Memara(api_key="your_api_key_here")
```
### Configuration
```python
# Full configuration options
client = Memara(
api_key="your_api_key", # Your Memara API key
base_url="https://api.memara.io", # API base URL (optional)
timeout=30.0 # Request timeout in seconds
)
```
### Memory Operations
#### Create Memory
```python
memory = client.create_memory(
content="The content of your memory",
tags=["tag1", "tag2"], # Optional: list of tags
source="my_app", # Optional: source identifier
importance=7, # Optional: 1-10 importance level
space_id="space_uuid" # Optional: specific space ID
)
```
#### Search Memories
```python
# Basic search
results = client.search_memories("your search query")
# Advanced search
results = client.search_memories(
query="meeting notes",
limit=20, # Max results to return
space_id="specific_space_id", # Search within specific space
cross_space=False # Search across all spaces
)
```
#### Get Memory by ID
```python
memory = client.get_memory("memory_uuid")
# With space context
memory = client.get_memory("memory_uuid", space_id="space_uuid")
```
#### Delete Memory
```python
result = client.delete_memory("memory_uuid")
```
#### Create Audio Memory (NEW in v0.2.0)
```python
# Upload audio file with automatic transcription
memory = client.create_audio_memory(
audio_file="meeting.mp3", # Path to audio file
content="Team standup meeting", # Memory title/description
tags=["meeting", "team"], # Optional: tags
importance=7, # Optional: importance (1-10)
category="audio", # Optional: category
space_id="space_uuid" # Optional: specific space
)
# Access transcription and audio data
print(f"Transcription: {memory.metadata['audio_transcription']}")
print(f"Audio URL: {memory.metadata['audio_url']}")
print(f"Duration: {memory.metadata['audio_metadata']['duration_seconds']}s")
# Supported formats: MP3, M4A, WAV, FLAC, OGG, AAC
# Three input types supported:
# 1. File path (str): "path/to/audio.mp3"
# 2. Path object: Path("audio.mp3")
# 3. Raw bytes: audio_bytes
```
**Audio Memory Features:**
- 🎙️ **Automatic Transcription**: OpenAI Whisper transcription
- 🔍 **Searchable**: Audio transcriptions are fully searchable
- 📁 **Secure Storage**: Audio stored in S3 with CDN delivery
- 📊 **Metadata**: Duration, format, language, confidence scores
- 🎚️ **Tier Limits**: Respects tier-based file size limits
### Space Operations
#### List Spaces
```python
spaces = client.list_spaces()
for space in spaces:
print(f"Space: {space.name} ({space.memory_count} memories)")
```
#### Create Space
```python
space = client.create_space(
name="My Project Space",
icon="🚀", # Optional: emoji icon
color="#6366F1", # Optional: hex color
template_type="work" # Optional: template type
)
```
## 🔧 Advanced Usage
### Error Handling
```python
from memara import Memara, MemaraAPIError, MemaraAuthError
try:
with Memara() as client:
memory = client.create_memory("Test memory")
except MemaraAuthError:
print("Authentication failed - check your API key")
except MemaraAPIError as e:
print(f"API error: {e}")
except Exception as e:
print(f"Unexpected error: {e}")
```
### Environment Variables
Set these environment variables for easier configuration:
```bash
export MEMARA_API_KEY="your_api_key_here"
export MEMARA_API_URL="https://api.memara.io" # Optional: custom API URL
```
### Async Usage (Coming Soon)
Future versions will include async support:
```python
# Coming in v0.2.0
from memara import AsyncMemara
async with AsyncMemara(api_key="your_key") as client:
memory = await client.create_memory("Async memory!")
```
## 🛠️ Development
### Contributing
1. Clone the repository
2. Install development dependencies: `pip install -e .[dev]`
3. Run tests: `pytest`
4. Format code: `black memara/`
5. Type check: `mypy memara/`
### Running Tests
```bash
# Install with dev dependencies
pip install -e .[dev]
# Run tests
pytest
# Run tests with coverage
pytest --cov=memara
```
## 🔗 Links
- **PyPI Package**: [pypi.org/project/memara](https://pypi.org/project/memara/) 📦
- **Homepage**: [memara.io](https://memara.io)
- **Documentation**: [memara.io/docs](https://memara.io/docs)
- **API Reference**: [memara.io/docs/api](https://memara.io/docs/api)
- **GitHub**: [github.com/memara-ai/memara-python-sdk](https://github.com/memara-ai/memara-python-sdk)
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🆘 Support
- **Documentation**: [memara.io/docs](https://memara.io/docs)
- **Discord**: [discord.memara.io](https://discord.memara.io)
- **Email**: [support@memara.io](mailto:support@memara.io)
- **Issues**: [GitHub Issues](https://github.com/memara-ai/memara-python-sdk/issues)
---
**Give your AI a perfect memory with Memara** 🧠✨
Raw data
{
"_id": null,
"home_page": "https://memara.io",
"name": "memara",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "ai, memory, api, sdk, artificial-intelligence, llm, gpt, claude",
"author": "Memara Team",
"author_email": "Memara Team <hello@memara.io>",
"download_url": "https://files.pythonhosted.org/packages/58/52/611df46d818fffdb764a1165f3120f3f9bed66404828c6365e0ffbd7dc2d/memara-0.2.0.tar.gz",
"platform": null,
"description": "# Memara Python SDK\n\n[](https://pypi.org/project/memara/)\n[](https://pypi.org/project/memara/)\n[](https://pypi.org/project/memara/)\n[](https://opensource.org/licenses/MIT)\n[](https://memara.io/docs)\n\nThe official Python SDK for the [Memara API](https://memara.io) - Give your AI a perfect memory.\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install memara\n```\n\n\u2705 **Now Available on PyPI!** Install with confidence - the package is live and ready to use.\n\n### Basic Usage\n\n```python\nfrom memara import Memara\n\n# Initialize the client\nclient = Memara(api_key=\"your_api_key_here\")\n\n# Create a memory\nmemory = client.create_memory(\n content=\"Important meeting notes from today\",\n tags=[\"work\", \"meeting\", \"important\"],\n importance=8\n)\n\n# Search memories\nresults = client.search_memories(\n query=\"meeting notes\",\n limit=10\n)\n\n# List all memories\nmemories = client.list_memories(page=1, size=20)\n\n# Close the client when done\nclient.close()\n\n# Or use as a context manager (recommended)\nwith Memara(api_key=\"your_api_key\") as client:\n memory = client.create_memory(\"Hello from Python SDK!\")\n```\n\n## \ud83d\udcd6 Documentation\n\n### Authentication\n\nGet your API key from [Memara Dashboard](https://memara.io/dashboard) and set it either:\n\n1. **As environment variable** (recommended):\n```bash\nexport MEMARA_API_KEY=\"your_api_key_here\"\n```\n\n2. **Or pass directly**:\n```python\nclient = Memara(api_key=\"your_api_key_here\")\n```\n\n### Configuration\n\n```python\n# Full configuration options\nclient = Memara(\n api_key=\"your_api_key\", # Your Memara API key\n base_url=\"https://api.memara.io\", # API base URL (optional)\n timeout=30.0 # Request timeout in seconds\n)\n```\n\n### Memory Operations\n\n#### Create Memory\n```python\nmemory = client.create_memory(\n content=\"The content of your memory\",\n tags=[\"tag1\", \"tag2\"], # Optional: list of tags\n source=\"my_app\", # Optional: source identifier \n importance=7, # Optional: 1-10 importance level\n space_id=\"space_uuid\" # Optional: specific space ID\n)\n```\n\n#### Search Memories\n```python\n# Basic search\nresults = client.search_memories(\"your search query\")\n\n# Advanced search\nresults = client.search_memories(\n query=\"meeting notes\",\n limit=20, # Max results to return\n space_id=\"specific_space_id\", # Search within specific space\n cross_space=False # Search across all spaces\n)\n```\n\n#### Get Memory by ID\n```python\nmemory = client.get_memory(\"memory_uuid\")\n\n# With space context\nmemory = client.get_memory(\"memory_uuid\", space_id=\"space_uuid\")\n```\n\n#### Delete Memory\n```python\nresult = client.delete_memory(\"memory_uuid\")\n```\n\n#### Create Audio Memory (NEW in v0.2.0)\n```python\n# Upload audio file with automatic transcription\nmemory = client.create_audio_memory(\n audio_file=\"meeting.mp3\", # Path to audio file\n content=\"Team standup meeting\", # Memory title/description\n tags=[\"meeting\", \"team\"], # Optional: tags\n importance=7, # Optional: importance (1-10)\n category=\"audio\", # Optional: category\n space_id=\"space_uuid\" # Optional: specific space\n)\n\n# Access transcription and audio data\nprint(f\"Transcription: {memory.metadata['audio_transcription']}\")\nprint(f\"Audio URL: {memory.metadata['audio_url']}\")\nprint(f\"Duration: {memory.metadata['audio_metadata']['duration_seconds']}s\")\n\n# Supported formats: MP3, M4A, WAV, FLAC, OGG, AAC\n# Three input types supported:\n# 1. File path (str): \"path/to/audio.mp3\"\n# 2. Path object: Path(\"audio.mp3\")\n# 3. Raw bytes: audio_bytes\n```\n\n**Audio Memory Features:**\n- \ud83c\udf99\ufe0f **Automatic Transcription**: OpenAI Whisper transcription\n- \ud83d\udd0d **Searchable**: Audio transcriptions are fully searchable\n- \ud83d\udcc1 **Secure Storage**: Audio stored in S3 with CDN delivery\n- \ud83d\udcca **Metadata**: Duration, format, language, confidence scores\n- \ud83c\udf9a\ufe0f **Tier Limits**: Respects tier-based file size limits\n\n### Space Operations\n\n#### List Spaces\n```python\nspaces = client.list_spaces()\nfor space in spaces:\n print(f\"Space: {space.name} ({space.memory_count} memories)\")\n```\n\n#### Create Space\n```python\nspace = client.create_space(\n name=\"My Project Space\",\n icon=\"\ud83d\ude80\", # Optional: emoji icon\n color=\"#6366F1\", # Optional: hex color\n template_type=\"work\" # Optional: template type\n)\n```\n\n## \ud83d\udd27 Advanced Usage\n\n### Error Handling\n\n```python\nfrom memara import Memara, MemaraAPIError, MemaraAuthError\n\ntry:\n with Memara() as client:\n memory = client.create_memory(\"Test memory\")\nexcept MemaraAuthError:\n print(\"Authentication failed - check your API key\")\nexcept MemaraAPIError as e:\n print(f\"API error: {e}\")\nexcept Exception as e:\n print(f\"Unexpected error: {e}\")\n```\n\n### Environment Variables\n\nSet these environment variables for easier configuration:\n\n```bash\nexport MEMARA_API_KEY=\"your_api_key_here\"\nexport MEMARA_API_URL=\"https://api.memara.io\" # Optional: custom API URL\n```\n\n### Async Usage (Coming Soon)\n\nFuture versions will include async support:\n\n```python\n# Coming in v0.2.0\nfrom memara import AsyncMemara\n\nasync with AsyncMemara(api_key=\"your_key\") as client:\n memory = await client.create_memory(\"Async memory!\")\n```\n\n## \ud83d\udee0\ufe0f Development\n\n### Contributing\n\n1. Clone the repository\n2. Install development dependencies: `pip install -e .[dev]` \n3. Run tests: `pytest`\n4. Format code: `black memara/`\n5. Type check: `mypy memara/`\n\n### Running Tests\n\n```bash\n# Install with dev dependencies\npip install -e .[dev]\n\n# Run tests\npytest\n\n# Run tests with coverage\npytest --cov=memara\n```\n\n## \ud83d\udd17 Links\n\n- **PyPI Package**: [pypi.org/project/memara](https://pypi.org/project/memara/) \ud83d\udce6\n- **Homepage**: [memara.io](https://memara.io)\n- **Documentation**: [memara.io/docs](https://memara.io/docs)\n- **API Reference**: [memara.io/docs/api](https://memara.io/docs/api)\n- **GitHub**: [github.com/memara-ai/memara-python-sdk](https://github.com/memara-ai/memara-python-sdk)\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83c\udd98 Support\n\n- **Documentation**: [memara.io/docs](https://memara.io/docs)\n- **Discord**: [discord.memara.io](https://discord.memara.io)\n- **Email**: [support@memara.io](mailto:support@memara.io)\n- **Issues**: [GitHub Issues](https://github.com/memara-ai/memara-python-sdk/issues)\n\n---\n\n**Give your AI a perfect memory with Memara** \ud83e\udde0\u2728\n",
"bugtrack_url": null,
"license": null,
"summary": "Official Python SDK for the Memara API - Give your AI a perfect memory",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/memara-ai/memara-python-sdk/issues",
"Changelog": "https://github.com/memara-ai/memara-python-sdk/blob/main/CHANGELOG.md",
"Documentation": "https://memara.io/docs",
"Homepage": "https://memara.io",
"Repository": "https://github.com/memara-ai/memara-python-sdk"
},
"split_keywords": [
"ai",
" memory",
" api",
" sdk",
" artificial-intelligence",
" llm",
" gpt",
" claude"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "36fc75a64b5d03949b8571398d9c66267b073c752e2f6fb300fa0cd3f27c116f",
"md5": "0331fcecef6172106c402973e3fead50",
"sha256": "f2625bec067abb4cd98e90b7d6ea8e2d55560d358edfbb46032915bade0023c7"
},
"downloads": -1,
"filename": "memara-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0331fcecef6172106c402973e3fead50",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 12162,
"upload_time": "2025-10-07T21:29:31",
"upload_time_iso_8601": "2025-10-07T21:29:31.570384Z",
"url": "https://files.pythonhosted.org/packages/36/fc/75a64b5d03949b8571398d9c66267b073c752e2f6fb300fa0cd3f27c116f/memara-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5852611df46d818fffdb764a1165f3120f3f9bed66404828c6365e0ffbd7dc2d",
"md5": "83662be05d584e80a0880649780ce6bf",
"sha256": "aa55e5cc6fddb41baf1e5af0b8c4c7b68b385e45c769dfc812cbcd597d4f9b44"
},
"downloads": -1,
"filename": "memara-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "83662be05d584e80a0880649780ce6bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 15255,
"upload_time": "2025-10-07T21:29:32",
"upload_time_iso_8601": "2025-10-07T21:29:32.385444Z",
"url": "https://files.pythonhosted.org/packages/58/52/611df46d818fffdb764a1165f3120f3f9bed66404828c6365e0ffbd7dc2d/memara-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-07 21:29:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "memara-ai",
"github_project": "memara-python-sdk",
"github_not_found": true,
"lcname": "memara"
}