feat(engine): Think/Recall/Sessions intelligence layer#5
Conversation
Add engine.py with three new capabilities: - think(context): Retrieve relevant past decisions, patterns, and bugs given current task context. Categorizes by intent. - recall(file_path|topic): Proactive retrieval — file interaction timeline, session history, and related knowledge. - sessions(project, days): Browse recent sessions by date/project. Wire into MCP server as 3 new tools (11 total): - brainlayer_think: Pre-task context injection - brainlayer_recall: File/topic-based proactive retrieval - brainlayer_sessions: Session browsing 29 tests (24 unit + 5 integration), all pass in <2s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| DECISION_INTENTS = {"deciding", "designing"} | ||
| DEBUG_INTENTS = {"debugging"} | ||
| IMPLEMENT_INTENTS = {"implementing", "configuring"} | ||
| REVIEW_INTENTS = {"reviewing", "discussing"} |
There was a problem hiding this comment.
REVIEW_INTENTS constant defined but never used
Low Severity
REVIEW_INTENTS ({"reviewing", "discussing"}) is defined at module level alongside DECISION_INTENTS, DEBUG_INTENTS, and IMPLEMENT_INTENTS, but categorize_by_intent never references it. Items with "reviewing" or "discussing" intents silently fall through to the else branch and land in the context bucket instead of getting their own category. The constant adds confusion by implying a category that doesn't exist.
Additional Locations (1)
| "project": meta.get("project", ""), | ||
| "created_at": meta.get("created_at", ""), | ||
| } | ||
| ) |
There was a problem hiding this comment.
Identical chunk-building code duplicated in recall
Low Severity
The recall function contains two character-for-character identical blocks that build related_chunks dicts from search results — one in the file_path branch and one in the topic branch. If a field mapping or default ever needs to change (e.g. adding tags like think does), it must be updated in both places, risking inconsistent fixes.
Additional Locations (1)
Add engine.py with three new capabilities: - think(context): Retrieve relevant past decisions, patterns, and bugs given current task context. Categorizes by intent. - recall(file_path|topic): Proactive retrieval — file interaction timeline, session history, and related knowledge. - sessions(project, days): Browse recent sessions by date/project. Wire into MCP server as 3 new tools (11 total): - brainlayer_think: Pre-task context injection - brainlayer_recall: File/topic-based proactive retrieval - brainlayer_sessions: Session browsing 29 tests (24 unit + 5 integration), all pass in <2s. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>


Summary
engine.pymodule with three capabilities: think, recall, sessionsArchitecture
Test plan
🤖 Generated with Claude Code
Note
Medium Risk
Adds new retrieval endpoints that query the vector DB and run embeddings via MCP, expanding the public tool surface and introducing new query/formatting paths that could impact performance or error handling.
Overview
Introduces a new
engine.py“Think/Recall/Sessions” layer that builds structured, markdown-formatted outputs for (1) context-aware memory retrieval (think) with intent-based grouping and an importance floor, (2) proactive file/topic recall (recall) combining file timelines, session context, and related hybrid search, and (3) recent session browsing (sessions) backed by directsession_contextSQL queries.Wires these capabilities into the MCP server as three new read-only tools (
brainlayer_think,brainlayer_recall,brainlayer_sessions) with async wrappers that offload embedding + engine work to an executor. Adds a newtest_engine.pysuite covering categorization/formatting plus DB-backed integration checks forsessionsand file-basedrecall.Written by Cursor Bugbot for commit c1773df. This will update automatically on new commits. Configure here.