Skip to content

Add Past Cognitions List in UI and Auto-Generated Titles#17

Open
cddlee wants to merge 2 commits intomainfrom
feature/pastCognitionsUI
Open

Add Past Cognitions List in UI and Auto-Generated Titles#17
cddlee wants to merge 2 commits intomainfrom
feature/pastCognitionsUI

Conversation

@cddlee
Copy link
Copy Markdown
Contributor

@cddlee cddlee commented Jan 16, 2026

Summary

  • Add a "Past Cognitions" list in the expanded navigation rail sidebar, allowing users to navigate to previous cognition sessions
  • Implement auto-generation of cognition titles based on the first user message using LLM inference
  • Display cognitions with their title (or fallback to "Cognition #ID" if no title exists)
  • Add SSE event to notify clients when a cognition title is updated

Changes

API Layer (golem-xiv-api)

  • Add CognitionListItem data class for listing cognitions
  • Add GolemOutput.CognitionTitleUpdated SSE event type

Backend (golem-xiv-api-backend, golem-xiv-neo4j, golem-xiv-core)

  • Add listCognitions() and getExpressionCount() to CognitiveMemory interface
  • Add listCognitions() and isFirstExpression() to CognitionRepository interface
  • Implement Neo4j Cypher queries to list root cognitions (excluding child cognitions) ordered by initiation time
  • Create TitleGenerator interface and AnthropicTitleGenerator implementation
  • Integrate async title generation in GolemXiv.perceive() after first user message

Server (golem-xiv-server)

  • Implement GET /api/cognitions endpoint with pagination support
  • Wire up title generator using the configured Anthropic instance

Client (golem-xiv-api-client)

  • Add listCognitions() method to CognitionService

Frontend (golem-xiv-presenter, golem-xiv-web)

  • Extend SidebarView and SidebarPresenter to handle cognition list display and selection
  • Add cognition list UI component in HtmlNavigationRailView
  • Auto-refresh list on new cognitions and title updates via SSE events
  • Add CSS styles for the cognition list (visible only when navbar is expanded)

Tests (golem-xiv-neo4j)

  • Add tests for listCognitions (ordering, pagination, excluding child cognitions, title display)
  • Add tests for getExpressionCount

Test plan

  • Run ./gradlew :golem-xiv-neo4j:test - verify new Neo4j tests pass
  • Start the full stack and verify:
    • Expand navbar and see "Past Cognitions" section
    • Create a new cognition with a message
    • Verify title is auto-generated after first message
    • Verify cognition appears in the past cognitions list
    • Click on a past cognition to navigate to it

@morisil
Copy link
Copy Markdown
Member

morisil commented Jan 16, 2026

@cddlee I wish we could have talked about the architecture and design before this PR. The project is already deployed for the client, and I have to maintain this version, at the same time, in another branch, I am completely changing the architecture to switch to SemanticEvents from markanywhere and also to migrate current MVP architecture to MVVM architecture, which will be compatible with android and ios code. The essence of this PR is definitely what we want soon, but we will need to put it on hold until new architecture is in place. I prepared some architectural docs, I will share them soon.

@cddlee
Copy link
Copy Markdown
Contributor Author

cddlee commented Jan 16, 2026

@cddlee I wish we could have talked about the architecture and design before this PR. The project is already deployed for the client, and I have to maintain this version, at the same time, in another branch, I am completely changing the architecture to switch to SemanticEvents from markanywhere and also to migrate current MVP architecture to MVVM architecture, which will be compatible with android and ios code. The essence of this PR is definitely what we want soon, but we will need to put it on hold until new architecture is in place. I prepared some architectural docs, I will share them soon.

Sure, no problem. This feature was simple enough that it felt like I have nothing to lose to make this PR, so no worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants