memanto 0.0.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.
Files changed (110) hide show
  1. memanto-0.0.1/.dockerignore +51 -0
  2. memanto-0.0.1/.env.example +17 -0
  3. memanto-0.0.1/.github/workflows/ci.yml +70 -0
  4. memanto-0.0.1/.github/workflows/publish.yml +49 -0
  5. memanto-0.0.1/.gitignore +106 -0
  6. memanto-0.0.1/.pre-commit-config.yaml +23 -0
  7. memanto-0.0.1/CODE_OF_CONDUCT.md +94 -0
  8. memanto-0.0.1/CONTRIBUTING.md +273 -0
  9. memanto-0.0.1/Dockerfile +44 -0
  10. memanto-0.0.1/LICENSE +18 -0
  11. memanto-0.0.1/PKG-INFO +228 -0
  12. memanto-0.0.1/README.md +179 -0
  13. memanto-0.0.1/SECURITY.md +195 -0
  14. memanto-0.0.1/assets/Architecture-diagram.png +0 -0
  15. memanto-0.0.1/assets/memanto-dark.svg +13 -0
  16. memanto-0.0.1/assets/memanto-logo.png +0 -0
  17. memanto-0.0.1/docker-compose.yml +22 -0
  18. memanto-0.0.1/docs/AGENT_INTEGRATION_GUIDE.md +558 -0
  19. memanto-0.0.1/docs/AGENT_MEMORY_BEST_PRACTICES.md +699 -0
  20. memanto-0.0.1/docs/CLI_INSTALLATION.md +523 -0
  21. memanto-0.0.1/docs/CLI_USER_GUIDE.md +808 -0
  22. memanto-0.0.1/docs/DEPLOYMENT_GUIDE.md +453 -0
  23. memanto-0.0.1/docs/GETTING_STARTED.md +516 -0
  24. memanto-0.0.1/docs/HYBRID_TIMELINE_GUIDE.md +514 -0
  25. memanto-0.0.1/docs/SESSION_ARCHITECTURE.md +463 -0
  26. memanto-0.0.1/docs/TIMELINE_VISUALIZATION_EXAMPLES.md +549 -0
  27. memanto-0.0.1/docs/V2_QUICK_START.md +328 -0
  28. memanto-0.0.1/memanto/__init__.py +3 -0
  29. memanto-0.0.1/memanto/__main__.py +8 -0
  30. memanto-0.0.1/memanto/app/__init__.py +5 -0
  31. memanto-0.0.1/memanto/app/_version.py +24 -0
  32. memanto-0.0.1/memanto/app/clients/moorcheh.py +51 -0
  33. memanto-0.0.1/memanto/app/config.py +100 -0
  34. memanto-0.0.1/memanto/app/constants.py +76 -0
  35. memanto-0.0.1/memanto/app/core.py +325 -0
  36. memanto-0.0.1/memanto/app/main.py +66 -0
  37. memanto-0.0.1/memanto/app/models/__init__.py +284 -0
  38. memanto-0.0.1/memanto/app/models/phase_d.py +212 -0
  39. memanto-0.0.1/memanto/app/models/session.py +156 -0
  40. memanto-0.0.1/memanto/app/models/universal_endpoints.py +99 -0
  41. memanto-0.0.1/memanto/app/routes/auth_deps.py +95 -0
  42. memanto-0.0.1/memanto/app/routes/context.py +148 -0
  43. memanto-0.0.1/memanto/app/routes/health.py +45 -0
  44. memanto-0.0.1/memanto/app/routes/memory.py +337 -0
  45. memanto-0.0.1/memanto/app/routes/memory_v2.py +813 -0
  46. memanto-0.0.1/memanto/app/routes/namespaces.py +110 -0
  47. memanto-0.0.1/memanto/app/routes/sessions.py +238 -0
  48. memanto-0.0.1/memanto/app/routes/universal_endpoints.py +227 -0
  49. memanto-0.0.1/memanto/app/services/__init__.py +1 -0
  50. memanto-0.0.1/memanto/app/services/agent_service.py +224 -0
  51. memanto-0.0.1/memanto/app/services/context_summarization_service.py +323 -0
  52. memanto-0.0.1/memanto/app/services/daily_summary_service.py +294 -0
  53. memanto-0.0.1/memanto/app/services/memory_export_service.py +217 -0
  54. memanto-0.0.1/memanto/app/services/memory_read_service.py +910 -0
  55. memanto-0.0.1/memanto/app/services/memory_validation_service.py +83 -0
  56. memanto-0.0.1/memanto/app/services/memory_write_service.py +369 -0
  57. memanto-0.0.1/memanto/app/services/namespace_service.py +87 -0
  58. memanto-0.0.1/memanto/app/services/session_service.py +450 -0
  59. memanto-0.0.1/memanto/app/services/summary_visualization_service.py +277 -0
  60. memanto-0.0.1/memanto/app/services/universal_services.py +392 -0
  61. memanto-0.0.1/memanto/app/ui/__init__.py +1 -0
  62. memanto-0.0.1/memanto/app/ui/routes/__init__.py +1 -0
  63. memanto-0.0.1/memanto/app/ui/routes/ui_router.py +257 -0
  64. memanto-0.0.1/memanto/app/ui/static/index.html +2060 -0
  65. memanto-0.0.1/memanto/app/ui/static/logo.svg +13 -0
  66. memanto-0.0.1/memanto/app/utils/auth.py +162 -0
  67. memanto-0.0.1/memanto/app/utils/errors.py +210 -0
  68. memanto-0.0.1/memanto/app/utils/idempotency.py +186 -0
  69. memanto-0.0.1/memanto/app/utils/ids.py +47 -0
  70. memanto-0.0.1/memanto/app/utils/logging.py +229 -0
  71. memanto-0.0.1/memanto/app/utils/metrics.py +187 -0
  72. memanto-0.0.1/memanto/app/utils/rate_limiting.py +141 -0
  73. memanto-0.0.1/memanto/app/utils/safe_deletion.py +264 -0
  74. memanto-0.0.1/memanto/app/utils/temporal_helpers.py +237 -0
  75. memanto-0.0.1/memanto/app/utils/tracing.py +205 -0
  76. memanto-0.0.1/memanto/app/utils/validation.py +161 -0
  77. memanto-0.0.1/memanto/cli/__init__.py +5 -0
  78. memanto-0.0.1/memanto/cli/client/__init__.py +0 -0
  79. memanto-0.0.1/memanto/cli/client/direct_client.py +1417 -0
  80. memanto-0.0.1/memanto/cli/client/sdk_client.py +1274 -0
  81. memanto-0.0.1/memanto/cli/commands/__init__.py +20 -0
  82. memanto-0.0.1/memanto/cli/commands/_shared.py +133 -0
  83. memanto-0.0.1/memanto/cli/commands/agent.py +620 -0
  84. memanto-0.0.1/memanto/cli/commands/config_cmd.py +51 -0
  85. memanto-0.0.1/memanto/cli/commands/connect.py +609 -0
  86. memanto-0.0.1/memanto/cli/commands/core.py +592 -0
  87. memanto-0.0.1/memanto/cli/commands/memory.py +850 -0
  88. memanto-0.0.1/memanto/cli/commands/memory_mgmt.py +185 -0
  89. memanto-0.0.1/memanto/cli/commands/schedule.py +72 -0
  90. memanto-0.0.1/memanto/cli/commands/session.py +91 -0
  91. memanto-0.0.1/memanto/cli/config/__init__.py +0 -0
  92. memanto-0.0.1/memanto/cli/config/manager.py +247 -0
  93. memanto-0.0.1/memanto/cli/connect/__init__.py +5 -0
  94. memanto-0.0.1/memanto/cli/connect/agent_registry.py +323 -0
  95. memanto-0.0.1/memanto/cli/connect/engine.py +394 -0
  96. memanto-0.0.1/memanto/cli/connect/templates.py +337 -0
  97. memanto-0.0.1/memanto/cli/main.py +17 -0
  98. memanto-0.0.1/memanto/cli/schedule_manager.py +186 -0
  99. memanto-0.0.1/memanto/cli/ui/__init__.py +3 -0
  100. memanto-0.0.1/memanto/cli/ui/display.py +192 -0
  101. memanto-0.0.1/memanto/cli/ui/theme.py +24 -0
  102. memanto-0.0.1/pyproject.toml +136 -0
  103. memanto-0.0.1/pytest.ini +18 -0
  104. memanto-0.0.1/tests/__init__.py +1 -0
  105. memanto-0.0.1/tests/conftest.py +18 -0
  106. memanto-0.0.1/tests/requirements.txt +6 -0
  107. memanto-0.0.1/tests/test_api.py +486 -0
  108. memanto-0.0.1/tests/test_batch_memories.json +33 -0
  109. memanto-0.0.1/tests/test_cli.py +402 -0
  110. memanto-0.0.1/tests/test_unit.py +322 -0
