Skip to content

Instantly share code, notes, and snippets.

View beardedeagle's full-sized avatar
😒
Making the world functional.

Randy Thompson beardedeagle

😒
Making the world functional.
View GitHub Profile

See more of my writing here.

In this post, I'll start from scratch and build up to OpenClaw's architecture step by step, showing how you could have invented it yourself from first principles, using nothing but a messaging API, an LLM, and the desire to make AI actually useful outside the chat window.

End goal: understand how persistent AI assistants work, so you can build your own (or become an OpenClaw power user).

First, let's establish the problem

When you use ChatGPT or Claude in a browser, there are several limitations:

@beardedeagle
beardedeagle / dummy-web-server.py
Created December 27, 2018 21:26 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@beardedeagle
beardedeagle / fieldSelectMixin
Created April 27, 2015 05:01
Field selection mixins for Tastypie (dehydrate, full_dehydrate and db level filter)
###################################################################
# mixin that utilizes dehydrate to implement field selection #
# Tested with python 2.7.5, django 1.8 and django-tastypie 0.12.1 #
###################################################################
class fieldSelectMixin(object):
"""
Mixin to allow field selection, dehydrate method.
"""
def dehydrate(self, bundle):
selectedFields = bundle.request.GET.get('fields')
@beardedeagle
beardedeagle / full_dehydrateMixin.py
Created April 26, 2015 05:13
full_dehydrate mixin to allow for field selection in Tastypie
class fieldSelectMixin(object):
"""
Mixin to allow field selection. full_dehydrate method.
"""
def full_dehydrate(self, bundle, for_list=False):
"""
Given a bundle with an object instance, extract the information from it
to populate the resource.
"""
use_in = ['all', 'list' if for_list else 'detail']
@beardedeagle
beardedeagle / dehydrateMixin.py
Created April 26, 2015 05:12
dehydrate mixin to allow for field selection in Tastypie
class fieldSelectMixin(object):
"""
Mixin to allow field selection, dehydrate method.
"""
def dehydrate(self, bundle):
selectedFields = bundle.request.GET.get('fields')
if selectedFields:
selectedFields = selectedFields.split(',')
removedFields = [field for field in bundle.data.keys() if field not in selectedFields]