Skip to content

Commit cdde28f

Browse files
authored
Enhance Financial Advisor Branch Management and UI Consistency (#69)
1 parent fb7d810 commit cdde28f

6 files changed

Lines changed: 633 additions & 44 deletions

File tree

examples/financial_advisor/README.md

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ A demonstration of an AI-powered financial advisory system using ProllyTree for
99
- 🔒 **Security Monitoring**: Detects and prevents injection attacks and anomalies
1010
- 📚 **Versioned Memory**: Uses ProllyTree to maintain git-like versioned storage of all data
1111
- 🕐 **Temporal Queries**: Query recommendations and data as they existed at any point in time
12-
- 🌿 **Branch Management**: Create memory branches for different scenarios or clients
12+
- 🌿 **Smart Branch Management**: Git-style branch operations with validation and external tool sync
13+
- 🏦 **Real-time UI**: Live branch display that updates with external git operations
1314
- 📝 **Audit Trail**: Complete audit logs for compliance and debugging
1415
- 🎯 **Risk-Aware**: Adapts recommendations based on client risk tolerance
16+
- 👤 **Persistent Profiles**: Client profiles automatically saved per branch
1517

1618
## Prerequisites
1719

@@ -73,8 +75,13 @@ Once the advisor is running, you can use these commands:
7375
- `memory` - Show memory system status and statistics
7476
- `audit` - Show complete audit trail
7577

78+
#### Branch Management
79+
- `branch <NAME>` - Create and switch to a new memory branch
80+
- `switch <NAME>` - Switch to an existing branch
81+
- `list-branches` - Show all available branches with visual indicators
82+
- `branch-info` - List branches in git-style format (like `git branch`)
83+
7684
#### Advanced Features
77-
- `branch <NAME>` - Create a new memory branch
7885
- `visualize` - Show memory tree visualization
7986
- `test-inject <TEXT>` - Test security monitoring (try malicious inputs)
8087

@@ -85,24 +92,45 @@ Once the advisor is running, you can use these commands:
8592
### Example Session
8693

8794
```bash
88-
🏦> recommend AAPL
95+
🏦 [main] recommend AAPL
8996
📊 Recommendation Generated
9097
Symbol: AAPL
9198
Action: BUY
9299
Confidence: 52.0%
93100
Reasoning: Analysis of AAPL at $177.89 with P/E ratio 28.4...
94101

95-
🏦> risk aggressive
102+
🏦 [main] risk aggressive
96103
✅ Risk tolerance set to: Aggressive
97104

98-
🏦> recommend AAPL
105+
🏦 [main] recommend AAPL
99106
📊 Recommendation Generated
100107
Symbol: AAPL
101108
Action: BUY
102109
Confidence: 60.0%
103110
(Notice higher confidence for aggressive risk tolerance)
104111

105-
🏦> history
112+
🏦 [main] branch test-strategy
113+
🌿 Creating memory branch: test-strategy
114+
✅ Branch 'test-strategy' created successfully
115+
🔀 Switched to branch 'test-strategy'
116+
117+
🏦 [test-strategy] recommend MSFT
118+
📊 Recommendation Generated
119+
Symbol: MSFT
120+
Action: BUY
121+
Confidence: 58.0%
122+
123+
🏦 [test-strategy] list-branches
124+
🌳 Available Branches
125+
━━━━━━━━━━━━━━━━━━━━━━━━━
126+
○ main
127+
● test-strategy (current)
128+
129+
🏦 [test-strategy] switch main
130+
🔀 Switching to branch: main
131+
✅ Switched to branch 'main'
132+
133+
🏦 [main] history
106134
📜 Recent Recommendations
107135
📊 Recommendation #1
108136
Symbol: AAPL
@@ -115,7 +143,7 @@ Confidence: 60.0%
115143
Confidence: 52.0%
116144
...
117145

118-
🏦> memory
146+
🏦 [main] memory
119147
🧠 Memory Status
120148
✅ Memory validation: ACTIVE
121149
🛡️ Security monitoring: ENABLED
@@ -168,18 +196,56 @@ Options:
168196

169197
### Branch Management
170198

171-
Create branches for different scenarios:
199+
Create and manage branches for different scenarios:
172200

173201
```bash
174-
🏦> branch conservative-strategy
175-
✅ Created branch: conservative-strategy
202+
# Create and switch to a new branch
203+
🏦 [main] branch conservative-strategy
204+
🌿 Creating memory branch: conservative-strategy
205+
✅ Branch 'conservative-strategy' created successfully
206+
🔀 Switched to branch 'conservative-strategy'
207+
208+
🏦 [conservative-strategy] risk conservative
209+
✅ Risk tolerance set to: Conservative
176210

177-
🏦> risk conservative
178-
🏦> recommend MSFT
211+
🏦 [conservative-strategy] recommend MSFT
179212
# Generate recommendations for conservative strategy
180213

181-
🏦> history --branch main
182-
# Compare with main branch recommendations
214+
# List all available branches
215+
🏦 [conservative-strategy] list-branches
216+
🌳 Available Branches
217+
━━━━━━━━━━━━━━━━━━━━━━━━━
218+
○ main
219+
● conservative-strategy (current)
220+
221+
# Switch back to main branch
222+
🏦 [conservative-strategy] switch main
223+
🔀 Switching to branch: main
224+
✅ Switched to branch 'main'
225+
226+
🏦 [main] history --branch conservative-strategy
227+
# Compare recommendations from different branch
228+
229+
# Git-style branch listing
230+
🏦 [main] branch-info
231+
* main
232+
conservative-strategy
233+
```
234+
235+
#### Branch Validation
236+
237+
The system prevents common branching mistakes:
238+
239+
```bash
240+
# Try to create existing branch
241+
🏦 [main] branch main
242+
⚠️ Branch 'main' already exists!
243+
💡 Use 'switch main' to switch to the existing branch
244+
245+
# Try to switch to non-existent branch
246+
🏦 [main] switch nonexistent
247+
❌ Branch 'nonexistent' does not exist!
248+
💡 Use 'branch nonexistent' to create a new branch
183249
```
184250

185251
### Temporal Analysis

0 commit comments

Comments
 (0)