Show HN: Locally run a "blue text" bot (llama3)
GitHub - bwasti/btb: Blue-text Bot AI.  Uses Ollama + AppleScript

      


    
      Skip to content

      
    

  
  
  





      

          

              



  Navigation Menu

  

  
          
            
                
      
      
                
                    
  
      
      
        GitHub Copilot
        Write better code with AI
      

    


                    
  
      
      
        Security
        Find and fix vulnerabilities
      

    


                    
  
      
      
        Actions
        Automate any workflow
      

    


                    
  
      
      
        Codespaces
        Instant dev environments
      

    


                    
  
      
      
        Issues
        Plan and track work
      

    


                    
  
      
      
        Code Review
        Manage code changes
      

    


                    
  
      
      
        Discussions
        Collaborate outside of code
      

    


                    
  
      
      
        Code Search
        Find more, search less
      

    


                
              


                  
      
      


                  
      
      
                    Explore
                    
  
      Learning Pathways

    


                    
  
      White papers, Ebooks, Webinars

    


                    
  
      Customer Stories

    


                    
  
      Partners

    


                
              



                
      
      
              
                
                    
  
      
      
        GitHub Sponsors
        Fund open source developers
      

    


                
              
              
                
                    
  
      
      
        The ReadME Project
        GitHub community articles
      

    


                
              
              
          



                
      
      
                
                    
  
      
      
        Enterprise platform
        AI-powered developer platform
      

    


                
              



                
    Pricing


            
          

        
                



  
  
  
    

  
    
    
      
        Provide feedback
      
        
    
    
  
      
        
      
      


    
    

  
    
    
      
        Saved searches
      
        Use saved searches to filter your results more quickly
    
    
  
      
        
      
      

    
  


            

              
                Sign up
              
          
        
      


      
    

  








    


    
    





  
    
      
  





    






  
  


      
            
    
      

  
                Notifications
    You must be signed in to change notification settings

  

  
              Fork
    1

  

  
        
            
          Star
          50

  



        

        


          

  
      
  
    
              
        Code
          


    

      
  
    
              
        Issues
          


    

      
  
    
              
        Pull requests
          


    

      
  
    
              
        Actions
          


    

      
  
    
              
        Projects
          


    

      
  
    
              
        Security
          

    

      
  
    
              
        Insights
          


    


    


  

  




          


















  
  
  Repository files navigationREADMEbtb
locally run blue text bot with editable memory.  this is a super early work in progress!

the code is built on ollama and does two things:

uses messages for communication (you'll need a mac and a separate apple account)
uses json for "memory" and lets you edit that directly in the browser

Usage
install Ollama https://ollama.com
ollama pull llama3
pip install -r requirements.txt

then run the service

How it works
Messages

Parse ~/Library/Messages/chat.db to get the most recent text (every 1 second)
Use applescript (send.applescript) to send a response message

JSON

Inject the most recent "memory" as JSON into the ollama chat history
Ask a separate model (prompted for JSON output, using format=json) to summarize any new information and update the JSON
Run a server (flask with websockets) to make the JSON live editable by the user in the browser




      




    
  

          




    


  

    

    

    





    