Skip to content

Instantly share code, notes, and snippets.

@jon-dixon
Created February 15, 2026 15:15
Show Gist options
  • Select an option

  • Save jon-dixon/5c7b35b23e6ef17c0d698359293c40ba to your computer and use it in GitHub Desktop.

Select an option

Save jon-dixon/5c7b35b23e6ef17c0d698359293c40ba to your computer and use it in GitHub Desktop.

We need to take a new approach to the 2nd brain project. Review the approach and confirm your agreement that it is the best approach:

Overall Goals

  • Provide a simple, useful tool to capture and process requests to my 2nd brain application.
  • The front-end architecture should be simple.
  • It should be easy to extend with future tools and features.
  • Do not overcomplicate the architecture.
  • Do not implement APEX App features, instead provide details on how to implement them.
  • Keep JavaScript to a minimum.

UI & Request Submission

  • A single submission entry field is pinned to the bottom of the page, where the user can enter instructions for the 2nd brain.
  • Simple Submit button that submits the question for processing.
  • The submission to the back end is handled via a simple Dynamic action that calls PL/SQL.
  • After submission, a styled spinner should be displayed to block further activity until the AI's turn is complete.
  • All submissions should be synchronous.
  • The submission is added to a queue table, and then processing begins.
  • The queue table should be designed to allow external entities to post requests.

Request Processing

  • Processing should be controlled by an agentic loop.
  • Use the config_code SB_PROCESS_USER_MESSAGE as the main 'brain' for the loop.
  • When the 2nd brain needs clarification, finish the turn, give control back to the user, and allow them to enter the clarification in the submission entry field.
  • When the 2nd brain wants to perform a write action (e.g., add_calendar_entry), finish the turn, return control to the user, and allow them to confirm the action by typing in the submission field.

AI Configs

  • The table GEN_AI_CONFIGS contains AI configurations, including the Provider API URL, reasoning effort, verbocity.
  • The table GEN_AI_TOOLS lists tools.
  • The table GEN_AI_TOOL_PARAMS lists the parameters for the tools.
  • The table GEN_AI_CONFIG_TOOLS lists configuration-specific tools.
  • Use the config_code SB_PROCESS_USER_MESSAGE_DOIT as the main 'brain' for the loop.
  • Suggest any other configs you may need, e.g., a configuration and instructions for handling clarifications.

Tools

  • Include the AI Config tools with each request.
  • When appropriate, add the OpenAI web search tool (even if not in the AI Config).
  • Initially, the following tools will be available. You need to build functions and dispatcher logic for each of them:
    • get_calendar_entries - read only
    • get_emails - read only
    • get_sb_entries - read only
    • add_calendar_entry - write directly using Google Calendar API
    • add_sb_entry - write a record to the table sb_entries
  • All get tools should return a JSON Object.
  • When a tool request requires a write action (add_calendar_entry, add_sb_entry), finish the turn and obtain user confirmation before continuing.

Other Instructions

  • You can delete the existing data model and start again if it is easier.
  • Feel free to take ideas from other packages in the repo, but you should create all new packages, tables, and views.
  • New DB objects should be prefixed SB_REQUEST_*
  • Prefer PL/SQL over JavaScript unless necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment