Skip to content

feat(context): add Recent-Only and RAG modes - #36

Merged
Yofuria merged 1 commit into
mainfrom
feat/recent-only-rag-pr
Aug 28, 2026
Merged

feat(context): add Recent-Only and RAG modes#36
Yofuria merged 1 commit into
mainfrom
feat/recent-only-rag-pr

Conversation

@Yofuria

@Yofuria Yofuria commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add Recent-Only context management that pins the initial user request and retains only recent completed turns
  • add local SQLite FTS5 RAG memory for evicted turns with configurable retrieval limits
  • expose both modes through setup, CLI, SDK, benchmark runner, traces, and fallback accounting
  • document environment variables and benchmark usage

Tests

  • uv run pytest tests/test_agent_runtime.py tests/test_benchmark_adapters.py tests/test_setup.py -q — 58 passed
  • npm test -- test/bcg-context.test.ts test/recent-context.test.ts — 27 passed
  • npm run check — passed

@Yofuria Yofuria self-assigned this Aug 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8b6a5bd93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent-cli/src/core/sdk.ts
Comment on lines +431 to +433
const databasePath = ragSettings.databasePath
? resolvePath(ragSettings.databasePath)
: join(agentDir, "rag", `${sessionManager.getSessionId()}.sqlite`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Namespace overridden RAG databases by session

When BCG_RAG_DB_PATH or contextManagement.rag.databasePath is configured, every session opens the same exact database rather than the session-specific path used by the default. The new memory schema has no session identifier and retrieval has no session predicate, so matching turns from one session can be injected into another session's system prompt, leaking unrelated context and corrupting responses. Append the session ID to configured storage or store and filter by a session key.

Useful? React with 👍 / 👎.

@Yofuria
Yofuria merged commit 3bf1805 into main Aug 28, 2026
5 checks passed
@Yofuria
Yofuria deleted the feat/recent-only-rag-pr branch August 28, 2026 07:12
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