ruvnet / ruvnet/agentic-flow

Memory List Displays "null" Instead of Content

Open
#66 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
812
Forks
175
Avg merge
2m
Merged PRs (30d)
3

Description

Bug Report: Memory List Displays "null" Instead of Content

Summary

When using npx agentic-flow reasoningbank list or npx claude-flow@alpha agent memory list, stored memory content displays as "null" instead of showing the actual stored value.

Environment

  • Package: agentic-flow (via npx)
  • Related: claude-flow@alpha
  • Database: SQLite (.swarm/memory.db)
  • Node.js version: [user's version]
  • OS: macOS (Darwin 24.6.0)

Expected Behavior

When listing memories, the output should display the actual content that was stored:

1. api_pattern
   Confidence: 0.80 | Usage: 0 | Created: 2025-11-20 18:57:54
   Domain: default
   All endpoints return { success: boolean, data?: any, error?: string }

Actual Behavior

The content is displayed as "null":

1. api_pattern
   Confidence: 0.80 | Usage: 0 | Created: 2025-11-20 18:57:54
   Domain: default
   null

Reproduction Steps

  1. Store a memory using the memory store command:
npx claude-flow@alpha memory store api_pattern "All endpoints return { success: boolean, data?: any, error?: string }"

Actual output:

$ npx claude-flow@alpha memory store "api_pattern" "All endpoints return { success: boolean, data?: any, error?: string }"

ℹ️  🧠 Using ReasoningBank mode...
[ReasoningBank] Initializing...
[ReasoningBank] Enabled: true (initializing...)
[ReasoningBank] Database: .swarm/memory.db
[ReasoningBank] Embeddings: local
[ReasoningBank] Retrieval k: 3
[INFO] Database migrations completed { path: '.swarm/memory.db' }
[ReasoningBank] Database migrated successfully
[INFO] Connected to ReasoningBank database { path: '.swarm/memory.db' }
[ReasoningBank] Database OK: 3 tables found
[ReasoningBank] Initialization complete
[ReasoningBank] Node.js backend initialized successfully
[INFO] Upserted reasoning memory { id: '1a80302c-854f-4955-b73f-7a18290f4d6a', title: 'api_pattern' }
[Embeddings] NPX environment detected - using hash-based embeddings
[Embeddings] For semantic search, install globally: npm install -g claude-flow
βœ… βœ… Stored successfully in ReasoningBank
πŸ“ Key: api_pattern
🧠 Memory ID: 1a80302c-854f-4955-b73f-7a18290f4d6a
πŸ“¦ Namespace: default
πŸ’Ύ Size: 69 bytes
πŸ” Semantic search: enabled
[INFO] Closed ReasoningBank database connection 
[ReasoningBank] Database connection closed

2. List memories:
```bash
npx claude-flow@alpha agent memory list
  1. Observe that content displays as "null" instead of the stored value
$ npx claude-flow@alpha agent memory list
βœ… 🧠 Listing ReasoningBank memories (limit: 10)
[INFO] Connected to ReasoningBank database { path: 
'.swarm/memory.db' }

πŸ“š Memory Bank Contents
══════════════════════════════════════════════════

Showing top 10 memories (sorted by created_at)

1. api_pattern
   Confidence: 0.80 | Usage: 0 | Created: 2025-11-20 18:57:54
   Domain: default
   null

Expected output confirms storage:

βœ… Stored successfully in ReasoningBank
πŸ“ Key: api_pattern
🧠 Memory ID: 1a80302c-854f-4955-b73f-7a18290f4d6a
πŸ“¦ Namespace: default
πŸ’Ύ Size: 69 bytes
  1. Verify data is actually stored in database:
sqlite3 .swarm/memory.db "SELECT id, type, pattern_data FROM patterns WHERE type = 'reasoning_memory' ORDER BY created_at DESC LIMIT 1"

Output shows content IS stored:

{
  "title":"api_pattern",
  "content":"All endpoints return { success: boolean, data?: any, error?: string }",
  "domain":"default",
  "agent":"memory-agent",
  "task_type":"fact",
  "original_key":"api_pattern",
  "original_value":"All endpoints return { success: boolean, data?: any, error?: string }",
  "namespace":"default"
}

Root Cause

File: dist/utils/reasoningbankCommands.js
Function: listMemories()

Line 136 - Incorrect field name in SQL query:

const memories = dbInstance.prepare(`
  SELECT
    id,
    json_extract(pattern_data, '$.title') as title,
    json_extract(pattern_data, '$.description') as description,  // ❌ WRONG FIELD
    json_extract(pattern_data, '$.domain') as domain,
    confidence,
    usage_count,
    created_at
  FROM patterns
  WHERE type = 'reasoning_memory'
  ORDER BY ${orderBy}
  LIMIT ?
`).all(limit);

Line 155 - Displays the null value:

console.log(`   ${mem.description}`);

The JSON structure stores the field as content, not description. The query extracts a non-existent field, resulting in null.

Suggested Fix

Change line 136 from:

json_extract(pattern_data, '$.description') as description,

To:

json_extract(pattern_data, '$.content') as description,

Alternatively, for consistency with the JSON structure:

json_extract(pattern_data, '$.content') as content,

And update line 155:

console.log(`   ${mem.content}`);

Additional Notes

  • The data is correctly stored in the database with the content field
  • Only the display/rendering logic has the bug
  • The same issue affects both:
    • npx agentic-flow reasoningbank list
    • npx claude-flow@alpha agent memory list (which delegates to agentic-flow)

Verification Query

To confirm the actual stored structure:

sqlite3 .swarm/memory.db "SELECT json_extract(pattern_data, '$.title'), json_extract(pattern_data, '$.content'), json_extract(pattern_data, '$.domain') FROM patterns WHERE type = 'reasoning_memory' ORDER BY created_at DESC LIMIT 3"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dist/utils/reasoningbankCommands.js at listMemories() and inspect the SQL field extraction and output near lines 136 and 155. Reproduce with the listed memory store and list commands, then verify the stored JSON with the provided sqlite3 query. Done means the list commands display the stored content instead of null.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
cli, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.