Memory List Displays "null" Instead of Content
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(vianpx) - 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
- 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
- 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
- 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
contentfield - Only the display/rendering logic has the bug
- The same issue affects both:
npx agentic-flow reasoningbank listnpx 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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