--- sidebar_position: 3 --- # CLI Reference The Hindsight CLI provides command-line access to memory operations and bank management. ## Installation ```bash curl -fsSL https://hindsight.vectorize.io/get-cli | bash ``` ## Configuration Configure the API URL: ```bash # Interactive configuration hindsight configure # Or set directly hindsight configure --api-url http://localhost:8888 # Or use environment variable (highest priority) export HINDSIGHT_API_URL=http://localhost:8888 ``` ## Core Commands ### Retain (Store Memory) Store a single memory: ```bash hindsight memory retain "Alice works at Google as a software engineer" # With context hindsight memory retain "Bob loves hiking" --context "hobby discussion" # Queue for background processing hindsight memory retain "Meeting notes" --async ``` ### Retain Files Bulk import from files: ```bash # Single file hindsight memory retain-files notes.txt # Directory (recursive by default) hindsight memory retain-files ./documents/ # With context hindsight memory retain-files meeting-notes.txt --context "team meeting" # Background processing hindsight memory retain-files ./data/ --async ``` ### Recall (Search) Search memories using semantic similarity: ```bash hindsight memory recall "What does Alice do?" # With options hindsight memory recall "hiking recommendations" \ --budget high \ --max-tokens 8192 # Filter by fact type hindsight memory recall "query" --fact-type world,opinion # Show trace information hindsight memory recall "query" --trace ``` ### Reflect (Generate Response) Generate a response using memories and bank disposition: ```bash hindsight memory reflect "What do you know about Alice?" # With additional context hindsight memory reflect "Should I learn Python?" --context "career advice" # Higher budget for complex questions hindsight memory reflect "Summarize my week" --budget high ``` ## Bank Management ### List Banks ```bash hindsight bank list ``` ### View Profile ```bash hindsight bank profile ``` ### View Statistics ```bash hindsight bank stats ``` ### Set Bank Name ```bash hindsight bank name "My Assistant" ``` ### Set Background ```bash hindsight bank background "I am a helpful AI assistant interested in technology" # Skip automatic disposition inference hindsight bank background "Background text" --no-update-disposition ``` ## Document Management ```bash # List documents hindsight document list # Get document details hindsight document get # Delete document and its memories hindsight document delete ``` ## Entity Management ```bash # List entities hindsight entity list # Get entity details hindsight entity get # Regenerate entity observations hindsight entity regenerate ``` ## Output Formats ```bash # Pretty (default) hindsight memory recall "query" # JSON hindsight memory recall "query" -o json # YAML hindsight memory recall "query" -o yaml ``` ## Global Options | Flag | Description | |------|-------------| | `-v, --verbose` | Show detailed output including request/response | | `-o, --output ` | Output format: pretty, json, yaml | | `--help` | Show help | | `--version` | Show version | ## Interactive Explorer Launch the TUI explorer for visual navigation of your memory banks: ```bash hindsight explore ``` The explorer provides an interactive terminal interface to: - **Browse memory banks** — View all banks and their statistics - **Search memories** — Run recall queries with real-time results - **Inspect entities** — Explore the knowledge graph and entity relationships - **View facts** — Browse world facts, experiences, and opinions - **Navigate documents** — See source documents and their extracted memories ### Keyboard Shortcuts | Key | Action | |-----|--------| | `↑/↓` | Navigate items | | `Enter` | Select / Expand | | `Tab` | Switch panels | | `/` | Search | | `q` | Quit | ## Example Workflow ```bash # Configure API URL hindsight configure --api-url http://localhost:8888 # Store some memories hindsight memory retain demo "Alice works at Google" hindsight memory retain demo "Bob is a data scientist" hindsight memory retain demo "Alice and Bob are colleagues" # Search memories hindsight memory recall demo "Who works with Alice?" # Generate a response hindsight memory reflect demo "What do you know about the team?" # Check bank profile hindsight bank profile demo ```