mesa-memory 0.9.0__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.
- mesa_memory-0.9.0/LICENSE +21 -0
- mesa_memory-0.9.0/MANIFEST.in +7 -0
- mesa_memory-0.9.0/PKG-INFO +213 -0
- mesa_memory-0.9.0/README.md +123 -0
- mesa_memory-0.9.0/mesa_api/__init__.py +9 -0
- mesa_memory-0.9.0/mesa_api/admission.py +23 -0
- mesa_memory-0.9.0/mesa_api/identifier_validation.py +67 -0
- mesa_memory-0.9.0/mesa_api/routers/control/router.py +276 -0
- mesa_memory-0.9.0/mesa_api/schemas.py +16 -0
- mesa_memory-0.9.0/mesa_api/v4_router.py +1624 -0
- mesa_memory-0.9.0/mesa_client/__init__.py +27 -0
- mesa_memory-0.9.0/mesa_client/client.py +1265 -0
- mesa_memory-0.9.0/mesa_mcp/__init__.py +5 -0
- mesa_memory-0.9.0/mesa_mcp/adapter.py +226 -0
- mesa_memory-0.9.0/mesa_mcp/antigravity_bridge.py +466 -0
- mesa_memory-0.9.0/mesa_mcp/antigravity_cli.py +334 -0
- mesa_memory-0.9.0/mesa_mcp/bounded_cache.py +133 -0
- mesa_memory-0.9.0/mesa_mcp/codex_cli.py +631 -0
- mesa_memory-0.9.0/mesa_mcp/codex_hooks.py +161 -0
- mesa_memory-0.9.0/mesa_mcp/configuration.py +100 -0
- mesa_memory-0.9.0/mesa_mcp/errors.py +24 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/__init__.py +1 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/anomaly.py +30 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/app.py +270 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/approval.py +132 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/auth.py +32 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/codex_transport.py +148 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/middleware.py +182 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/operations.py +955 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/policy/__init__.py +1 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/policy/engine.py +80 -0
- mesa_memory-0.9.0/mesa_mcp/gateway/policy/simulator.py +45 -0
- mesa_memory-0.9.0/mesa_mcp/http_service.py +63 -0
- mesa_memory-0.9.0/mesa_mcp/local_cli.py +374 -0
- mesa_memory-0.9.0/mesa_mcp/security.py +68 -0
- mesa_memory-0.9.0/mesa_mcp/server.py +317 -0
- mesa_memory-0.9.0/mesa_mcp/service.py +25 -0
- mesa_memory-0.9.0/mesa_mcp/v4_service.py +582 -0
- mesa_memory-0.9.0/mesa_mcp/workspace.py +23 -0
- mesa_memory-0.9.0/mesa_memory/adapter/base.py +49 -0
- mesa_memory-0.9.0/mesa_memory/adapter/claude.py +220 -0
- mesa_memory-0.9.0/mesa_memory/adapter/data/cl100k_base.tiktoken +100256 -0
- mesa_memory-0.9.0/mesa_memory/adapter/endpoints.py +14 -0
- mesa_memory-0.9.0/mesa_memory/adapter/factory.py +288 -0
- mesa_memory-0.9.0/mesa_memory/adapter/live.py +274 -0
- mesa_memory-0.9.0/mesa_memory/adapter/ollama.py +113 -0
- mesa_memory-0.9.0/mesa_memory/adapter/tokenizer.py +98 -0
- mesa_memory-0.9.0/mesa_memory/api/middleware.py +91 -0
- mesa_memory-0.9.0/mesa_memory/api/server.py +926 -0
- mesa_memory-0.9.0/mesa_memory/config.py +993 -0
- mesa_memory-0.9.0/mesa_memory/consolidation/loop.py +1179 -0
- mesa_memory-0.9.0/mesa_memory/consolidation/parser.py +271 -0
- mesa_memory-0.9.0/mesa_memory/consolidation/policy.py +173 -0
- mesa_memory-0.9.0/mesa_memory/consolidation/router.py +392 -0
- mesa_memory-0.9.0/mesa_memory/consolidation/schemas.py +255 -0
- mesa_memory-0.9.0/mesa_memory/consolidation/validator.py +286 -0
- mesa_memory-0.9.0/mesa_memory/container_health.py +25 -0
- mesa_memory-0.9.0/mesa_memory/context_builder.py +693 -0
- mesa_memory-0.9.0/mesa_memory/document_chunking.py +99 -0
- mesa_memory-0.9.0/mesa_memory/embedding/__init__.py +21 -0
- mesa_memory-0.9.0/mesa_memory/embedding/service.py +752 -0
- mesa_memory-0.9.0/mesa_memory/extraction/service.py +614 -0
- mesa_memory-0.9.0/mesa_memory/graph/__init__.py +5 -0
- mesa_memory-0.9.0/mesa_memory/graph/projector.py +43 -0
- mesa_memory-0.9.0/mesa_memory/observability/http.py +122 -0
- mesa_memory-0.9.0/mesa_memory/observability/logger.py +259 -0
- mesa_memory-0.9.0/mesa_memory/observability/metrics.py +252 -0
- mesa_memory-0.9.0/mesa_memory/rebuild_runner.py +505 -0
- mesa_memory-0.9.0/mesa_memory/retrieval/adaptive.py +311 -0
- mesa_memory-0.9.0/mesa_memory/retrieval/core.py +2 -0
- mesa_memory-0.9.0/mesa_memory/retrieval/legal_resolver.py +15 -0
- mesa_memory-0.9.0/mesa_memory/runtime_entrypoint.py +49 -0
- mesa_memory-0.9.0/mesa_memory/security/admin_cli.py +204 -0
- mesa_memory-0.9.0/mesa_memory/security/api_keys.py +267 -0
- mesa_memory-0.9.0/mesa_memory/security/input_validation.py +50 -0
- mesa_memory-0.9.0/mesa_memory/security/rbac.py +787 -0
- mesa_memory-0.9.0/mesa_memory/security/rbac_constants.py +25 -0
- mesa_memory-0.9.0/mesa_memory/security/untrusted_memory.py +45 -0
- mesa_memory-0.9.0/mesa_memory/utils.py +36 -0
- mesa_memory-0.9.0/mesa_memory.egg-info/PKG-INFO +213 -0
- mesa_memory-0.9.0/mesa_memory.egg-info/SOURCES.txt +385 -0
- mesa_memory-0.9.0/mesa_memory.egg-info/dependency_links.txt +1 -0
- mesa_memory-0.9.0/mesa_memory.egg-info/entry_points.txt +8 -0
- mesa_memory-0.9.0/mesa_memory.egg-info/requires.txt +53 -0
- mesa_memory-0.9.0/mesa_memory.egg-info/top_level.txt +6 -0
- mesa_memory-0.9.0/mesa_storage/__init__.py +42 -0
- mesa_memory-0.9.0/mesa_storage/alembic/README +1 -0
- mesa_memory-0.9.0/mesa_storage/alembic/env.py +133 -0
- mesa_memory-0.9.0/mesa_storage/alembic/script.py.mako +28 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/076eef5d1b6c_add_daily_limits.py +34 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/087de6628c51_add_mcp_activity_approval.py +81 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/0a7b8c9d0e1f_scope_catalog_physical_ids.py +42 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/1e7a061f7f9e_add_mcp_clients_and_bindings.py +61 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/41402f316580_add_temporal_validity_to_nodes.py +30 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/4933fb5fd0ea_initial_schema.py +143 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/9a1b2c3d4e5f_add_v4_catalog_provenance.py +367 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/9c6c7ae69ed7_add_mcp_policy_rules.py +41 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/a1d2e3f4b5c6_add_wal_projection_states.py +53 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/a2b3c4d5e6f7_add_declared_content_hash.py +24 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/a94df5d14fce_add_connections_and_settings.py +55 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/b2e3f4a5c6d7_add_session_finalization_journal.py +32 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/b3c4d5e6f7a8_allow_unknown_revision_content_hash.py +29 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/bb2355d0cdd4_add_epistemic_columns.py +38 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/c3d4e5f6a7b8_replace_daily_limit_credential_subject.py +45 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/c4d5e6f7a8b9_add_assertion_fts_and_representation.py +119 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/c4f1a8e2d9b0_add_purge_journal.py +62 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/c5d6e7f8a9b0_add_mcp_operation_ledger.py +58 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/d4e5f6a7b8c9_add_v4_mutation_ledger.py +96 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/d5e6f7a8b9c0_add_typed_legal_identity.py +65 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/d6e7f8a9b0c1_add_mcp_client_credentials.py +35 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/e7f8a9b0c1d2_add_mcp_codex_profiles.py +33 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/e9b7c3a1d4f2_add_claim_leases.py +61 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/f6d4a7b8c9e0_add_dispatch_journal.py +48 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/f7e5b9c0d1a2_add_dispatch_queue_payload_bytes.py +33 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/f8a6c0d1e2b3_add_dispatch_completion_receipts.py +44 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/f8a9b0c1d2e3_generalize_mcp_context_profiles.py +41 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/f9a0b1c2d3e4_enforce_catalog_scope_integrity.py +44 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/fa1b2c3d4e5f_add_mcp_credential_expiry.py +16 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/fb2c3d4e5f6a_add_revision_manifest_hash.py +18 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/fc3d4e5f6a7b_add_durable_projection_operations.py +172 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/fd4e5f6a7b8c_add_embedding_provider_identity.py +20 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/fe5f6a7b8c9d_enforce_active_head_invariant.py +35 -0
- mesa_memory-0.9.0/mesa_storage/alembic/versions/ff6a7b8c9d0e_freeze_revision_manifests.py +29 -0
- mesa_memory-0.9.0/mesa_storage/alembic.ini +148 -0
- mesa_memory-0.9.0/mesa_storage/control/__init__.py +0 -0
- mesa_memory-0.9.0/mesa_storage/control/activity_repo.py +159 -0
- mesa_memory-0.9.0/mesa_storage/control/approval_repo.py +141 -0
- mesa_memory-0.9.0/mesa_storage/control/client_repo.py +175 -0
- mesa_memory-0.9.0/mesa_storage/control/codex_profile_repo.py +105 -0
- mesa_memory-0.9.0/mesa_storage/control/connection_repo.py +118 -0
- mesa_memory-0.9.0/mesa_storage/control/credential_repo.py +196 -0
- mesa_memory-0.9.0/mesa_storage/control/policy_repo.py +81 -0
- mesa_memory-0.9.0/mesa_storage/control/settings_repo.py +56 -0
- mesa_memory-0.9.0/mesa_storage/dao.py +10747 -0
- mesa_memory-0.9.0/mesa_storage/embedding_identity.py +157 -0
- mesa_memory-0.9.0/mesa_storage/kuzu_migration.py +450 -0
- mesa_memory-0.9.0/mesa_storage/kuzu_provider.py +1768 -0
- mesa_memory-0.9.0/mesa_storage/kuzu_schema_migration.py +340 -0
- mesa_memory-0.9.0/mesa_storage/kuzu_setup.py +207 -0
- mesa_memory-0.9.0/mesa_storage/legal_identity.py +473 -0
- mesa_memory-0.9.0/mesa_storage/projection_generations.py +728 -0
- mesa_memory-0.9.0/mesa_storage/rebuild_cutover.py +573 -0
- mesa_memory-0.9.0/mesa_storage/rebuild_health.py +112 -0
- mesa_memory-0.9.0/mesa_storage/rebuild_observability.py +92 -0
- mesa_memory-0.9.0/mesa_storage/rebuild_preparation.py +533 -0
- mesa_memory-0.9.0/mesa_storage/rebuild_replay.py +745 -0
- mesa_memory-0.9.0/mesa_storage/recovery.py +503 -0
- mesa_memory-0.9.0/mesa_storage/repositories/__init__.py +20 -0
- mesa_memory-0.9.0/mesa_storage/repositories/catalog.py +230 -0
- mesa_memory-0.9.0/mesa_storage/repositories/operations.py +690 -0
- mesa_memory-0.9.0/mesa_storage/representation.py +99 -0
- mesa_memory-0.9.0/mesa_storage/retrieval_scope.py +160 -0
- mesa_memory-0.9.0/mesa_storage/schema_contract.py +453 -0
- mesa_memory-0.9.0/mesa_storage/schemas.py +292 -0
- mesa_memory-0.9.0/mesa_storage/sqlite_engine.py +498 -0
- mesa_memory-0.9.0/mesa_storage/vector_engine.py +1697 -0
- mesa_memory-0.9.0/mesa_storage/writer_lock.py +116 -0
- mesa_memory-0.9.0/mesa_workers/__init__.py +6 -0
- mesa_memory-0.9.0/mesa_workers/ingestion_worker.py +465 -0
- mesa_memory-0.9.0/mesa_workers/projection_worker.py +322 -0
- mesa_memory-0.9.0/mesa_workers/supervision.py +124 -0
- mesa_memory-0.9.0/pyproject.toml +289 -0
- mesa_memory-0.9.0/setup.cfg +4 -0
- mesa_memory-0.9.0/tests/test_adapter.py +69 -0
- mesa_memory-0.9.0/tests/test_adapter_factory.py +218 -0
- mesa_memory-0.9.0/tests/test_adapter_live.py +170 -0
- mesa_memory-0.9.0/tests/test_adapters.py +258 -0
- mesa_memory-0.9.0/tests/test_adaptive_router.py +170 -0
- mesa_memory-0.9.0/tests/test_antigravity_bridge_hardening.py +64 -0
- mesa_memory-0.9.0/tests/test_api_control_router_wiring.py +11 -0
- mesa_memory-0.9.0/tests/test_api_key_store.py +59 -0
- mesa_memory-0.9.0/tests/test_api_logging_contract.py +207 -0
- mesa_memory-0.9.0/tests/test_api_schemas.py +43 -0
- mesa_memory-0.9.0/tests/test_async_client_auth_contract.py +50 -0
- mesa_memory-0.9.0/tests/test_async_lock_loop.py +102 -0
- mesa_memory-0.9.0/tests/test_async_storage.py +398 -0
- mesa_memory-0.9.0/tests/test_auth_configuration_contract.py +29 -0
- mesa_memory-0.9.0/tests/test_catalog_repository_contract.py +60 -0
- mesa_memory-0.9.0/tests/test_chaos.py +228 -0
- mesa_memory-0.9.0/tests/test_ci_coverage_contracts.py +441 -0
- mesa_memory-0.9.0/tests/test_claim_recovery.py +49 -0
- mesa_memory-0.9.0/tests/test_client_v4_parity.py +104 -0
- mesa_memory-0.9.0/tests/test_codex_cli.py +95 -0
- mesa_memory-0.9.0/tests/test_codex_control_api.py +136 -0
- mesa_memory-0.9.0/tests/test_codex_gateway_credentials.py +209 -0
- mesa_memory-0.9.0/tests/test_codex_streamable_transport.py +94 -0
- mesa_memory-0.9.0/tests/test_colab_quickstart.py +39 -0
- mesa_memory-0.9.0/tests/test_confidence_revision.py +436 -0
- mesa_memory-0.9.0/tests/test_config.py +73 -0
- mesa_memory-0.9.0/tests/test_config_edge_cases.py +99 -0
- mesa_memory-0.9.0/tests/test_conflict_resolution.py +142 -0
- mesa_memory-0.9.0/tests/test_consolidation.py +128 -0
- mesa_memory-0.9.0/tests/test_control_activity.py +82 -0
- mesa_memory-0.9.0/tests/test_control_activity_approval.py +112 -0
- mesa_memory-0.9.0/tests/test_control_approval.py +146 -0
- mesa_memory-0.9.0/tests/test_control_client_repo.py +111 -0
- mesa_memory-0.9.0/tests/test_control_conn_settings.py +102 -0
- mesa_memory-0.9.0/tests/test_control_middleware.py +66 -0
- mesa_memory-0.9.0/tests/test_control_policy.py +86 -0
- mesa_memory-0.9.0/tests/test_d001_d002_aggregate_state.py +441 -0
- mesa_memory-0.9.0/tests/test_d003_d004_rollback_hash.py +283 -0
- mesa_memory-0.9.0/tests/test_d005_d006_tenant_migration.py +182 -0
- mesa_memory-0.9.0/tests/test_d007_d008_d009_composition_catalog.py +135 -0
- mesa_memory-0.9.0/tests/test_d008_model_enabled_runtime_e2e.py +475 -0
- mesa_memory-0.9.0/tests/test_d010_d011_d012_parity_bounded_hygiene.py +189 -0
- mesa_memory-0.9.0/tests/test_dao.py +365 -0
- mesa_memory-0.9.0/tests/test_dao_coverage.py +517 -0
- mesa_memory-0.9.0/tests/test_dao_extended.py +213 -0
- mesa_memory-0.9.0/tests/test_degraded_sources.py +74 -0
- mesa_memory-0.9.0/tests/test_deployment_assets.py +400 -0
- mesa_memory-0.9.0/tests/test_document_ingestion.py +513 -0
- mesa_memory-0.9.0/tests/test_domain_extraction.py +13 -0
- mesa_memory-0.9.0/tests/test_downstream_fence_reconciliation_contract.py +221 -0
- mesa_memory-0.9.0/tests/test_durable_dlq_contract.py +197 -0
- mesa_memory-0.9.0/tests/test_egress_fence.py +227 -0
- mesa_memory-0.9.0/tests/test_embedding_identity_adoption.py +213 -0
- mesa_memory-0.9.0/tests/test_embedding_restart_migration_lifecycle.py +377 -0
- mesa_memory-0.9.0/tests/test_embedding_service.py +750 -0
- mesa_memory-0.9.0/tests/test_embedding_settings_runtime.py +331 -0
- mesa_memory-0.9.0/tests/test_external_embedding_lifespan_e2e.py +162 -0
- mesa_memory-0.9.0/tests/test_f18_mcp_outputs.py +192 -0
- mesa_memory-0.9.0/tests/test_f21_mcp_recall_gateway.py +213 -0
- mesa_memory-0.9.0/tests/test_fact_extraction_service.py +519 -0
- mesa_memory-0.9.0/tests/test_golden_smoke_set.py +556 -0
- mesa_memory-0.9.0/tests/test_graph_optional_runtime.py +249 -0
- mesa_memory-0.9.0/tests/test_graph_projector.py +331 -0
- mesa_memory-0.9.0/tests/test_graph_text_privacy.py +308 -0
- mesa_memory-0.9.0/tests/test_graph_v2_purge.py +65 -0
- mesa_memory-0.9.0/tests/test_health_check.py +146 -0
- mesa_memory-0.9.0/tests/test_ingestion_worker.py +174 -0
- mesa_memory-0.9.0/tests/test_kuzu_isolation.py +523 -0
- mesa_memory-0.9.0/tests/test_kuzu_migration_coordinator.py +205 -0
- mesa_memory-0.9.0/tests/test_kuzu_performance.py +288 -0
- mesa_memory-0.9.0/tests/test_layer_import_contract.py +21 -0
- mesa_memory-0.9.0/tests/test_legal_audit.py +75 -0
- mesa_memory-0.9.0/tests/test_local_test_contract.py +26 -0
- mesa_memory-0.9.0/tests/test_logging_contract.py +186 -0
- mesa_memory-0.9.0/tests/test_mcp_api_boundary.py +157 -0
- mesa_memory-0.9.0/tests/test_mcp_gateway_operations.py +246 -0
- mesa_memory-0.9.0/tests/test_mcp_legacy_gateway_reachability.py +24 -0
- mesa_memory-0.9.0/tests/test_mcp_operation_finality.py +135 -0
- mesa_memory-0.9.0/tests/test_mcp_provenance.py +43 -0
- mesa_memory-0.9.0/tests/test_mcp_sdk_lifecycle.py +118 -0
- mesa_memory-0.9.0/tests/test_mcp_stdio_direct.py +131 -0
- mesa_memory-0.9.0/tests/test_mcp_v4_service.py +390 -0
- mesa_memory-0.9.0/tests/test_mcp_v4_tools.py +75 -0
- mesa_memory-0.9.0/tests/test_mesa_benchmark_enhancements.py +48 -0
- mesa_memory-0.9.0/tests/test_metrics.py +24 -0
- mesa_memory-0.9.0/tests/test_migration_closure.py +771 -0
- mesa_memory-0.9.0/tests/test_model_optional_runtime.py +866 -0
- mesa_memory-0.9.0/tests/test_mvp_core_smoke_flow.py +468 -0
- mesa_memory-0.9.0/tests/test_ollama_adapter.py +175 -0
- mesa_memory-0.9.0/tests/test_operation_repository_contract.py +372 -0
- mesa_memory-0.9.0/tests/test_operator_approval.py +221 -0
- mesa_memory-0.9.0/tests/test_operator_approval_lifecycle.py +285 -0
- mesa_memory-0.9.0/tests/test_optional_adapter_imports.py +135 -0
- mesa_memory-0.9.0/tests/test_p0_canonical_correction.py +496 -0
- mesa_memory-0.9.0/tests/test_p0_config_bootstrap.py +71 -0
- mesa_memory-0.9.0/tests/test_p0_context_builder.py +148 -0
- mesa_memory-0.9.0/tests/test_p0_cross_agent_vector_ownership.py +47 -0
- mesa_memory-0.9.0/tests/test_p0_embedding_contract.py +128 -0
- mesa_memory-0.9.0/tests/test_p0_experimental_isolation.py +8 -0
- mesa_memory-0.9.0/tests/test_p0_http_sdk_mcp_convergence.py +317 -0
- mesa_memory-0.9.0/tests/test_p0_model_disabled_truth.py +121 -0
- mesa_memory-0.9.0/tests/test_p0_multi_memory_extraction.py +159 -0
- mesa_memory-0.9.0/tests/test_p0_mutation_state_machine.py +130 -0
- mesa_memory-0.9.0/tests/test_p0_projection_fencing.py +693 -0
- mesa_memory-0.9.0/tests/test_p0_purge_fencing.py +200 -0
- mesa_memory-0.9.0/tests/test_p0_ram_oom_safety.py +23 -0
- mesa_memory-0.9.0/tests/test_p0_retrieval_count_safety.py +97 -0
- mesa_memory-0.9.0/tests/test_p0_retrieval_eligibility.py +165 -0
- mesa_memory-0.9.0/tests/test_p0_shared_write_admission.py +148 -0
- mesa_memory-0.9.0/tests/test_p0_tenant_accounting.py +112 -0
- mesa_memory-0.9.0/tests/test_p0_token_aware_batching.py +43 -0
- mesa_memory-0.9.0/tests/test_p0_worker_ownership.py +99 -0
- mesa_memory-0.9.0/tests/test_p0_write_hazards.py +54 -0
- mesa_memory-0.9.0/tests/test_p0a_batch.py +302 -0
- mesa_memory-0.9.0/tests/test_p0b_missing.py +231 -0
- mesa_memory-0.9.0/tests/test_p0c_loop.py +79 -0
- mesa_memory-0.9.0/tests/test_p402_mesa_sdk.py +277 -0
- mesa_memory-0.9.0/tests/test_p403_local_cli.py +343 -0
- mesa_memory-0.9.0/tests/test_p4_01_recommended_system_prompt.py +37 -0
- mesa_memory-0.9.0/tests/test_pre_final_repair_contracts.py +59 -0
- mesa_memory-0.9.0/tests/test_profile_b_compose_env_parity.py +175 -0
- mesa_memory-0.9.0/tests/test_projection_generation_contract.py +483 -0
- mesa_memory-0.9.0/tests/test_purge_journal_contract.py +302 -0
- mesa_memory-0.9.0/tests/test_pytest_exit_contract.py +30 -0
- mesa_memory-0.9.0/tests/test_queue_admission_contract.py +279 -0
- mesa_memory-0.9.0/tests/test_queue_trusted_root_contract.py +24 -0
- mesa_memory-0.9.0/tests/test_r4_durable_policy_snapshot.py +365 -0
- mesa_memory-0.9.0/tests/test_r4_extraction_validation_independence.py +401 -0
- mesa_memory-0.9.0/tests/test_r4_validation_e2e.py +354 -0
- mesa_memory-0.9.0/tests/test_r4_validation_mode_contract.py +139 -0
- mesa_memory-0.9.0/tests/test_r4_validation_policy.py +266 -0
- mesa_memory-0.9.0/tests/test_r4_validation_state_machine.py +213 -0
- mesa_memory-0.9.0/tests/test_r6_context_security_correctness.py +1078 -0
- mesa_memory-0.9.0/tests/test_r6_rbac_tenant_isolation.py +826 -0
- mesa_memory-0.9.0/tests/test_r7_lifecycle_catalog_correctness.py +1104 -0
- mesa_memory-0.9.0/tests/test_r8_integrated_recovery_durability.py +250 -0
- mesa_memory-0.9.0/tests/test_rate_limit_subject_contract.py +126 -0
- mesa_memory-0.9.0/tests/test_rbac.py +134 -0
- mesa_memory-0.9.0/tests/test_rbac_edge_cases.py +231 -0
- mesa_memory-0.9.0/tests/test_rbac_leak.py +174 -0
- mesa_memory-0.9.0/tests/test_rebuild_observability_contract.py +241 -0
- mesa_memory-0.9.0/tests/test_rebuild_preparation_contract.py +333 -0
- mesa_memory-0.9.0/tests/test_rebuild_provider_rehearsal.py +354 -0
- mesa_memory-0.9.0/tests/test_rebuild_replay_contract.py +1136 -0
- mesa_memory-0.9.0/tests/test_rebuild_runner_contract.py +414 -0
- mesa_memory-0.9.0/tests/test_recovery_contract.py +401 -0
- mesa_memory-0.9.0/tests/test_release_preflight.py +87 -0
- mesa_memory-0.9.0/tests/test_retrieval.py +6 -0
- mesa_memory-0.9.0/tests/test_retrieval_scope_contract.py +200 -0
- mesa_memory-0.9.0/tests/test_runtime_lifecycle_cleanup.py +93 -0
- mesa_memory-0.9.0/tests/test_runtime_profiles_contract.py +196 -0
- mesa_memory-0.9.0/tests/test_sdk_retry_contract.py +228 -0
- mesa_memory-0.9.0/tests/test_single_writer_contract.py +81 -0
- mesa_memory-0.9.0/tests/test_soak_profile_a.py +698 -0
- mesa_memory-0.9.0/tests/test_sol_r7_adversarial_certification.py +911 -0
- mesa_memory-0.9.0/tests/test_sol_r7_unknown_revision_hash.py +53 -0
- mesa_memory-0.9.0/tests/test_sqlite_engine_coverage.py +380 -0
- mesa_memory-0.9.0/tests/test_storage_unification.py +279 -0
- mesa_memory-0.9.0/tests/test_terra_round3_regressions.py +132 -0
- mesa_memory-0.9.0/tests/test_tier3_adapter_contract.py +36 -0
- mesa_memory-0.9.0/tests/test_tier3_provenance_policy.py +48 -0
- mesa_memory-0.9.0/tests/test_tier3_resilience.py +277 -0
- mesa_memory-0.9.0/tests/test_tier3_validator.py +653 -0
- mesa_memory-0.9.0/tests/test_triple_store_mutation_contract.py +208 -0
- mesa_memory-0.9.0/tests/test_typing_ratchet.py +61 -0
- mesa_memory-0.9.0/tests/test_untrusted_memory_rendering_paths.py +190 -0
- mesa_memory-0.9.0/tests/test_v3_orphan_reconciliation_boundaries.py +161 -0
- mesa_memory-0.9.0/tests/test_v4_admin_cli.py +95 -0
- mesa_memory-0.9.0/tests/test_v4_adversarial_self_audit.py +876 -0
- mesa_memory-0.9.0/tests/test_v4_api_contract.py +1414 -0
- mesa_memory-0.9.0/tests/test_v4_bm25_scope_isolation.py +208 -0
- mesa_memory-0.9.0/tests/test_v4_bounded_query_planner.py +818 -0
- mesa_memory-0.9.0/tests/test_v4_bounded_query_planner_surface.py +261 -0
- mesa_memory-0.9.0/tests/test_v4_catalog_ownership.py +655 -0
- mesa_memory-0.9.0/tests/test_v4_certification_contracts.py +372 -0
- mesa_memory-0.9.0/tests/test_v4_closure_evidence.py +158 -0
- mesa_memory-0.9.0/tests/test_v4_comprehensive_audit_hardening.py +427 -0
- mesa_memory-0.9.0/tests/test_v4_context_atomic_proof_budget.py +515 -0
- mesa_memory-0.9.0/tests/test_v4_context_jurisdiction_boundary.py +173 -0
- mesa_memory-0.9.0/tests/test_v4_dispatch_completion_contract.py +184 -0
- mesa_memory-0.9.0/tests/test_v4_document_privacy_runtime.py +474 -0
- mesa_memory-0.9.0/tests/test_v4_durable_dispatch_contract.py +101 -0
- mesa_memory-0.9.0/tests/test_v4_evidence_context_hardening.py +420 -0
- mesa_memory-0.9.0/tests/test_v4_final_extraction_legal_audit.py +184 -0
- mesa_memory-0.9.0/tests/test_v4_final_legal_audit.py +31 -0
- mesa_memory-0.9.0/tests/test_v4_graph_retrieval_hardening.py +1211 -0
- mesa_memory-0.9.0/tests/test_v4_graph_timeout_runtime.py +531 -0
- mesa_memory-0.9.0/tests/test_v4_hardening_final_verification.py +486 -0
- mesa_memory-0.9.0/tests/test_v4_independent_retrieval_audit.py +431 -0
- mesa_memory-0.9.0/tests/test_v4_ingestion_contract.py +831 -0
- mesa_memory-0.9.0/tests/test_v4_kuzu_runtime_closure.py +258 -0
- mesa_memory-0.9.0/tests/test_v4_mutation_agent_isolation.py +39 -0
- mesa_memory-0.9.0/tests/test_v4_principal_authorization.py +144 -0
- mesa_memory-0.9.0/tests/test_v4_projection_integration.py +284 -0
- mesa_memory-0.9.0/tests/test_v4_rebuild_runbook_contract.py +49 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase1.py +286 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase10.py +506 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase2.py +368 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase3.py +345 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase4.py +433 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase5.py +433 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase6.py +434 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase7.py +734 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase8.py +378 -0
- mesa_memory-0.9.0/tests/test_v4_retrieval_hardening_phase9.py +741 -0
- mesa_memory-0.9.0/tests/test_v4_retry_lifecycle.py +509 -0
- mesa_memory-0.9.0/tests/test_v4_round2_holdout.py +232 -0
- mesa_memory-0.9.0/tests/test_v4_round2_legal_identity.py +410 -0
- mesa_memory-0.9.0/tests/test_v4_rrf_ablation.py +32 -0
- mesa_memory-0.9.0/tests/test_v4_sdk_contract.py +211 -0
- mesa_memory-0.9.0/tests/test_v4_session_finalization_contract.py +111 -0
- mesa_memory-0.9.0/tests/test_v4_session_principal_route_isolation.py +231 -0
- mesa_memory-0.9.0/tests/test_v4_temporal_request_schema.py +704 -0
- mesa_memory-0.9.0/tests/test_v4_vector_consumer_contract.py +441 -0
- mesa_memory-0.9.0/tests/test_vector_engine.py +382 -0
- mesa_memory-0.9.0/tests/test_vector_engine_coverage.py +484 -0
- mesa_memory-0.9.0/tests/test_vector_failure_semantics.py +148 -0
- mesa_memory-0.9.0/tests/test_vector_maintenance.py +251 -0
- mesa_memory-0.9.0/tests/test_vector_migration_contract.py +49 -0
- mesa_memory-0.9.0/tests/test_vector_model_isolation.py +61 -0
- mesa_memory-0.9.0/tests/test_wal_claim_replay_contract.py +123 -0
- mesa_memory-0.9.0/tests/test_wal_recovery.py +65 -0
- mesa_memory-0.9.0/tests/test_worker_logging_contract.py +74 -0
- mesa_memory-0.9.0/tests/test_worker_supervision_contract.py +117 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MESA Core Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
include mesa_storage/alembic.ini
|
|
2
|
+
recursive-include mesa_storage/alembic *
|
|
3
|
+
include mesa_memory/adapter/data/cl100k_base.tiktoken
|
|
4
|
+
global-exclude *.py[cod]
|
|
5
|
+
global-exclude __pycache__
|
|
6
|
+
prune mesa_storage/alembic/__pycache__
|
|
7
|
+
prune mesa_storage/alembic/versions/__pycache__
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mesa-memory
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: Enterprise AI agent memory engine
|
|
5
|
+
Author: MESA Core Team
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 MESA Core Team
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/Yasou13/MESA
|
|
29
|
+
Project-URL: Repository, https://github.com/Yasou13/MESA
|
|
30
|
+
Project-URL: Documentation, https://github.com/Yasou13/MESA/tree/main/docs
|
|
31
|
+
Project-URL: Changelog, https://github.com/Yasou13/MESA/blob/main/CHANGELOG.md
|
|
32
|
+
Project-URL: Issues, https://github.com/Yasou13/MESA/issues
|
|
33
|
+
Keywords: ai,memory,agents,knowledge-graph,llm,cognitive
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
37
|
+
Requires-Python: >=3.11
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Requires-Dist: aiosqlite>=0.22.0
|
|
41
|
+
Requires-Dist: anyio>=4.0.0
|
|
42
|
+
Requires-Dist: httpx>=0.28.0
|
|
43
|
+
Requires-Dist: mcp<2.0.0,>=1.30.0
|
|
44
|
+
Requires-Dist: cryptography>=42.0.0
|
|
45
|
+
Requires-Dist: uvicorn>=0.29.0
|
|
46
|
+
Requires-Dist: fastapi>=0.139.0
|
|
47
|
+
Requires-Dist: starlette>=1.3.1
|
|
48
|
+
Requires-Dist: slowapi>=0.1.9
|
|
49
|
+
Requires-Dist: prometheus_client>=0.20.0
|
|
50
|
+
Requires-Dist: pydantic>=2.13.0
|
|
51
|
+
Requires-Dist: pydantic-settings>=2.14.0
|
|
52
|
+
Requires-Dist: lancedb>=0.30.0
|
|
53
|
+
Requires-Dist: pyarrow>=24.0.0
|
|
54
|
+
Requires-Dist: kuzu>=0.0.11
|
|
55
|
+
Requires-Dist: numpy>=2.2.0
|
|
56
|
+
Requires-Dist: tenacity>=9.0.0
|
|
57
|
+
Requires-Dist: psutil>=7.0.0
|
|
58
|
+
Requires-Dist: structlog>=24.0.0
|
|
59
|
+
Requires-Dist: python-dotenv>=1.2.0
|
|
60
|
+
Requires-Dist: tiktoken>=0.12.0
|
|
61
|
+
Requires-Dist: alembic>=1.13.0
|
|
62
|
+
Requires-Dist: sqlalchemy>=2.0.51
|
|
63
|
+
Requires-Dist: typing_extensions>=4.16.0
|
|
64
|
+
Provides-Extra: adapters
|
|
65
|
+
Requires-Dist: anthropic>=0.100.0; extra == "adapters"
|
|
66
|
+
Requires-Dist: openai>=2.36.0; extra == "adapters"
|
|
67
|
+
Requires-Dist: ollama>=0.6.1; extra == "adapters"
|
|
68
|
+
Provides-Extra: ml
|
|
69
|
+
Requires-Dist: torch>=2.11.0; extra == "ml"
|
|
70
|
+
Requires-Dist: transformers>=5.8.0; extra == "ml"
|
|
71
|
+
Requires-Dist: tokenizers>=0.22.0; extra == "ml"
|
|
72
|
+
Requires-Dist: safetensors>=0.7.0; extra == "ml"
|
|
73
|
+
Requires-Dist: huggingface_hub>=1.14.0; extra == "ml"
|
|
74
|
+
Requires-Dist: sentence-transformers>=3.0.0; extra == "ml"
|
|
75
|
+
Provides-Extra: loadtest
|
|
76
|
+
Requires-Dist: aiohttp>=3.14.3; extra == "loadtest"
|
|
77
|
+
Requires-Dist: locust>=2.29.0; extra == "loadtest"
|
|
78
|
+
Provides-Extra: dev
|
|
79
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
80
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
81
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
82
|
+
Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
|
|
83
|
+
Requires-Dist: cyclonedx-bom>=5.1.0; extra == "dev"
|
|
84
|
+
Requires-Dist: mypy>=1.10.0; extra == "dev"
|
|
85
|
+
Requires-Dist: black>=24.0.0; extra == "dev"
|
|
86
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
87
|
+
Requires-Dist: datasets>=2.14.0; extra == "dev"
|
|
88
|
+
Requires-Dist: PyYAML>=6.0.0; extra == "dev"
|
|
89
|
+
Dynamic: license-file
|
|
90
|
+
|
|
91
|
+
# MESA — Memory Engine for Structured Agents
|
|
92
|
+
|
|
93
|
+
[](https://github.com/Yasou13/MESA/actions/workflows/ci.yml?query=branch%3Amain)
|
|
94
|
+
[](https://github.com/Yasou13/MESA/releases/latest)
|
|
95
|
+
[](https://github.com/Yasou13/MESA/blob/main/LICENSE)
|
|
96
|
+
[](https://github.com/Yasou13/MESA/blob/main/pyproject.toml)
|
|
97
|
+
|
|
98
|
+
MESA is an LLM-independent, source-linked memory engine for AI applications. It stores documents with exact provenance (document, revision, passage) and returns verifiable, scoped evidence over HTTP, Python SDK, and MCP. MESA returns evidence; it never writes the final answer or hallucinates sources.
|
|
99
|
+
|
|
100
|
+
Package version: **0.9.0**. V4 is the current API. Production qualification remains at the release candidate stage: **NO-GO** until the [release gates](https://github.com/Yasou13/MESA/blob/main/docs/release.md) pass.
|
|
101
|
+
|
|
102
|
+
## Installation
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install "mesa-memory[adapters]"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Supported on Linux and macOS natively. On Windows, run via Docker or WSL.
|
|
109
|
+
|
|
110
|
+
## Start the server
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
mesa start
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Starts the local server on `http://127.0.0.1:8000`, initializes storage at `~/.mesa/data`, and creates credentials at `~/.mesa/credentials.json` (mode 0600).
|
|
117
|
+
|
|
118
|
+
## Add and search documents
|
|
119
|
+
|
|
120
|
+
In another terminal, add and search documents immediately:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
mesa add document.txt --source file://document.txt
|
|
124
|
+
mesa search "your query"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Python SDK
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from mesa_client import Mesa
|
|
131
|
+
|
|
132
|
+
mesa = Mesa()
|
|
133
|
+
mesa.add(open("document.txt").read(), source="file://document.txt")
|
|
134
|
+
print(mesa.context("your query"))
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`Mesa()` uses `MESA_API_KEY` and `MESA_BASE_URL` when they are set, otherwise the local credentials in `~/.mesa/credentials.json`.
|
|
138
|
+
|
|
139
|
+
## Connect MCP clients
|
|
140
|
+
|
|
141
|
+
Generate a ready-to-paste configuration block for Claude Desktop or any MCP client:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
mesa mcp-config
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Internal models (optional)
|
|
148
|
+
|
|
149
|
+
Models stay off by default. Documents are stored and found through BM25 lexical search without any model running. `FactExtractionService` owns canonical V4 extraction when models are enabled.
|
|
150
|
+
|
|
151
|
+
To enable semantic vector search and fact extraction with local Ollama, add to `~/.mesa/.env`:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
MESA_MODEL_ENABLED=true
|
|
155
|
+
MESA_LLM_MODEL=ollama:qwen2.5:7b
|
|
156
|
+
MESA_EMBEDDING_MODEL=ollama:bge-m3
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Local `openai_compatible` servers (such as vLLM started with `--port 8001`, at `MESA_LLM_BASE_URL=http://127.0.0.1:8001/v1`; MESA itself uses port 8000) are also allowed with `MESA_EXTERNAL_PROVIDER_ENABLED=false` on a local endpoint (`localhost`, `127.0.0.1`, `::1`, `host.docker.internal`) and require no API key (D31). For cloud model providers (OpenAI, Anthropic), set `MESA_EXTERNAL_PROVIDER_ENABLED=true` and provide the required API keys.
|
|
160
|
+
|
|
161
|
+
## Graph toggle
|
|
162
|
+
|
|
163
|
+
To run without the Kùzu graph database, set:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
MESA_GRAPH_ENABLED=false
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
GRAPH lanes end `SKIPPED`, and turning the flag back on later backfills the graph at startup.
|
|
170
|
+
|
|
171
|
+
## Docker
|
|
172
|
+
|
|
173
|
+
Run MESA in a single-user local container (D32):
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
docker compose -f docker-compose.v4.yml up --build -d
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Credentials are written to `/var/lib/mesa/credentials.json` in the container volume:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
docker compose -f docker-compose.v4.yml exec mesa-v4 cat /var/lib/mesa/credentials.json
|
|
183
|
+
docker compose -f docker-compose.v4.yml exec -T mesa-v4 mesa add - --source file://document.txt < document.txt
|
|
184
|
+
docker compose -f docker-compose.v4.yml exec mesa-v4 mesa search "your query"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
No variables are required; models and external providers default off. If you set `MESA_API_KEY` and `MESA_PRINCIPAL_ID` for existing HTTP clients, the server accepts that key too, and the `mesa` commands inside the container use it first; add `-e MESA_API_KEY=` after `exec` to use the local credentials instead. The image includes `adapters`; build with `--build-arg MESA_EXTRAS=ml,adapters` to add local sentence-transformers. Ollama defaults to `http://host.docker.internal:11434` (the Docker host).
|
|
188
|
+
|
|
189
|
+
## Google Colab
|
|
190
|
+
|
|
191
|
+
Run MESA with GPU-accelerated Ollama in Colab:
|
|
192
|
+
[Colab Quickstart](https://github.com/Yasou13/MESA/blob/main/examples/colab_quickstart.ipynb)
|
|
193
|
+
|
|
194
|
+
## Development
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
uv sync --locked --python 3.11
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
See [testing](https://github.com/Yasou13/MESA/blob/main/docs/testing.md) for local tests, and [docs/testing.md](https://github.com/Yasou13/MESA/blob/main/docs/testing.md) for test markers.
|
|
201
|
+
|
|
202
|
+
## Documentation
|
|
203
|
+
|
|
204
|
+
- [Getting Started Guide](https://github.com/Yasou13/MESA/blob/main/docs/getting-started.md)
|
|
205
|
+
- [Configuration Reference](https://github.com/Yasou13/MESA/blob/main/docs/configuration.md)
|
|
206
|
+
- [API Reference](https://github.com/Yasou13/MESA/blob/main/docs/api-reference.md)
|
|
207
|
+
- [MCP Integration Guide](https://github.com/Yasou13/MESA/blob/main/README_MCP.md)
|
|
208
|
+
- [Architecture](https://github.com/Yasou13/MESA/blob/main/ARCHITECTURE.md)
|
|
209
|
+
- [Documentation Index](https://github.com/Yasou13/MESA/blob/main/docs/README.md)
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
[MIT](https://github.com/Yasou13/MESA/blob/main/LICENSE).
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# MESA — Memory Engine for Structured Agents
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Yasou13/MESA/actions/workflows/ci.yml?query=branch%3Amain)
|
|
4
|
+
[](https://github.com/Yasou13/MESA/releases/latest)
|
|
5
|
+
[](https://github.com/Yasou13/MESA/blob/main/LICENSE)
|
|
6
|
+
[](https://github.com/Yasou13/MESA/blob/main/pyproject.toml)
|
|
7
|
+
|
|
8
|
+
MESA is an LLM-independent, source-linked memory engine for AI applications. It stores documents with exact provenance (document, revision, passage) and returns verifiable, scoped evidence over HTTP, Python SDK, and MCP. MESA returns evidence; it never writes the final answer or hallucinates sources.
|
|
9
|
+
|
|
10
|
+
Package version: **0.9.0**. V4 is the current API. Production qualification remains at the release candidate stage: **NO-GO** until the [release gates](https://github.com/Yasou13/MESA/blob/main/docs/release.md) pass.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install "mesa-memory[adapters]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Supported on Linux and macOS natively. On Windows, run via Docker or WSL.
|
|
19
|
+
|
|
20
|
+
## Start the server
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
mesa start
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Starts the local server on `http://127.0.0.1:8000`, initializes storage at `~/.mesa/data`, and creates credentials at `~/.mesa/credentials.json` (mode 0600).
|
|
27
|
+
|
|
28
|
+
## Add and search documents
|
|
29
|
+
|
|
30
|
+
In another terminal, add and search documents immediately:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
mesa add document.txt --source file://document.txt
|
|
34
|
+
mesa search "your query"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Python SDK
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from mesa_client import Mesa
|
|
41
|
+
|
|
42
|
+
mesa = Mesa()
|
|
43
|
+
mesa.add(open("document.txt").read(), source="file://document.txt")
|
|
44
|
+
print(mesa.context("your query"))
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`Mesa()` uses `MESA_API_KEY` and `MESA_BASE_URL` when they are set, otherwise the local credentials in `~/.mesa/credentials.json`.
|
|
48
|
+
|
|
49
|
+
## Connect MCP clients
|
|
50
|
+
|
|
51
|
+
Generate a ready-to-paste configuration block for Claude Desktop or any MCP client:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
mesa mcp-config
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Internal models (optional)
|
|
58
|
+
|
|
59
|
+
Models stay off by default. Documents are stored and found through BM25 lexical search without any model running. `FactExtractionService` owns canonical V4 extraction when models are enabled.
|
|
60
|
+
|
|
61
|
+
To enable semantic vector search and fact extraction with local Ollama, add to `~/.mesa/.env`:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
MESA_MODEL_ENABLED=true
|
|
65
|
+
MESA_LLM_MODEL=ollama:qwen2.5:7b
|
|
66
|
+
MESA_EMBEDDING_MODEL=ollama:bge-m3
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Local `openai_compatible` servers (such as vLLM started with `--port 8001`, at `MESA_LLM_BASE_URL=http://127.0.0.1:8001/v1`; MESA itself uses port 8000) are also allowed with `MESA_EXTERNAL_PROVIDER_ENABLED=false` on a local endpoint (`localhost`, `127.0.0.1`, `::1`, `host.docker.internal`) and require no API key (D31). For cloud model providers (OpenAI, Anthropic), set `MESA_EXTERNAL_PROVIDER_ENABLED=true` and provide the required API keys.
|
|
70
|
+
|
|
71
|
+
## Graph toggle
|
|
72
|
+
|
|
73
|
+
To run without the Kùzu graph database, set:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
MESA_GRAPH_ENABLED=false
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
GRAPH lanes end `SKIPPED`, and turning the flag back on later backfills the graph at startup.
|
|
80
|
+
|
|
81
|
+
## Docker
|
|
82
|
+
|
|
83
|
+
Run MESA in a single-user local container (D32):
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
docker compose -f docker-compose.v4.yml up --build -d
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Credentials are written to `/var/lib/mesa/credentials.json` in the container volume:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
docker compose -f docker-compose.v4.yml exec mesa-v4 cat /var/lib/mesa/credentials.json
|
|
93
|
+
docker compose -f docker-compose.v4.yml exec -T mesa-v4 mesa add - --source file://document.txt < document.txt
|
|
94
|
+
docker compose -f docker-compose.v4.yml exec mesa-v4 mesa search "your query"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
No variables are required; models and external providers default off. If you set `MESA_API_KEY` and `MESA_PRINCIPAL_ID` for existing HTTP clients, the server accepts that key too, and the `mesa` commands inside the container use it first; add `-e MESA_API_KEY=` after `exec` to use the local credentials instead. The image includes `adapters`; build with `--build-arg MESA_EXTRAS=ml,adapters` to add local sentence-transformers. Ollama defaults to `http://host.docker.internal:11434` (the Docker host).
|
|
98
|
+
|
|
99
|
+
## Google Colab
|
|
100
|
+
|
|
101
|
+
Run MESA with GPU-accelerated Ollama in Colab:
|
|
102
|
+
[Colab Quickstart](https://github.com/Yasou13/MESA/blob/main/examples/colab_quickstart.ipynb)
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
uv sync --locked --python 3.11
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See [testing](https://github.com/Yasou13/MESA/blob/main/docs/testing.md) for local tests, and [docs/testing.md](https://github.com/Yasou13/MESA/blob/main/docs/testing.md) for test markers.
|
|
111
|
+
|
|
112
|
+
## Documentation
|
|
113
|
+
|
|
114
|
+
- [Getting Started Guide](https://github.com/Yasou13/MESA/blob/main/docs/getting-started.md)
|
|
115
|
+
- [Configuration Reference](https://github.com/Yasou13/MESA/blob/main/docs/configuration.md)
|
|
116
|
+
- [API Reference](https://github.com/Yasou13/MESA/blob/main/docs/api-reference.md)
|
|
117
|
+
- [MCP Integration Guide](https://github.com/Yasou13/MESA/blob/main/README_MCP.md)
|
|
118
|
+
- [Architecture](https://github.com/Yasou13/MESA/blob/main/ARCHITECTURE.md)
|
|
119
|
+
- [Documentation Index](https://github.com/Yasou13/MESA/blob/main/docs/README.md)
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
[MIT](https://github.com/Yasou13/MESA/blob/main/LICENSE).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""Versioned MESA HTTP contracts.
|
|
2
|
+
|
|
3
|
+
``mesa_api.v4_router`` exposes the breaking full-cognitive catalog, immutable
|
|
4
|
+
session, mutation, provenance, search, replay and rollback contract.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .v4_router import create_v4_router
|
|
8
|
+
|
|
9
|
+
__all__ = ["create_v4_router"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Shared API admission policy for storage-root mutations."""
|
|
2
|
+
|
|
3
|
+
from fastapi import HTTPException
|
|
4
|
+
|
|
5
|
+
from mesa_storage.dao import MemoryDAO
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
async def require_mutation_admission(
|
|
9
|
+
dao: MemoryDAO, *, require_projection_consumer: bool = False
|
|
10
|
+
) -> None:
|
|
11
|
+
"""Fail closed while a durable projection rebuild owns the storage root."""
|
|
12
|
+
if require_projection_consumer and dao.canonical_v4_writes_enabled is False:
|
|
13
|
+
raise HTTPException(
|
|
14
|
+
status_code=503,
|
|
15
|
+
detail="canonical_processing_unavailable",
|
|
16
|
+
headers={"Retry-After": "5"},
|
|
17
|
+
)
|
|
18
|
+
if await dao.rebuild_admission.is_pending():
|
|
19
|
+
raise HTTPException(
|
|
20
|
+
status_code=503,
|
|
21
|
+
detail="maintenance_pending",
|
|
22
|
+
headers={"Retry-After": "5"},
|
|
23
|
+
)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Shared public identifier constraints for versioned API boundaries."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from typing import Annotated
|
|
7
|
+
|
|
8
|
+
from pydantic import AfterValidator, Field
|
|
9
|
+
|
|
10
|
+
_RESERVED_SENTINELS = frozenset({"__unset__", "__system__", ""})
|
|
11
|
+
_ALLOWED_IDENTIFIER_PATTERN = re.compile(r"^[a-zA-Z0-9._-]+$")
|
|
12
|
+
_CONTROL_CHAR_PATTERN = re.compile(r"[\x00-\x1f\x7f]")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def validate_public_identifier(
|
|
16
|
+
value: str,
|
|
17
|
+
field_name: str = "identifier",
|
|
18
|
+
*,
|
|
19
|
+
max_length: int = 128,
|
|
20
|
+
restricted_charset: bool = True,
|
|
21
|
+
) -> str:
|
|
22
|
+
"""Validate one caller-controlled public identifier.
|
|
23
|
+
|
|
24
|
+
The 128-character form covers tenant, workspace, dataset, agent, session,
|
|
25
|
+
mutation, and operation identifiers. Source-owned document, revision, and
|
|
26
|
+
chunk identifiers retain their established 256-character boundary.
|
|
27
|
+
"""
|
|
28
|
+
if _CONTROL_CHAR_PATTERN.search(value):
|
|
29
|
+
raise ValueError(
|
|
30
|
+
f"{field_name} contains illegal control characters. "
|
|
31
|
+
"Only printable ASCII characters are allowed."
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
stripped = value.strip()
|
|
35
|
+
if stripped in _RESERVED_SENTINELS:
|
|
36
|
+
raise ValueError(f"{field_name} cannot be empty or a reserved value")
|
|
37
|
+
if len(stripped) > max_length:
|
|
38
|
+
raise ValueError(f"{field_name} must be between 1 and {max_length} characters")
|
|
39
|
+
if restricted_charset and not _ALLOWED_IDENTIFIER_PATTERN.fullmatch(stripped):
|
|
40
|
+
raise ValueError(
|
|
41
|
+
f"{field_name} may contain only alphanumeric characters, hyphens, "
|
|
42
|
+
"underscores, or dots"
|
|
43
|
+
)
|
|
44
|
+
return stripped
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _validate_standard_identifier(value: str) -> str:
|
|
48
|
+
return validate_public_identifier(value)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _validate_source_identifier(value: str) -> str:
|
|
52
|
+
# Document/revision/chunk aliases historically permit external naming
|
|
53
|
+
# punctuation. Preserve that compatibility while enforcing the shared
|
|
54
|
+
# control-character, sentinel, and size boundaries.
|
|
55
|
+
return validate_public_identifier(value, max_length=256, restricted_charset=False)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
PublicIdentifier = Annotated[
|
|
59
|
+
str,
|
|
60
|
+
Field(min_length=1, max_length=128),
|
|
61
|
+
AfterValidator(_validate_standard_identifier),
|
|
62
|
+
]
|
|
63
|
+
SourceIdentifier = Annotated[
|
|
64
|
+
str,
|
|
65
|
+
Field(min_length=1, max_length=256),
|
|
66
|
+
AfterValidator(_validate_source_identifier),
|
|
67
|
+
]
|