Skip to main content

Session Commands

Manage agent sessions using the MEMANTO CLI.

memanto session info

View current active session information.
memanto session info [OPTIONS]
Options:
  • None
Examples: Check current session:
memanto session info
Output:
Current Session Information

Agent:         customer-support
Session ID:    session_abc123xyz
Status:        ACTIVE
Created At:    2025-03-30 16:30:00 UTC
Expires At:    2025-03-31 22:30:00 UTC
Time Until Expiry: 5h 47m

Session Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

memanto session extend

Extend the current session’s expiration time.
memanto session extend [OPTIONS]
Options:
  • -h, --hours INTEGER - Hours to extend (default: 6)
  • -f, --force - Skip confirmation
Examples: Extend by 6 hours:
memanto session extend
Extend by 12 hours:
memanto session extend --hours 12
Extend by 24 hours:
memanto session extend --hours 24
Force extend (no confirmation):
memanto session extend --hours 12 --force
Output:
✓ Session extended successfully

Original Expiry: 2025-03-31 22:30:00 UTC
New Expiry:      2025-04-01 04:30:00 UTC
Time Added:      6h 0m
New Duration:    12h

Session Management Patterns

Check and Extend if Needed

# Check status
memanto session info

# If expiring soon, extend
memanto session extend --hours 6

Switch Agents and Sessions

# Deactivate current
memanto agent deactivate

# Activate different agent
memanto agent activate other-agent

# Check new session
memanto session info

Long-Running Operations

For tasks lasting more than 6 hours:
# Start
memanto agent activate my-agent

# Work...

# Extend proactively
memanto session extend --hours 12

# Continue working...

# Extend again if needed
memanto session extend --hours 6

Best Practices

Monitor Expiry

Regular check before long operations:
memanto session info | grep "Time Until Expiry"

Proactive Extension

Don’t wait for expiry:
# Check if less than 2 hours remaining
memanto session info

# If so, extend
memanto session extend

Multiple Agents

Manage sessions for different agents:
# Work with Agent A
memanto agent activate agent-a
memanto remember "Data for A" --type fact

# Switch to Agent B
memanto agent deactivate
memanto agent activate agent-b
memanto remember "Data for B" --type fact

# Switch back to Agent A
memanto agent deactivate
memanto agent activate agent-a

# Check session
memanto session info

Troubleshooting

No Active Session

memanto session info
# Output: No active session

# Activate one
memanto agent activate my-agent

Session Expired

# Try to use agent
memanto remember "Something" --type fact
# Error: Session expired

# Reactivate
memanto agent activate my-agent

Can’t Extend

# Ensure session is active
memanto session info

# If inactive, activate first
memanto agent activate my-agent

# Then extend
memanto session extend --hours 6

Next Steps