The project keeps a running Lisp world alive while an outside controller asks an OpenAI model what to try next.
"What should we try?"
|
v
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
| #!/bin/bash | |
| # Colors | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| NO_COLOR='\033[0m' | |
| BLUE='\033[0;34m' | |
| YELLOW='\033[0;33m' | |
| NO_COLOR='\033[0m' |
| import { type Stream, type Operation, action, each, once, resource, spawn, createChannel, createSignal } from "effection"; | |
| export interface WebSocketHandle extends Stream<MessageEvent, CloseEvent> { | |
| send(value: string): Operation<void>; | |
| close(code?: number, reason?: string): Operation<void>; | |
| } | |
| export function useWebSocket(url: string | URL, protocols?: string | string[]) { | |
| return resource<WebSocketHandle>(function*(provide) { | |
| let input = createChannel<string, {code?: number; reason?: string}>(); |
| //====================================== | |
| // server.ts | |
| //====================================== | |
| import { inject } from './injector.ts' // SEE BELOW | |
| import { registerWatcher } from './watcher.ts' | |
| // in your server request handler ... |
| diff --git a/.cargo/config.toml b/.cargo/config.toml | |
| index f5b2f124b..6cd093e8e 100644 | |
| --- a/.cargo/config.toml | |
| +++ b/.cargo/config.toml | |
| @@ -23,6 +23,9 @@ rustflags = [ | |
| "link-args=-fuse-ld=lld -weak_framework Metal -weak_framework MetalPerformanceShaders -weak_framework QuartzCore -weak_framework CoreGraphics", | |
| ] | |
| +[target.x86_64-unknown-illumos] | |
| +rustflags = ["-C", "link-args=-latomic -lffi -lstdc++"] |
| (defn point-outside-circle [c r p] | |
| (if (< (vec2/dist c p) r) | |
| (vec2/scale (vec2/normalize (vec2/- p c)) r) | |
| p)) | |
| (defn circle-tangent-point [c r b dir] | |
| (let [B (point-outside-circle c r b) | |
| cB (vec2/dist c B) | |
| S (vec2/scale (vec2/normalize (vec2/- B c)) r) |
This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/
the command zig run my_code.zig will compile and immediately run your Zig
program. Each of these cells contains a zig program that you can try to run
(some of them contain compile-time errors that you can comment out to play
with)
I saw this poll on Twitter earlier and was surprised at the result, which at the time of writing overwhelmingly favours option 1:
I've always been of the opinion that the (req, res, next) => {} API is the worst of all possible worlds, so one of two things is happening:
| import {useState, useCallback, useRef} from 'react' | |
| // Hook | |
| const useHover = <T extends HTMLElement>(): [ | |
| (node?: T | null) => void, | |
| boolean, | |
| ] => { | |
| const [value, setValue] = useState(false) | |
| // Wrap in useCallback so we can use in dependencies below |