{"id":50673833,"url":"https://github.com/pasunboneleve/cheap-rag","last_synced_at":"2026-06-08T14:02:14.886Z","repository":{"id":352760475,"uuid":"1216501160","full_name":"pasunboneleve/cheap-rag","owner":"pasunboneleve","description":"Simple RAG with hard guardrails. Answers only when local content is relevant — otherwise refuses. Cheap to run, cheap to understand, cheap to replace.","archived":false,"fork":false,"pushed_at":"2026-05-07T02:06:19.000Z","size":141,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T04:12:36.873Z","etag":null,"topics":["embeddings","golang","guardrails","llm","rag","semantic-search","sqlite","unix-socket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pasunboneleve.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-21T01:10:14.000Z","updated_at":"2026-05-01T04:53:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pasunboneleve/cheap-rag","commit_stats":null,"previous_names":["pasunboneleve/cheap-rag"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pasunboneleve/cheap-rag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasunboneleve%2Fcheap-rag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasunboneleve%2Fcheap-rag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasunboneleve%2Fcheap-rag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasunboneleve%2Fcheap-rag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pasunboneleve","download_url":"https://codeload.github.com/pasunboneleve/cheap-rag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasunboneleve%2Fcheap-rag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065354,"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-08T02:00:07.615Z","response_time":111,"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":["embeddings","golang","guardrails","llm","rag","semantic-search","sqlite","unix-socket"],"created_at":"2026-06-08T14:02:14.063Z","updated_at":"2026-06-08T14:02:14.880Z","avatar_url":"https://github.com/pasunboneleve.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cheap-rag\n[![Linux CI](https://github.com/pasunboneleve/cheap-rag/actions/workflows/linux-ci.yml/badge.svg)](https://github.com/pasunboneleve/cheap-rag/actions/workflows/linux-ci.yml)\n[![macOS CI](https://github.com/pasunboneleve/cheap-rag/actions/workflows/macos-ci.yml/badge.svg)](https://github.com/pasunboneleve/cheap-rag/actions/workflows/macos-ci.yml)\n\n**cheap-rag** is a deliberately simple, low-cost RAG implementation. It\nanswers only when local content is sufficiently similar to the\nquestion. Otherwise, it refuses.\n\nThis is the intended shape for this project.\nNot designed for scale. When scale becomes a bottleneck, replace it.\n\n## Why this exists\n\nThis project keeps deterministic guardrails in front of a stochastic model.\nRetrieval decides whether the model is allowed to speak.\n\nIf local evidence is out of scope, cheap-rag refuses.\nIf local evidence is in scope, cheap-rag answers from that evidence.\n\n## Architecture\n\nPipeline:\n\n`embed -\u003e retrieve -\u003e gate -\u003e generate -\u003e validate`\n\n- embed: turn the question into a vector\n- retrieve: fetch top-k local chunks by similarity\n- gate: refuse if similarity/evidence is insufficient\n- generate: answer only from retrieved chunks\n- validate: lightweight checks for evidence coverage/support\n\n## Quick start\n\n```bash\ngo run ./cmd/cheaprag index --config ./cheaprag.example.yaml\ngo run ./cmd/cheaprag shell --config ./cheaprag.example.yaml\ngo run ./cmd/cheaprag serve --config ./cheaprag.example.yaml\ngo run ./cmd/cheaprag ask --config ./cheaprag.example.yaml \"what is cheap to change?\"\ngo run ./cmd/cheaprag inspect query --config ./cheaprag.example.yaml \"ci cd\"\ngo run ./cmd/cheaprag version\n```\n\n## API example\n\nWhen running `serve`, cheap-rag listens on `runtime.socket_path` using HTTP over a Unix domain socket only.\n\nSuccess:\n\n```json\n{\n  \"outcome\": \"answer\",\n  \"content\": \"Use short feedback loops and explicit boundaries...\",\n  \"reason\": null,\n  \"query_similarity\": 0.73,\n  \"provider_statuses\": {\"embedding\": 200, \"generation\": 200},\n  \"retrieval\": [\n    {\"chunk_id\":\"chunk_1\",\"similarity\":0.73,\"path\":\"post.md\",\"citation\":\"my-post-slug\"}\n  ]\n}\n```\n\nRefusal:\n\n```json\n{\n  \"outcome\": \"refusal\",\n  \"content\": \"Sorry, I don't know how to answer this.\",\n  \"reason\": \"out-of-scope\",\n  \"query_similarity\": 0.18,\n  \"retrieval\": []\n}\n```\n\n## Key ideas\n\n- retrieval is the gatekeeper: generation happens only after retrieval passes scope checks\n- validation is intentionally limited: useful heuristics, not a formal truth system\n- local + inspectable beats scalable-by-default for this project\n\n## Documentation\n\n- [Architecture](docs/architecture.md)\n- [Configuration](docs/config.md)\n- [API](docs/api.md)\n- [Storage](docs/storage.md)\n- [Security](docs/security.md)\n- [Validation](docs/validation.md)\n- [Release schedule](docs/release-schedule.md)\n\n## Security model\n\n- no TCP listener is opened\n- server binds only to the configured Unix socket path\n- socket file is recreated on startup and chmod'd to `0660`\n- if `internal_token` is set, requests must include `Authorization: Bearer \u003ctoken\u003e`\n\nSee [docs/security.md](docs/security.md) for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpasunboneleve%2Fcheap-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpasunboneleve%2Fcheap-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpasunboneleve%2Fcheap-rag/lists"}