{"id":18377957,"url":"https://github.com/janearc/sux","last_synced_at":"2026-07-01T00:31:49.861Z","repository":{"id":256833993,"uuid":"856569112","full_name":"janearc/sux","owner":"janearc","description":"stateful-ux","archived":false,"fork":false,"pushed_at":"2026-01-19T21:14:43.000Z","size":30,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T17:24:56.591Z","etag":null,"topics":["aws","knowledge-graph","neptune"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janearc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-12T19:55:31.000Z","updated_at":"2025-03-21T00:10:04.000Z","dependencies_parsed_at":"2024-09-13T09:47:06.738Z","dependency_job_id":"62b06d35-87fb-496f-9dad-de2746bcab1a","html_url":"https://github.com/janearc/sux","commit_stats":null,"previous_names":["janearc/sux"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/janearc/sux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janearc%2Fsux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janearc%2Fsux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janearc%2Fsux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janearc%2Fsux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janearc","download_url":"https://codeload.github.com/janearc/sux/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janearc%2Fsux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34988712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","knowledge-graph","neptune"],"created_at":"2024-11-06T00:29:55.949Z","updated_at":"2026-07-01T00:31:49.843Z","avatar_url":"https://github.com/janearc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sux\n\n\"state sucks, man.\" so there's an interesting problem in trying to use tools like gpt\nin that they lack any ability to understand state. this is, from one query to the next\nthe backend doesn't have any prior knowledge of queries you might have passed it.\n\nfor example, if i ask openai, \"hey my name is jane and i am wondering if you have some\nideas for funny midle names for a person named jane.\" the back end returns something\nlike \"well rhonda is a very funny middle name for a person named jane,\" if i then send\na subsequent query saying \"what if i changed my name to aloysius everdander abercrombie,\"\nthe backend doesn't remember our previous statement and can't reply with the obvious\nanswer, \"that's long for jane, so i've been told.\"\n\nthe way we get around this issue is we have to continually dope the back end with\ncontext or state. perhaps ironically this means taking the things you've already said,\nand feeding them to the backend, and asking it to summarize, and then you use that\nsummary to add context to the next query and so on.\n\nin order for this to be effective, there needs to be storage involved.\n\nan open question for me is, _how do we determine whether to reach out to storage\nto find answers to things the backend might not know, or to try to find answers\nwe don't have based upon storage whose contents we do not know much or anything\nabout?_\n\nbut i'll figure that out when i get there.\n\n# how do i bake this cake though?\n\n```go\nimport (\n\t\"github.com/janearc/sux\"\n)\n\ns := sux.NewSux()\n\n// this is a unique identifier that refers to both:\n//   - the contextualized session with the openai backend\n//   - the storage backend that is used to provide context to the backend\nsid := s.NewSession()\n\nuuid := sid.ToUUID() // this is a uuid, but you probably don't need to use this\n\n// ask the backend a question\nresponse, err := s.Query(sid, \"how many parsecs is the kessel run?\")\n\n// magical queries against the storage backend\nthings, err := s.StorageQuery(sid, \"string to search for\")\nthings, err := s.StorageQueryRegex(sid, \"regex to search for\")\n\n// what is in a things?\nfor _, thing := range things {\n    fmt.Fprintf(\"'%s' [id: %s]: %s\\n\", thing.Name, thing.ID, thing.DataUnMarshal)\n\tfmt.Fprintf(\"'%s' [id: %s]: %s\\n\", thing.Name, thing.ID, thing.Summary)\n\tfmt.Fprintf(\"'%s' [id: %s]: %v\\n\", thing.Name, thing.ID, thing.Metadata)\n}\n\n// I have a sid and I want to resume a conversation with the backend\n_, err := s.SidValid(sid)\nresponse, err := s.Query(sid, \"why does javascript smell like a wet dog?\") // my editor just autocompleted this don't be mad at me ok\n\n// I have some stuff I want to actually store (but maybe don't do this because the magic is sux does this for you)\nthing := sux.NewThing(\n\tsux.MarshalData(anObject), // please don't feed me json, just let me marshal this for you\n)\n\n// that is correct, you do not get to set your own name or summary, that is for the computer to do.\nfmt.Fprintf(\"'%s' [id: %s]: %s\\n\", thing.Name, thing.ID, thing.Summary)\n\n// if this seems okay with you, go ahead and commit that sucker\nxact, err := thing.Commit()\nfmt.Fprintf(\"'%s' [id: %s]: written (confirm: %s)\\n\", thing.Name, thing.ID, xact)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanearc%2Fsux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanearc%2Fsux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanearc%2Fsux/lists"}