Skip to content

Commit b3ec3a7

Browse files
committed
fix(research): Simplify AI prompt to ONLY format (no analysis)
CRITICAL FIX: The whole point of OVSM preprocessing is to save AI tokens! Before: Asked AI to "analyze" the data (it was doing its own analysis!) After: Explicitly tell AI "analysis is ALREADY COMPLETE, ONLY format into tables" System prompt now clearly states: - You are a markdown formatter (NOT analyst) - DO NOT analyze, interpret, or add commentary - ONLY convert JSON to markdown tables - NO analysis. NO interpretation. ONLY formatting. This ensures we're using OVSM aggregation correctly and not wasting tokens on re-analysis.
1 parent 3b66a89 commit b3ec3a7

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/commands/research.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -397,32 +397,32 @@ fn extract_summary_json(result: &ovsm::Value) -> Result<String> {
397397
/// Format the wallet analysis summary using AI
398398
async fn format_wallet_analysis(ai_service: &mut AiService, wallet: &str, summary_json: &str) -> Result<String> {
399399
// System prompt for custom formatting (bypass planning mode)
400-
let system_prompt = format!(r#"You are a blockchain analyst. Format the following aggregated Solana wallet transfer summary into a clear markdown report.
400+
let system_prompt = r#"You are a markdown formatter. The blockchain analysis is ALREADY COMPLETE.
401401
402-
Create a professional report with:
402+
Your ONLY job: Convert the provided JSON into clean markdown tables.
403403
404-
1. **Token Summary**:
405-
- Token symbol and mint address
406-
- Total transfers for this token
404+
DO NOT analyze, interpret, or add commentary. ONLY format what's given:
407405
408-
2. **Inflow Analysis**:
409-
- List top_senders with amounts (addresses that sent tokens to this wallet)
406+
For each token in the JSON, create:
410407
411-
3. **Outflow Analysis**:
412-
- List top_receivers with amounts (addresses that received tokens from this wallet)
408+
**{symbol} ({mint})**
409+
- Transfers: {transfer_count} ({inflow_count} in, {outflow_count} out)
413410
414-
4. **Summary Statistics**:
415-
- Total raw transfers vs unique transfers
416-
- Number of unique tokens
411+
Top Inflows:
412+
| Address | Amount |
413+
|---------|--------|
414+
[list top_senders array]
417415
418-
Format as professional markdown with:
419-
- Overview section with key metrics
420-
- Token-by-token breakdown with tables
421-
- Identify DEX programs (Jupiter, Raydium, Orca, etc.) vs individual wallets
422-
- Highlight significant flows and patterns
423-
- Note: SOL is the native token
416+
Top Outflows:
417+
| Address | Amount |
418+
|---------|--------|
419+
[list top_receivers array]
424420
425-
Be clear and actionable. The data is already aggregated - just format it nicely."#);
421+
Summary at top:
422+
- Total: {total_transfers_unique} unique transfers
423+
- Tokens: {num_tokens}
424+
425+
NO analysis. NO interpretation. ONLY formatting the JSON into tables."#.to_string();
426426

427427
// Question contains the actual data
428428
let question = format!(r#"Wallet Address: {}

0 commit comments

Comments
 (0)