[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80804":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":13,"stars7d":13,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":15,"compositeScore":12,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":9,"pushedAt":9,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":12,"starSnapshotCount":12,"syncStatus":23,"lastSyncTime":24,"discoverSource":25},80804,"peek-dspy","0xtotem\u002Fpeek-dspy","0xtotem","A DSPy port of PEEK",null,"Python",43,0,1,5,3,false,"main",true,[],"2026-06-12 02:04:07","# peek-dspy\n\nA DSPy port of [PEEK](https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.19932): a self-updating context map that lives in your agent's prompt and accumulates structural knowledge about a recurring external context (a repo, a corpus, a document set) across calls.\n\nWrap any `dspy.Module`. The map grows automatically; a token budget keeps it bounded.\n\n```python\nimport dspy\nfrom peek_dspy import PEEK\n\nclass QA(dspy.Signature):\n    \"\"\"Answer a question about the codebase.\"\"\"\n    question: str = dspy.InputField()\n    answer:   str = dspy.OutputField()\n\ndspy.configure(lm=dspy.LM(\"anthropic\u002Fclaude-sonnet-4-6\"))\n\nagent  = dspy.ReAct(QA, tools=[read_file, grep, list_files])\npolicy = PEEK(\n    agent,\n    token_budget=10_000,       # max tokens kept in the context map\n    freeze_after=3,            # stop updating after N calls (None = always update)\n    question_field=\"question\", # field forwarded to the distiller as the task description\n)\n\nfor q in questions:\n    pred = policy(question=q)  # map accumulates here\n    print(pred.answer)\n\nprint(policy.current_map_text)\n```\n\nAfter each call, a Distiller separates orientation work from question-specific work, a Cartographer emits `ADD` \u002F `DELETE` \u002F `REPLACE` edits, and an Evictor trims the map to `token_budget` by dropping low-value sections first.\n\n## Install\n\n```bash\npoetry install\nexport ANTHROPIC_API_KEY=sk-...\npoetry run python examples\u002Fcodebase_qa.py\n```\n\n\n## References\n\nPaper: [arxiv.org\u002Fabs\u002F2605.19932](https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.19932) \n\nUpstream: [github.com\u002Fzhuohangu\u002Fpeek](https:\u002F\u002Fgithub.com\u002Fzhuohangu\u002Fpeek)\n","peek-dspy 是一个基于 DSPy 框架实现的 PEEK 项目，用于在代理的提示中创建一个自我更新的上下文地图，该地图能够跨多次调用累积关于重复出现的外部环境（如代码库、语料库或文档集）的结构化知识。其核心功能包括自动增长的地图和通过令牌预算控制地图大小，同时支持通过配置冻结更新。此项目特别适用于需要对特定领域进行持续学习和知识积累的应用场景，比如代码库问答、文档理解等任务。用户可以通过简单的 Python 接口将任何 `dspy.Module` 包装起来，并设置参数来控制地图的行为。",2,"2026-06-11 04:02:23","CREATED_QUERY"]