@@ -0,0 +1,51 @@
1
+ # Version control
2
+ .git/
3
+ .gitignore
4
+
5
+ # Python artifacts
6
+ __pycache__/
7
+ *.pyc
8
+ *.pyo
9
+ *.pyd
10
+ *.egg-info/
11
+ dist/
12
+ build/
13
+ .eggs/
14
+
15
+ # Virtual environments
16
+ .venv/
17
+ venv/
18
+ env/
19
+ ENV/
20
+
21
+ # Secrets — never bake these into the image
22
+ .env
23
+ .env.local
24
+ .env.*.local
25
+ *.key
26
+ *.pem
27
+ *.crt
28
+ secrets/
29
+
30
+ # Dev / CI tooling (not needed at runtime)
31
+ tests/
32
+ .github/
33
+ .pre-commit-config.yaml
34
+ .ruff_cache/
35
+ .mypy_cache/
36
+ .pytest_cache/
37
+ .tox/
38
+ .nox/
39
+
40
+ # Docs and assets (not needed at runtime)
41
+ docs/
42
+ assets/
43
+
44
+ # Editor / OS noise
45
+ .vscode/
46
+ .idea/
47
+ .claude/
48
+ .DS_Store
49
+ Thumbs.db
50
+ *.swp
51
+ *.swo
@@ -0,0 +1,17 @@
1
+ # Moorcheh SDK Configuration
2
+ # Get your API key from https://app.moorcheh.ai
3
+ # Free tier: 500 monthly credits = ~100,000 operations
4
+ MOORCHEH_API_KEY=mk_your_api_key_here
5
+
6
+ # AI / Answer Configuration (all optional — defaults shown)
7
+ # ANSWER_MODEL=anthropic.claude-sonnet-4-20250514-v1:0
8
+ # ANSWER_TEMPERATURE=0.7
9
+ # ANSWER_LIMIT=5
10
+ # ANSWER_THRESHOLD=0.25
11
+ # RECALL_LIMIT=10
12
+
13
+ # Session Configuration (all optional — defaults shown)
14
+ # SESSION_DEFAULT_DURATION_HOURS=6
15
+ # SESSION_AUTO_RENEW_ENABLED=True
16
+ # SESSION_AUTO_RENEW_INTERVAL_HOURS=6
17
+ # SESSION_EXTEND_THRESHOLD_MINUTES=30
@@ -0,0 +1,70 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: main
6
+ pull_request_review:
7
+ types: [submitted]
8
+
9
+ jobs:
10
+ lint-and-type-check:
11
+ if: github.event_name == 'push' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.10"
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v4
24
+
25
+ - name: Install dependencies
26
+ run: uv sync --all-extras --dev
27
+
28
+ - name: Run ruff linting
29
+ run: uv run ruff check .
30
+
31
+ - name: Run ruff formatting check
32
+ run: uv run ruff format --check .
33
+
34
+ - name: Run mypy type checking
35
+ run: uv run mypy .
36
+
37
+ test:
38
+ needs: lint-and-type-check
39
+ if: github.event_name == 'push' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
40
+ runs-on: ubuntu-latest
41
+ strategy:
42
+ matrix:
43
+ python-version:
44
+ - "3.14"
45
+ - "3.13"
46
+ - "3.12"
47
+ - "3.11"
48
+ - "3.10"
49
+
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+
53
+ - name: Set up Python ${{ matrix.python-version }}
54
+ uses: actions/setup-python@v5
55
+ with:
56
+ python-version: ${{ matrix.python-version }}
57
+
58
+ - name: Install uv
59
+ uses: astral-sh/setup-uv@v4
60
+
61
+ - name: Install dependencies
62
+ run: uv sync --all-extras --dev
63
+
64
+ - name: Create version fallback
65
+ run: echo '__version__ = "0.0.0.dev0"' > memanto/app/_version.py
66
+
67
+ - name: Run tests
68
+ env:
69
+ MOORCHEH_API_KEY: test-api-key
70
+ run: uv run pytest tests/ -v --tb=short
@@ -0,0 +1,49 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ name: Publish to PyPI
10
+ # Only run on releases starting with 'v'
11
+ if: github.event_name == 'release' && startsWith(github.event.release.tag_name, 'v')
12
+ runs-on: ubuntu-latest
13
+ environment: pypi
14
+ permissions:
15
+ contents: read
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.10"
27
+
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v4
30
+
31
+ - name: Install dependencies
32
+ run: uv sync --all-extras --dev
33
+
34
+ - name: Create version fallback
35
+ run: echo '__version__ = "0.0.0.dev0"' > memanto/app/_version.py
36
+
37
+ - name: Run tests
38
+ env:
39
+ MOORCHEH_API_KEY: test-api-key
40
+ run: uv run pytest tests/ -v --tb=short
41
+
42
+ - name: Build package
43
+ run: uv run python -m build
44
+
45
+ - name: Publish to PyPI
46
+ uses: pypa/gh-action-pypi-publish@release/v1
47
+ with:
48
+ password: ${{ secrets.PYPI_API_TOKEN }}
49
+ packages-dir: dist/
@@ -0,0 +1,106 @@
1
+ # Environment variables and secrets
2
+ .env
3
+ .env.local
4
+ .env.*.local
5
+ *.key
6
+ *.pem
7
+ *.crt
8
+ secrets/
9
+ .secrets
10
+
11
+ # Python
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+ *.so
16
+ .Python
17
+ uv.lock
18
+ build/
19
+ develop-eggs/
20
+ dist/
21
+ downloads/
22
+ eggs/
23
+ .eggs/
24
+ lib/
25
+ lib64/
26
+ parts/
27
+ sdist/
28
+ var/
29
+ wheels/
30
+ share/python-wheels/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+ MANIFEST
35
+
36
+ # Virtual environments
37
+ venv/
38
+ .venv/
39
+ ENV/
40
+ env/
41
+ .env/
42
+
43
+ # IDEs
44
+ .vscode/
45
+ .idea/
46
+ .claude/
47
+ *.swp
48
+ *.swo
49
+ *~
50
+ .DS_Store
51
+
52
+ # Testing
53
+ .tox/
54
+ .nox/
55
+ .coverage
56
+ .coverage.*
57
+ .cache
58
+ nosetests.xml
59
+ coverage.xml
60
+ *.cover
61
+ *.log
62
+ .pytest_cache/
63
+
64
+ # Jupyter Notebook
65
+ .ipynb_checkpoints
66
+
67
+ # mypy
68
+ .mypy_cache/
69
+ .dmypy.json
70
+ dmypy.json
71
+
72
+ # Pyre type checker
73
+ .pyre/
74
+
75
+ # pytype static type analyzer
76
+ .pytype/
77
+
78
+ # Cython debug symbols
79
+ cython_debug/
80
+
81
+ # Database
82
+ *.db
83
+ *.sqlite
84
+ *.sqlite3
85
+
86
+ # Logs
87
+ logs/
88
+ *.log
89
+ pip-log.txt
90
+ pip-delete-this-directory.txt
91
+
92
+ # OS
93
+ .DS_Store
94
+ Thumbs.db
95
+ Desktop.ini
96
+
97
+ # Temporary files
98
+ tmp/
99
+ temp/
100
+ *.tmp
101
+ *.bak
102
+ *.swp
103
+ *.swo
104
+
105
+ # Generated version file
106
+ **/_version.py
@@ -0,0 +1,23 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: ruff-check
5
+ name: ruff lint
6
+ entry: uv run ruff check .
7
+ language: system
8
+ pass_filenames: false
9
+ always_run: true
10
+
11
+ - id: ruff-format
12
+ name: ruff format check
13
+ entry: uv run ruff format --check .
14
+ language: system
15
+ pass_filenames: false
16
+ always_run: true
17
+
18
+ - id: mypy
19
+ name: mypy type check
20
+ entry: uv run mypy .
21
+ language: system
22
+ pass_filenames: false
23
+ always_run: true
@@ -0,0 +1,94 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders of the MEMANTO community pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ---
10
+
11
+ ## Our Standards
12
+
13
+ **Examples of behavior that contributes to a positive environment:**
14
+
15
+ - Using welcoming and inclusive language
16
+ - Being respectful of differing viewpoints and experiences
17
+ - Gracefully accepting constructive feedback
18
+ - Focusing on what is best for the community and the project
19
+ - Showing empathy toward other community members
20
+
21
+ **Examples of unacceptable behavior:**
22
+
23
+ - The use of sexualized language or imagery and unwelcome sexual attention or advances
24
+ - Trolling, insulting or derogatory comments, and personal or political attacks
25
+ - Public or private harassment
26
+ - Publishing others' private information (e.g., physical or email addresses) without explicit permission
27
+ - Dismissing or attacking inclusion-focused requests
28
+ - Sustained disruption of discussions, talks, or contributions
29
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
30
+
31
+ ---
32
+
33
+ ## Enforcement Responsibilities
34
+
35
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior. They will take appropriate and fair corrective action in response to any behavior they deem inappropriate, threatening, offensive, or harmful.
36
+
37
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned with this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
38
+
39
+ ---
40
+
41
+ ## Scope
42
+
43
+ This Code of Conduct applies in all community spaces — including the GitHub repository, Discord server, documentation, social media, and any official communication channels — and also applies when an individual is officially representing the project or community in public spaces.
44
+
45
+ ---
46
+
47
+ ## Enforcement
48
+
49
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders at:
50
+
51
+ - **Email**: support@moorcheh.ai
52
+ - **Subject line**: `[Code of Conduct] Brief description`
53
+
54
+ All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident.
55
+
56
+ ---
57
+
58
+ ## Enforcement Guidelines
59
+
60
+ Community leaders will follow these guidelines when determining consequences for any action they deem in violation of this Code of Conduct:
61
+
62
+ ### 1. Correction
63
+
64
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
65
+
66
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
67
+
68
+ ### 2. Warning
69
+
70
+ **Community Impact**: A violation through a single incident or series of actions.
71
+
72
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
73
+
74
+ ### 3. Temporary Ban
75
+
76
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
77
+
78
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
79
+
80
+ ### 4. Permanent Ban
81
+
82
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
83
+
84
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
85
+
86
+ ---
87
+
88
+ ## Attribution
89
+
90
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
91
+
92
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
93
+
94
+ For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
@@ -0,0 +1,273 @@
1
+ # Contributing to MEMANTO
2
+
3
+ Thank you for your interest in contributing to MEMANTO — the universal memory layer for agentic AI. This guide will help you get set up and understand how we work.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ - [Code of Conduct](#code-of-conduct)
10
+ - [Ways to Contribute](#ways-to-contribute)
11
+ - [Reporting Bugs](#reporting-bugs)
12
+ - [Requesting Features](#requesting-features)
13
+ - [Development Setup](#development-setup)
14
+ - [Project Structure](#project-structure)
15
+ - [Code Style](#code-style)
16
+ - [Running Tests](#running-tests)
17
+ - [Submitting a Pull Request](#submitting-a-pull-request)
18
+ - [Commit Message Convention](#commit-message-convention)
19
+ - [Community](#community)
20
+
21
+ ---
22
+
23
+ ## Code of Conduct
24
+
25
+ By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it before contributing.
26
+
27
+ ---
28
+
29
+ ## Ways to Contribute
30
+
31
+ - **Bug reports** — open a GitHub issue with reproduction steps
32
+ - **Feature requests** — open a GitHub issue describing the use case
33
+ - **Documentation improvements** — fix typos, improve clarity, add examples
34
+ - **Bug fixes and features** — submit a pull request (see below)
35
+ - **Memory type integrations** — propose new memory type handlers or agent connectors
36
+
37
+ ---
38
+
39
+ ## Reporting Bugs
40
+
41
+ Before opening an issue, please check that it hasn't been reported already.
42
+
43
+ When filing a bug, include:
44
+
45
+ 1. **MEMANTO version** (`pip show memanto`)
46
+ 2. **Python version** (`python --version`)
47
+ 3. **Operating system**
48
+ 4. **Steps to reproduce** — a minimal, self-contained script is ideal
49
+ 5. **Expected behavior** vs. **actual behavior**
50
+ 6. **Relevant logs or error output**
51
+
52
+ Open a bug report at: https://github.com/moorcheh-ai/memanto/issues
53
+
54
+ > **Security vulnerabilities** must **not** be reported as public issues. See [SECURITY.md](SECURITY.md) for responsible disclosure instructions.
55
+
56
+ ---
57
+
58
+ ## Requesting Features
59
+
60
+ Open a feature request at https://github.com/moorcheh-ai/memanto/issues and include:
61
+
62
+ - A clear description of the problem you are trying to solve
63
+ - Your proposed solution or API
64
+ - Any alternatives you considered
65
+ - Whether you are willing to implement it yourself
66
+
67
+ ---
68
+
69
+ ## Development Setup
70
+
71
+ ### Prerequisites
72
+
73
+ - Python 3.10–3.12
74
+ - [`uv`](https://github.com/astral-sh/uv) (recommended) or `pip`
75
+ - A Moorcheh API key from https://console.moorcheh.ai/api-keys
76
+
77
+ ### 1. Fork and clone
78
+
79
+ ```bash
80
+ git clone https://github.com/<your-username>/memanto.git
81
+ cd memanto
82
+ ```
83
+
84
+ ### 2. Create a virtual environment and install dependencies
85
+
86
+ **With uv (recommended):**
87
+
88
+ ```bash
89
+ uv sync --group dev
90
+ ```
91
+
92
+ **With pip:**
93
+
94
+ ```bash
95
+ python -m venv .venv
96
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
97
+ pip install -e ".[all]"
98
+ ```
99
+
100
+ ### 3. Configure your environment
101
+
102
+ ```bash
103
+ cp .env.example .env
104
+ # Edit .env and add your MOORCHEH_API_KEY
105
+ ```
106
+
107
+ ### 4. Install pre-commit hooks
108
+
109
+ ```bash
110
+ pre-commit install
111
+ ```
112
+
113
+ The hooks run `uv run ruff check`, `uv run ruff format --check`, and `uv run mypy` on every commit automatically.
114
+
115
+ ---
116
+
117
+ ## Project Structure
118
+
119
+ ```
120
+ memanto/
121
+ ├── memanto/
122
+ │ ├── app/ # FastAPI application, routes, models
123
+ │ └── cli/ # Typer CLI commands
124
+ ├── tests/ # pytest test suite
125
+ ├── docs/ # Additional documentation
126
+ ├── assets/ # Logos and diagrams
127
+ ├── pyproject.toml # Project metadata and tool configuration
128
+ └── SECURITY.md # Security policy
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Code Style
134
+
135
+ We use **[Ruff](https://docs.astral.sh/ruff/)** for linting and formatting, and **[mypy](https://mypy.readthedocs.io/)** for static type checking. All tools are run via `uv run` so no global installs are needed.
136
+
137
+ ```bash
138
+ # Check for lint errors
139
+ uv run ruff check .
140
+
141
+ # Check formatting (non-destructive — reports issues without modifying files)
142
+ uv run ruff format --check .
143
+
144
+ # Apply lint fixes and format in one go (use before committing)
145
+ uv run ruff check . --fix && uv run ruff format .
146
+
147
+ # Type check
148
+ uv run mypy .
149
+ ```
150
+
151
+ Key conventions:
152
+
153
+ - Line length: 88 characters
154
+ - Target Python version: 3.10+
155
+ - Import order enforced by ruff (`isort` rules)
156
+ - Do not suppress type errors with `# type: ignore` without a comment explaining why
157
+
158
+ Running pre-commit manually:
159
+
160
+ ```bash
161
+ uv run pre-commit run --all-files
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Running Tests
167
+
168
+ ```bash
169
+ # Run the full test suite
170
+ pytest
171
+
172
+ # Run a specific test file
173
+ pytest tests/test_cli.py
174
+
175
+ # Run with verbose output
176
+ pytest -v
177
+
178
+ # Run and stop on first failure
179
+ pytest -x
180
+ ```
181
+
182
+ Tests require a valid `MOORCHEH_API_KEY` in your environment or `.env` file for any integration tests. Unit tests that don't hit the network will run without a key.
183
+
184
+ ---
185
+
186
+ ## Submitting a Pull Request
187
+
188
+ 1. **Create a branch** from `main`:
189
+
190
+ ```bash
191
+ git checkout -b fix/describe-your-fix
192
+ # or
193
+ git checkout -b feat/describe-your-feature
194
+ ```
195
+
196
+ Branch naming:
197
+ | Prefix | Use for |
198
+ |--------|---------|
199
+ | `feat/` | new features |
200
+ | `fix/` | bug fixes |
201
+ | `docs/` | documentation only |
202
+ | `chore/` | maintenance, dependency updates |
203
+ | `test/` | adding or fixing tests |
204
+ | `refactor/` | code restructuring without behavior change |
205
+
206
+ 2. **Make your changes.** Keep each PR focused on a single concern.
207
+
208
+ 3. **Add tests** for any new behavior. PRs that reduce test coverage will be asked to add tests before merging.
209
+
210
+ 4. **Ensure all checks pass:**
211
+
212
+ ```bash
213
+ pre-commit run --all-files
214
+ pytest
215
+ ```
216
+
217
+ 5. **Push your branch** and open a pull request against `main`.
218
+
219
+ 6. **Fill in the PR description:**
220
+ - What problem does this solve?
221
+ - How did you test it?
222
+ - Link any related issues (e.g., `Closes #42`)
223
+
224
+ 7. A maintainer will review your PR. Please respond to feedback within a reasonable time. PRs with no activity for 30 days may be closed.
225
+
226
+ ### PR Checklist
227
+
228
+ - [ ] Code follows the project style (`ruff`, `mypy` pass)
229
+ - [ ] Tests added or updated for changed behavior
230
+ - [ ] All existing tests pass
231
+ - [ ] Documentation updated if the public API or CLI changed
232
+ - [ ] No secrets or credentials in the diff
233
+
234
+ ---
235
+
236
+ ## Commit Message Convention
237
+
238
+ We follow [Conventional Commits](https://www.conventionalcommits.org/):
239
+
240
+ ```
241
+ <type>(<scope>): <short summary>
242
+
243
+ [optional body]
244
+
245
+ [optional footer(s)]
246
+ ```
247
+
248
+ **Types:** `feat`, `fix`, `docs`, `chore`, `test`, `refactor`, `perf`, `ci`
249
+
250
+ **Examples:**
251
+
252
+ ```
253
+ feat(cli): add --type flag to recall command
254
+ fix(app): handle empty memory list in daily-summary endpoint
255
+ docs: update REST API section in README
256
+ chore(deps): bump pydantic to 2.7.0
257
+ ```
258
+
259
+ Rules:
260
+ - Use the imperative mood in the summary ("add", not "added" or "adds")
261
+ - Keep the summary under 72 characters
262
+ - Reference issues in the footer: `Closes #123`
263
+
264
+ ---
265
+
266
+ ## Community
267
+
268
+ - **Discord**: [Join our server](https://discord.gg/CyxRFQSQ3p) — the best place for quick questions and discussions
269
+ - **GitHub Issues**: https://github.com/moorcheh-ai/memanto/issues — bugs and feature requests
270
+ - **Email**: support@moorcheh.ai — for anything that doesn't fit the above
271
+ - **Docs**: https://docs.memanto.ai
272
+
273
+ We appreciate every contribution, no matter how small. Thank you for helping make MEMANTO better.