Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 2.14 KB

File metadata and controls

65 lines (49 loc) · 2.14 KB

Portable Memory Experiment - Claude Instructions

Quick Reference

make sync             # Install dependencies
make test             # Run all tests (130 tests)
make dev              # Start LangGraph Studio (both agents)
make demo-alice       # Run Alice story demo
make demo-correction  # Run correction flow demo
make demo-all         # Run all demos

AWS/Docker Commands

make dynamodb-start          # Start DynamoDB Local
make dynamodb-create-tables  # Create tables in DynamoDB Local
make docker-build            # Build container image
make api                     # Run FastAPI demo server (port 8001)
./scripts/deploy-infrastructure.sh dev  # Deploy CloudFormation

Environment Variables

  • MODEL_PROVIDER: openai (default) or bedrock
  • STORAGE_BACKEND: memory (default) or dynamodb
  • DYNAMODB_ENDPOINT: For DynamoDB Local (e.g., http://localhost:8000)

Key Files

  • memory/service.py - Central PortableMemoryService (main entry point)
  • memory/scopes.py - Multi-dimensional scope definitions
  • memory/grants.py - Access grant management
  • memory/persistence/ - Storage backends (in-memory, DynamoDB)
  • graph/server.py - Exports math_tutor and writing_coach graphs
  • graph/models.py - Model provider factory (OpenAI/Bedrock)
  • api/main.py - FastAPI demo endpoints
  • infrastructure/cloudformation.yaml - AWS resources

Architecture

This implements the Pre-read Section 2.3 five-component architecture:

  1. Memory Store (schema.py)
  2. Policy/AuthZ (grants.py, scopes.py)
  3. Context Router (service.py scope filtering)
  4. Audit Log (audit.py)
  5. Interoperability (formats/clr.py, formats/caliper.py)

Extensibility Seams

Seams 1-7 are design-only placeholders in:

  • memory/security.py - Seam 6 (adversarial robustness)
  • memory/conflicts.py - Seam 7 (conflict resolution)
  • memory/grants.py - Seams 1, 3 (OAuth, revocation propagation)

These have docstrings describing future work but minimal implementation.

Testing

Tests are organized by layer:

  • tests/unit/ - Individual component tests
  • tests/integration/ - Cross-agent scenarios

All 130 tests should pass with make test.