Document and harden project handoff

This commit is contained in:
wuyang
2026-07-12 14:54:03 +08:00
parent ab758e774e
commit 8e4ff3779b
17 changed files with 1030 additions and 32 deletions
+118
View File
@@ -0,0 +1,118 @@
# AI Continuation Guide
This file is the entrypoint for any AI or engineer continuing the repository.
## Start Here
Run these commands before changing anything:
```bash
git status --short --branch
git log -5 --oneline --decorate
python3 tools/check_project.py
sed -n '1,260p' docs/06-project-status.md
sed -n '1,260p' docs/07-exploration-history.md
sed -n '1,260p' docs/08-next-work.md
```
The active branch and remote are normally:
```text
branch: main
remote: https://git.k1412.top/wuyang/agent.git
```
Do not assume the public web service is running just because the repository is healthy. Check it separately:
```bash
web/manage.sh status
curl -fsS https://lab.k1412.top/api/health | jq
```
## Actual Goal
This is not merely a paper browser. The user wants a scaffold that turns a large raw corpus into personal, reusable cognition:
1. remember important knowledge;
2. compress it into a coherent system;
3. use that system to explain causes, compare approaches, answer new questions, and propose designs.
The current Atlas is a corpus exploration prototype, not a validated solution to this goal. The user rated its practical learning value at effectively zero because browsing left no durable learning state. Do not spend the next iteration polishing the graph without addressing this gap.
## Truth Hierarchy
Treat repository artifacts according to their evidence level:
1. `research/*/findings.md` and `evidence-ledger.md`: current evidence-backed conclusions.
2. `experiments/*`: method, failures, and validation boundaries.
3. `docs/`: stable system-level knowledge, but verify dates and sources before extending it.
4. `papers/items/*.md` with `status: skimmed`: partially reviewed.
5. `papers/items/*.md` with `status: queued`: collection records only, not understood papers.
6. Auto tags and model screening outputs: high-recall triage, never final truth.
The old `learning/agent-memory/` module is retained as a failed experiment. It is not the current synthesis.
## Repository Contracts
- Keep jobs, papers, and industry practice as separate first-class streams.
- Use metadata and indexes for cross-cutting organization; do not make deep directories the primary UX.
- Preserve original sources and raw traces. A summary must not overwrite evidence.
- Distinguish collection, screening, full-text evidence, synthesis, and user learning state.
- Run `python3 tools/collection/build_index.py` after changing item frontmatter.
- Run `python3 tools/check_project.py` and `git diff --check` before committing.
- Use `python3`, not `python`, in this environment.
- Keep generated cache and PID/log files under `web/cache/`; they are intentionally ignored.
- Never commit credentials. Git authentication is configured outside the repository.
## Ollama Contract
Default endpoint:
```text
http://192.168.1.10:11434
```
Current model tiers are configurable with:
```text
OLLAMA_MODEL_LIGHT=ChatGPT-5.6:Luna
OLLAMA_MODEL_FAST=ChatGPT-5.6:Terra
OLLAMA_MODEL_LARGE=ChatGPT-5.6:Sol
```
The application serializes Ollama calls because all models share one V100 32G GPU. Application requests must not send `num_ctx` or `keep_alive`; the Ollama server owns context size and residency. Expensive `Sol` actions should remain explicit, not automatic.
## Common Commands
```bash
# Rebuild the main index
python3 tools/collection/build_index.py
# Validate repository integrity
python3 tools/check_project.py
# Start or inspect the web service
web/manage.sh start
web/manage.sh status
web/manage.sh logs
# Research pipeline help
python3 tools/research/search_arxiv_memory.py --help
python3 tools/research/screen_memory_corpus.py --help
python3 tools/research/build_memory_landscape.py --help
```
Read the scripts before rerunning network or model-heavy research jobs. The committed research data is the reproducible snapshot; a refresh changes the time boundary and may be expensive.
## Before Handoff
After meaningful work, update all affected layers:
- artifact or code;
- generated index/data if applicable;
- experiment record for the method and result;
- `docs/06-project-status.md` for current facts;
- `docs/07-exploration-history.md` for a new major decision or failed route;
- `docs/08-next-work.md` for changed priorities.
Commit with a narrow message and push `main` unless the user requests another branch.
+24
View File
@@ -4,6 +4,17 @@
它的目标不是把所有内容一次写满,而是建立一个稳定的知识容器:新概念能放得进来,项目经验能沉淀下来,实验结论能被复现,资料阅读能转化为可执行判断。
## Continue This Project
新的 AI 或维护者先阅读:
- [AI Continuation Guide](AGENTS.md): 接手顺序、运行约束和工作契约
- [Project Status](docs/06-project-status.md): 当前数据、产物、服务和验证方式
- [Exploration History](docs/07-exploration-history.md): 已尝试、已失败和保留的判断
- [Next Work](docs/08-next-work.md): 下一阶段优先级和明确非目标
当前最重要的边界:这里已经有大规模资料库和可运行的 Atlas,但还没有完成“从论文到个人知识内化”的状态化学习系统。旧的 12 篇 Agent Memory 学习模块已判定失败;当前研究基线是 [Memory findings](research/memory/findings.md) 和 [evidence ledger](research/memory/evidence-ledger.md)。
## Navigation
- [Knowledge Map](docs/00-knowledge-map.md): 知识版图、分类方式、成熟度标签
@@ -12,6 +23,9 @@
- [Practice Playbook](docs/03-practice-playbook.md): 从需求到上线的实践清单
- [Evaluation and Observability](docs/04-evaluation-observability.md): 评估体系、指标、日志和回归
- [Collection Workflow](docs/05-collection-workflow.md): JD、论文和行业实践的持续收集流程
- [Project Status](docs/06-project-status.md): 当前数据、产物、运行状态和交接说明
- [Exploration History](docs/07-exploration-history.md): 关键探索路径、失败和决策
- [Next Work](docs/08-next-work.md): 延续工作、优先级和验收标准
- [Glossary](docs/99-glossary.md): 统一术语表
- [Jobs](jobs/README.md): 北京大厂 Agent / LLM 相关岗位要求
- [Papers](papers/README.md): Agent 相关论文、阅读队列和研究洞察
@@ -47,4 +61,14 @@
- `seed`: 初始想法或待整理材料
- `wip`: 正在验证或补充
- `validated`: 有项目、实验或可靠资料支撑
- `completed`: 约定范围内的工作已经完成,但不等于结论永久有效
- `failed`: 假设或路径未通过验证,保留证据和替代方向
- `deprecated`: 已不推荐使用,但保留原因和替代方案
## Validate
```bash
python3 tools/check_project.py
git diff --check
web/manage.sh status
```
+158
View File
@@ -0,0 +1,158 @@
# Project Status
last_reviewed: 2026-07-12
baseline_before_handoff: `ab758e7`
branch: `main`
remote: `https://git.k1412.top/wuyang/agent.git`
## Purpose
The repository began as a durable Agent knowledge base and now has two layers:
1. a collection layer for papers, Beijing jobs, and company Agent work;
2. an experimental knowledge interface and research layer intended to turn the collection into evidence-backed understanding.
The long-term product is not “a place to browse papers.” It should help the user retain claims, connect them into a personal model, test that model, and use it to reason about unfamiliar Agent problems.
## Current Snapshot
The deterministic index currently contains 989 items:
| Collection | Count | State |
| --- | ---: | --- |
| papers | 974 | 959 queued, 15 skimmed |
| jobs | 6 | 4 active, 2 unknown |
| industry | 9 | 8 analyzed, 1 queued |
The expanded arXiv run saw 1,506 candidates, promoted 970 high-recall candidates, and retained 536 reserve candidates. These are collection counts, not quality or reading-completion counts.
The memory topic has two intentionally different counts:
- 296 indexed items have the broad `memory` topic, including non-paper streams;
- 293 local paper items were resolved for the dedicated memory audit.
The memory research snapshot contains:
| Stage | Count |
| --- | ---: |
| paginated arXiv candidates | 516 |
| lexical title-central upper bound | 379 |
| recent-six-month title-central candidates | 292 |
| PDFs downloaded and text-located during the audit | 32 |
| papers promoted into the evidence ledger | 23 |
The strongest current conclusion is that recent progress is concentrated in better diagnosis/evaluation and task-specific execution-state memory, not a universal memory architecture. Read `research/memory/findings.md` before making memory design claims.
## Artifact Map
| Area | Source of truth | What it contains |
| --- | --- | --- |
| entry/navigation | `README.md` | human-facing repository map |
| AI continuation | `AGENTS.md` | read order, contracts, commands |
| stable concepts | `docs/00-05*.md`, `docs/99-glossary.md` | knowledge map, principles, architecture, practice, evaluation, collection |
| current state | `docs/06-project-status.md` | counts, runtime, artifact inventory |
| exploration history | `docs/07-exploration-history.md` | accepted and rejected routes |
| continuation plan | `docs/08-next-work.md` | priorities and definition of done |
| jobs | `jobs/` | Beijing-first rolling six-month JD stream |
| papers | `papers/` | paper metadata, queue, notes, corpus summary |
| industry | `industry/` | official reports, blogs, products, benchmarks |
| collection runs | `collection-runs/` | queries, scope, counts, method notes |
| collection tools | `tools/collection/` | item creation, arXiv collection, promotion, indexing, URL checks |
| research | `research/memory/` | field findings and evidence ledger |
| research data | `data/research/` | committed corpus, screening, landscape and CSV ledger |
| research tools | `tools/research/` | paginated search, abstract fetch, screening, classification, landscape build |
| experiments | `experiments/knowledge-compilation/` | failed pilot and completed field audit |
| learning prototype | `learning/agent-memory/` | preserved failed 12-paper learning module |
| web application | `web/` | Atlas, search agent, paper reader/chat, Ollama actions |
| project integrity | `tools/check_project.py` | offline structural and data checks |
`projects/` and `references/` are still mostly scaffolding. They do not yet contain substantive project or general-reference catalogs.
## Data Lineage
```text
official/web/arXiv sources
-> jobs|papers|industry/items/*.md
-> tools/collection/build_index.py
-> data/index.json + data/summary.json
-> web/app.py
-> Atlas / search / paper reading UI
```
The dedicated memory audit is separate:
```text
paginated arXiv queries + local memory-tagged papers
-> data/research/* corpus snapshots
-> model-assisted triage + deterministic statistics
-> selected full-text experiment checks
-> research/memory/evidence-ledger.md
-> research/memory/findings.md
```
Do not merge these two lines silently. The first is a broad browsing corpus; the second is an evidence audit with explicit boundaries.
## Web Application
Capabilities currently implemented:
- topic Atlas with ECharts and SVG fallback;
- routes, timeline, topic focus and paper filtering;
- desktop/mobile responsive reader mode;
- local keyword search plus an Agent search loop;
- Chinese query interpretation and English keyword expansion;
- asynchronous search activity, aggregate statistics and AI brief;
- follow-up questions on a search result;
- per-paper abstract fetch, summary, translation, deep analysis and chat;
- single-concurrency Ollama access and local caches.
Run it with:
```bash
web/manage.sh start
web/manage.sh status
```
Expected addresses:
```text
local/Tailscale: http://100.114.68.27:18080
public mapping: https://lab.k1412.top/
health: /api/health
```
At the beginning of the 2026-07-12 handoff audit, no process was listening on 18080 and the public domain returned 502. The handoff added and enabled a user-level systemd service through `web/manage.sh`; local and public health then returned 200 with 974 papers and `ollama_ready: true`. Runtime status is still external state and must always be checked live.
The live Ollama inventory checked on 2026-07-12 included `ChatGPT-5.6:Luna`, `Terra`, `Sol`, `auto`, `embed`, and `gpt-4o:latest`. The web defaults were updated from stale `light/fast/large` tags to configurable Luna/Terra/Sol tiers.
## Runtime Constraints
- Python standard library only; no package installation is required for the current web server and collection scripts.
- Ollama endpoint defaults to `http://192.168.1.10:11434`.
- One V100 32G serves all local models; AI calls are serialized.
- Do not send `num_ctx` or `keep_alive` from clients. Server-side context and residency must remain authoritative.
- `Sol` is the expensive tier and should require an explicit user action.
- The user mentioned an unlimited company GPT-5.5 data-agent API as a possible stronger offline worker, but no endpoint/authentication contract is committed. It is not currently integrated.
- The public site has no repository-managed authentication or TLS configuration; the domain mapping is external infrastructure.
- The committed systemd unit assumes the checkout path `%h/Code/agent`; edit the unit if a future checkout uses a different path.
- Full PDFs and extracted text used during the memory audit were temporary working files and are not committed. Their arXiv IDs and claim boundaries are preserved in `research/memory/evidence-ledger.md` so they can be fetched again.
- `web/cache/` contents, including arXiv responses, AI outputs, service environment and logs, are intentionally not committed.
## Validation
Offline validation:
```bash
python3 tools/check_project.py
git diff --check
```
Live validation:
```bash
web/manage.sh status
curl -fsS http://100.114.68.27:18080/api/health | jq
curl -fsS https://lab.k1412.top/api/health | jq
```
The health payload reports app/assets versions, paper count, available/default models, and missing default model tags.
+159
View File
@@ -0,0 +1,159 @@
# Exploration History
last_reviewed: 2026-07-12
This is the decision history, including failed routes. Preserve it so future work does not rediscover the same lessons.
## 1. Repository and Content Streams
On 2026-07-08 the workspace was initialized as a long-lived Agent knowledge base, not a one-off report.
The first structure included stable knowledge, projects, experiments, references, and templates. It was then expanded into three first-class collection streams:
- `jobs/`: Beijing-focused Agent/LLM roles over a rolling six-month window;
- `papers/`: research evidence and reading queue;
- `industry/`: large-company reports, blogs, products, repositories, and benchmarks.
Decision retained: papers, jobs, and industry must not be mixed because they answer different questions. Their common organization layer is metadata/index/search, not a deep directory taxonomy.
Relevant commits: `47cea9d`, `1b6cc1f`, `36c2499`.
## 2. First Collection and Expanded Corpus
The first sweep created 21 items and the source/schema workflow. The expanded arXiv sweep then recalled 1,506 candidates and promoted 970 high-relevance candidates, bringing the paper corpus to 974.
What worked:
- source registries and explicit source quality;
- keeping candidate and promoted manifests;
- generated frontmatter plus a deterministic index;
- preserving `queued` as a truthful unread state.
What did not work:
- treating the resulting count as understanding;
- assuming auto tags were a stable taxonomy;
- using non-paginated/latest-only query results to infer historical trends.
Relevant artifacts: `collection-runs/`, `papers/corpus-summary-2026-07-08.md`, `data/arxiv-agent-*.json`.
Relevant commits: `1cbc98e`, `391b3a4`.
## 3. Paper Browser to Knowledge Atlas
The first frontend exposed search, filtering, paper preview, abstract fetch, translation, summary, and deep analysis. It evolved into a knowledge Atlas with topic nodes, co-occurrence, timelines, routes, desktop/mobile layouts, and an ECharts graph.
Further iterations fixed:
- cache busting and stale deployment confusion;
- an oversized Atlas payload;
- desktop scrolling and reader focus;
- mobile map centering;
- interactive graph visuals;
- app version visibility.
This produced a usable corpus browser, but the user later rated its practical learning value at effectively 0/100. The reason was not mainly visual quality: exploration was stateless, and nothing helped the user retain, compress, challenge, or apply knowledge.
Decision retained: the Atlas may remain an orientation surface, but it must not be treated as the product or as evidence of learning.
Relevant commits: `e783a7d` through `15b5cec`.
## 4. Search Agent and Per-Paper AI
Search was upgraded from keyword matching to a compact Agent loop:
```text
interpret query -> expand Chinese/English terms -> retrieve locally
-> aggregate dates/topics/trends -> generate brief -> allow follow-up
```
The UI initially exposed every fixed pipeline step. That looked mechanical, so it was simplified into one active status row with a changing task summary. Paper reading also gained multi-turn chat.
What worked:
- AI-assisted query interpretation and bilingual expansion;
- progressive activity updates instead of a blocking spinner;
- contextual follow-up over a bounded result set;
- serialized model use and caching.
What remained insufficient:
- AI actions were still centered on individual papers or a single search;
- the system did not maintain claims, contradictions, the user's evolving model, or review state;
- a generated brief disappeared into another stateless browsing session.
Decision retained: future AI should operate at the claim/evidence/model level, not merely summarize or translate documents.
Relevant commits: `894c914`, `4892e7a`.
## 5. Ollama Integration Lessons
The application originally sent client-side context/residency parameters. The user identified that a `num_ctx` mismatch could restart a model and clear residency, and that `keep_alive` behavior could unload it.
The fix was to let the Ollama server own both settings. The application now only sends generation options such as temperature and output length, serializes calls, and caches results.
On 2026-07-12 the live model inventory no longer contained the old `light/fast/large` tags used by the web app. The defaults were changed to configurable tiers backed by the currently available Luna/Terra/Sol tags, and health now reports model mismatches.
Decision retained: always verify `/api/tags`; never infer deployed model aliases from old documentation.
Relevant commits: `47c301c`, `ac6e0e0`, and the 2026-07-12 handoff update.
## 6. Learning-System Reframing
The user clarified the real objective with three levels:
1. complete memory of important knowledge;
2. compression into a coherent network/system;
3. abstraction that can explain why approaches exist and generate recommendations for new goals.
The desired system is a scaffold from raw papers to internalized judgment. The user expects Codex or another strong AI to be an active research partner, not merely an orchestrator for small local models.
This reframing invalidated “paper site” as the primary product definition.
## 7. Failed 12-Paper Learning Pilot
The first response to the reframing compiled 12 Agent Memory papers into a map, chapter, evidence matrix, active recall, and machine-readable module.
The user rejected it because:
- 12 papers were too few for a field-level trend;
- it felt like a lecture rather than joint research;
- it did not answer what 200+ papers were doing;
- it did not compare current failures with six months earlier;
- it did not establish whether architecture gains were attributable.
The experiment is explicitly `failed` in `experiments/knowledge-compilation/2026-07-10-agent-memory-pilot.md`. Its artifacts remain under `learning/agent-memory/` only as historical material.
Decision retained: a polished educational package is not valuable until the underlying field audit and the user's own learning interaction are validated.
Relevant commit: `36c631e`.
## 8. Agent Memory Field Audit
The failed pilot was replaced with a broader research audit:
- five paginated arXiv queries;
- 516 unique abstract-level candidates;
- complete local screening as triage;
- exact recent/prior six-month windows;
- 32 downloaded/text-located papers;
- 23 papers in an evidence ledger with explicit non-extrapolation boundaries.
The most useful findings were negative or diagnostic:
- retrieval quality often matters more than elaborate write structures for static QA;
- model and embedding choices can reverse architecture conclusions;
- update/forgetting and automatic writing remain unsolved;
- execution-state memory is the clearest task-specific capability direction;
- memory can interfere with other Agent components;
- cost and no-memory baselines are mandatory.
This audit is the current research baseline. Read `research/memory/findings.md` and `research/memory/evidence-ledger.md` rather than the old learning module.
Relevant commit: `ab758e7`.
## 9. Current Position
The repository now has a strong collection substrate, a functioning exploration prototype, and one evidence-led field audit. It does not yet have the stateful personal learning/internalization layer that motivated the project.
The next meaningful experiment is not another graph redesign or another bulk paper sweep. It is one end-to-end learning path that records a user's claims, evidence judgments, contradictions, applications, and later recall, using the memory audit as its first evidence base.
+167
View File
@@ -0,0 +1,167 @@
# Next Work
last_reviewed: 2026-07-12
## P0: Build One Stateful Learning Path
Use Agent Memory as the first vertical slice, but do not reuse the failed 45-minute lecture format.
The unit of interaction should be a claim, not a paper. A minimal claim object needs:
```text
question
claim
supporting evidence
counterevidence
confidence
scope / failure boundary
prerequisites
related claims
user judgment
last reviewed / next review
```
The first path should contain a small number of consequential claims from the existing audit, for example:
- strong retrieval can dominate write complexity on static QA;
- current-value maintenance is distinct from retrieval;
- execution-state memory is different from historical recall;
- automatic experience promotion requires evidence and rollback;
- memory can have negative marginal value inside an Agent scaffold.
The interaction should progressively reveal:
```text
problem -> current hypothesis -> evidence -> conflicting evidence
-> user judgment -> application to a new design -> delayed recall
```
Persist the user's state. Merely rendering these sections is not enough.
### P0 Data Work
Define a versioned, inspectable local schema before adding a database. Suggested initial files:
```text
data/learning/claims.json
data/learning/user-model.json
data/learning/reviews.jsonl
```
Requirements:
- every claim links back to evidence-ledger entries;
- user notes and AI synthesis remain distinguishable;
- claim updates preserve history;
- confidence changes record a reason;
- review records are append-only;
- no generated summary can silently replace source evidence.
### P0 AI Roles
Use AI above the per-paper level:
- evidence auditor: check whether a claim is actually supported;
- contradiction finder: surface papers that challenge the current model;
- synthesis maintainer: update the claim network when evidence changes;
- research partner: help the user reason through an unfamiliar target;
- review generator: create recall/application prompts from validated claims.
Use Luna for cheap classification, Terra for retrieval briefs and bounded dialogue, and Sol only for explicit synthesis/critique. The user also has a company GPT-5.5 data-agent API with effectively unlimited tokens, but integration must wait until its endpoint, auth, rate behavior, and data policy are documented.
### P0 Validation
Do not judge success by page completion or time spent. Validate whether the user can:
1. explain five claims without paper names;
2. identify the evidence boundary of each claim;
3. diagnose a new Agent memory design;
4. predict when memory will hurt;
5. recover the model after 1, 3, and 7 days;
6. change a belief when presented with counterevidence.
## P1: Connect Research to the Frontend
The current Atlas/search/reader can remain, but it should feed the stateful path:
- selecting a topic opens its unresolved questions and claims, not only a paper list;
- selecting a paper shows which claims it supports or challenges;
- search results can be promoted into an evidence review queue;
- paper chat can create a candidate claim, never an automatically accepted fact;
- the primary desktop focus should shift to the active research/learning task;
- mobile should preserve the same conceptual flow with fewer simultaneous panes.
Avoid another navigation-heavy redesign before the data and learning loop exist.
## P1: Continue Collection Selectively
Current gaps:
- only 6 JD items, last checked 2026-07-08;
- only 9 industry items;
- 959 of 974 paper items are still queued;
- paper source approval and automated collection policy need an explicit user decision;
- the corpus is heavily biased toward May-July 2026 and broad arXiv query terms.
Next collection work should be question-driven:
- refresh Beijing DeepSeek/Tencent/ByteDance/Alibaba/Baidu roles and record changes;
- add official company material that explains memory, evaluation, coding agents, or computer use;
- deepen only papers that challenge or extend current claims;
- do not add another thousand papers without a processing and evidence plan.
After any item changes:
```bash
python3 tools/collection/build_index.py
python3 tools/check_project.py
```
## P2: Research Refresh Protocol
When refreshing the memory audit or starting another topic:
1. define exact date windows and approved sources;
2. save the broad candidate snapshot;
3. separate deterministic filters from model triage;
4. identify comparable benchmarks and controlled studies;
5. read experiments, ablations, costs, and limitations in full text;
6. update an evidence ledger before writing conclusions;
7. preserve negative results and failed hypotheses;
8. record the run under `experiments/` and update project status.
Do not compare raw scores across papers unless model, embedding, prompt, visible information, and budget are controlled.
## P2: Operations
Still missing:
- public-domain deployment documentation outside this repository;
- authentication/authorization for a public or multi-user site;
- automated backup for future personal learning state;
- CI that runs `tools/check_project.py` on push;
- tests for web API behavior and frontend flows.
The repository now has an enabled user-level systemd service managed through `web/manage.sh`. It restarts on failure and survives user sessions because linger is enabled on the current host, but it is not a complete production deployment: proxy/TLS/auth configuration remains external.
## Explicit Non-Goals
- Do not make the graph more decorative as the next milestone.
- Do not present 974 queued papers as knowledge already learned.
- Do not revive the 12-paper lecture as the primary path.
- Do not use per-paper summary/translation as the main AI value proposition.
- Do not let AI write durable memory solely because a statement repeats in traces.
- Do not hide model, embedding, context, or cost changes inside an architecture comparison.
## First Continuation Task
The best next task for another AI is:
1. read the memory findings and evidence ledger;
2. define the claim/user-state/review schemas;
3. compile 5-8 audited claims into a stateful local dataset;
4. implement one progressive learning/research view;
5. run it with the user and record what changes in their understanding;
6. keep or discard the interaction model based on that evidence.
That is the shortest path from the current corpus browser toward the actual goal.
+3 -1
View File
@@ -6,7 +6,9 @@
| ID | Hypothesis | Status | Result | Link |
| --- | --- | --- | --- | --- |
| KC-001 | 主题卷宗比论文列表更适合形成可检验认知 | running | 已完成 Agent Memory 第一轮编译,待真实学习反馈 | [记录](knowledge-compilation/2026-07-10-agent-memory-pilot.md) |
| KC-001 | 12 篇主题卷宗足以形成 Agent Memory 领域认知 | failed | 样本和归因不足,输出像讲课,用户认知没有提高 | [记录](knowledge-compilation/2026-07-10-agent-memory-pilot.md) |
| KC-002 | 分页语料、受控对比和证据账本能支持领域进展判断 | completed | 建立 516 篇候选、32 篇全文池和 23 篇证据账本,得到可审计结论 | [记录](knowledge-compilation/2026-07-10-agent-memory-field-audit.md) |
| OPS-001 | 完整仓库交接可以让无会话上下文的 AI 继续工作 | completed | 增加状态、历史、下一步、完整性检查、模型校验和 systemd 服务管理 | [记录](operations/2026-07-12-project-handoff-audit.md) |
## Experiment Rules
@@ -0,0 +1,62 @@
# Project Handoff Audit
status: completed
date: 2026-07-12
baseline_commit: `ab758e7`
## Objective
Make the repository sufficient for another AI to clone, validate, understand prior decisions, run the service, and continue the actual product goal without access to the original conversation.
## Initial Findings
- Git was clean and synchronized with `origin/main` at `ab758e7`.
- Content and research artifacts were committed, but there was no single AI continuation entrypoint.
- The root README described repository sections but not current completion, failed routes, runtime state, or next priorities.
- The 12-paper learning pilot was marked failed in its experiment file, while `experiments/README.md`, `learning/README.md`, and `module.json` still described it as an active pilot.
- The web process was stopped; `lab.k1412.top` returned 502.
- The web app requested stale `light/fast/large` model tags. Live Ollama exposed Luna/Terra/Sol instead.
- Ordinary `nohup` passed one health check but was reaped with the Codex command session, so it was not a reliable service manager.
## Changes
- Added `AGENTS.md` with read order, truth hierarchy, commands, and repository contracts.
- Added project status, exploration history, and continuation plan under `docs/06-08`.
- Added `tools/check_project.py` for deterministic item/index/research/syntax/contract checks.
- Reconciled failed-pilot status across learning and experiment indexes.
- Made Ollama model tiers configurable and aligned defaults with live Luna/Terra/Sol tags.
- Added model readiness and missing-default reporting to `/api/health`.
- Added an enabled user-level systemd service and `web/manage.sh` lifecycle commands.
- Updated web and root documentation with product boundaries and operations.
## Validation Performed
Offline:
- parsed every committed JSON research/learning file used by the checker;
- verified 989 indexed items match 6 job, 974 paper, and 9 industry files;
- verified the memory snapshots remain 516 candidates, 379 title-central, and 293 local paper records;
- parsed all Python files under `tools/` and `web/app.py` with `ast`;
- asserted the web client does not send `num_ctx` or `keep_alive`;
- ran `git diff --check`.
Live:
- verified Tailscale address `100.114.68.27` exists;
- verified Ollama inventory and all default model tags;
- started the Atlas as `agent-knowledge-atlas.service`;
- verified `/api/health`, `/api/models`, `/api/atlas`, `/`, and the public mapped domain;
- verified the Atlas reports 974 papers, 15 topics, 5 routes, and 13 timeline buckets;
- completed one real paper-summary request through the web API with Luna in 5.32 seconds.
## External State Boundary
Git contains the application, unit file, management script, and documentation. The following remain external:
- Gitea credentials and credential helper;
- Cloudflare/reverse-proxy/TLS mapping for `lab.k1412.top`;
- Ollama model manifests and server residency/context configuration;
- the company GPT-5.5 data-agent endpoint and credentials.
- temporary full-paper PDFs/text and regenerable web caches.
Future handoffs must verify those live rather than treating this record as permanent state.
+2 -1
View File
@@ -15,5 +15,6 @@
| Module | Question | Status | Entry |
| --- | --- | --- | --- |
| Agent Memory | Agent 怎样把历史压缩成能改善未来决策的状态? | pilot | [开始学习](agent-memory/README.md) |
| Agent Memory | Agent 怎样把历史压缩成能改善未来决策的状态? | failed pilot | [查看失败试验](agent-memory/README.md) |
当前目录保留的是第一次知识编译试验,不代表已验证学习路径。新的 Agent Memory 研究基线位于 [findings](../research/memory/findings.md) 和 [evidence ledger](../research/memory/evidence-ledger.md)。下一轮应先实现可持久化的 claim、user model 和 review 状态,再验证学习效果。
+3 -2
View File
@@ -1,6 +1,8 @@
# Agent Memory:从存储历史到编译经验
status: pilot
status: failed
> 本模块已判定失败并由更广的 field audit 取代。保留这些文件是为了记录尝试,不应把它当作当前领域结论或已验证学习路径。请先阅读 [最新结论](../../research/memory/findings.md)、[证据账本](../../research/memory/evidence-ledger.md) 和 [失败记录](../../experiments/knowledge-compilation/2026-07-10-agent-memory-pilot.md)。
## 这次真正要学会什么
@@ -62,4 +64,3 @@ status: pilot
- 锚点论文来自现有一年语料中的 12 篇,另外约 300 篇 memory 标签论文暂作证据池。
- 已阅读锚点论文原文的关键方法、实验和限制部分,但尚未逐项复现实验。
- 论文集中在 2026 年,结论可能受新 benchmark、强模型和评测协议变化影响。
+2 -1
View File
@@ -1,7 +1,8 @@
{
"id": "agent-memory-pilot",
"title": "Agent Memory: 从存储历史到编译经验",
"status": "pilot",
"status": "failed",
"superseded_by": "research/memory/findings.md",
"version": 1,
"created_at": "2026-07-10",
"estimated_minutes": 45,
+135
View File
@@ -0,0 +1,135 @@
#!/usr/bin/env python3
"""Run deterministic repository integrity checks without external services."""
from __future__ import annotations
import ast
import json
from collections import Counter
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
COLLECTIONS = ("jobs", "papers", "industry")
REQUIRED_FILES = (
"AGENTS.md",
"README.md",
"docs/06-project-status.md",
"docs/07-exploration-history.md",
"docs/08-next-work.md",
"data/index.json",
"data/summary.json",
"research/memory/findings.md",
"research/memory/evidence-ledger.md",
"web/app.py",
"web/agent-knowledge-atlas.service",
"web/manage.sh",
)
def load_json(path: str):
return json.loads((ROOT / path).read_text(encoding="utf-8"))
def require(condition: bool, message: str) -> None:
if not condition:
raise AssertionError(message)
def check_required_files() -> None:
missing = [path for path in REQUIRED_FILES if not (ROOT / path).is_file()]
require(not missing, f"missing required files: {', '.join(missing)}")
def check_collection_index() -> dict[str, int]:
index = load_json("data/index.json")
summary = load_json("data/summary.json")
require(isinstance(index, list), "data/index.json must be an array")
paths = [str(item.get("path") or "") for item in index]
require(len(paths) == len(set(paths)), "data/index.json contains duplicate paths")
missing_paths = [path for path in paths if not (ROOT / path).is_file()]
require(not missing_paths, f"index points to missing files: {missing_paths[:5]}")
indexed = Counter(str(item.get("collection") or "") for item in index)
filesystem = {
collection: sum(
1
for path in (ROOT / collection / "items").glob("*.md")
if path.name != "README.md"
)
for collection in COLLECTIONS
}
require(dict(indexed) == filesystem, f"index/file count mismatch: {dict(indexed)} != {filesystem}")
require(summary.get("total") == len(index), "summary total does not match index")
require(summary.get("by_collection") == filesystem, "summary collection counts are stale")
return filesystem
def check_research_data() -> dict[str, int]:
expanded = load_json("data/research/agent-memory-expanded.json")
screened = load_json("data/research/agent-memory-screened.json")
landscape = load_json("data/research/memory-landscape.json")
corpus = load_json("data/research/memory-corpus.json")
candidate_count = len(expanded.get("papers", []))
require(expanded.get("unique_papers") == candidate_count, "expanded memory count mismatch")
require(screened.get("total") == candidate_count, "screen total mismatch")
require(screened.get("completed") == candidate_count, "memory screening is incomplete")
require(len(screened.get("papers", [])) == candidate_count, "screen paper count mismatch")
require(landscape.get("source_candidates") == candidate_count, "landscape source count mismatch")
require(corpus.get("resolved") == len(corpus.get("papers", [])), "local memory corpus mismatch")
return {
"memory_candidates": candidate_count,
"memory_title_central": int(landscape.get("title_central") or 0),
"memory_local_topic": int(corpus.get("resolved") or 0),
}
def check_python_syntax() -> int:
paths = sorted((ROOT / "tools").rglob("*.py")) + [ROOT / "web" / "app.py"]
for path in paths:
ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
return len(paths)
def check_ollama_contract() -> None:
source = (ROOT / "web" / "app.py").read_text(encoding="utf-8")
require('"num_ctx"' not in source, "web app must not override Ollama num_ctx")
require('"keep_alive"' not in source, "web app must not override Ollama keep_alive")
def check_experiment_state() -> None:
module = load_json("learning/agent-memory/module.json")
require(module.get("status") == "failed", "old learning pilot must remain marked failed")
pilot = (ROOT / "experiments/knowledge-compilation/2026-07-10-agent-memory-pilot.md").read_text(
encoding="utf-8"
)
require("status: failed" in pilot, "pilot experiment status is stale")
def main() -> int:
check_required_files()
collections = check_collection_index()
research = check_research_data()
python_files = check_python_syntax()
check_ollama_contract()
check_experiment_state()
print(
json.dumps(
{
"ok": True,
"collections": collections,
"research": research,
"python_files_checked": python_files,
},
ensure_ascii=False,
indent=2,
)
)
return 0
if __name__ == "__main__":
raise SystemExit(main())
+41 -7
View File
@@ -4,6 +4,13 @@
## Run
```bash
web/manage.sh start
web/manage.sh status
```
前台调试仍可直接运行:
```bash
python3 web/app.py --host 100.114.68.27 --port 18080
```
@@ -30,17 +37,40 @@ https://lab.k1412.top/
## AI Policy
- 默认摘要模型:`ChatGPT-5.6:fast`
- 默认翻译模型:`ChatGPT-5.6:light`
- 深度分析模型:`ChatGPT-5.6:large`,只在前端手动选择时使用
- Atlas 解释:`ChatGPT-5.6:fast`
- 主题导读、阅读路径、主题比较:`ChatGPT-5.6:large`,只在前端手动确认后调用
- Search Agent 查询理解:`ChatGPT-5.6:light`
- Search Agent 结果简报、搜索追问、论文对话:`ChatGPT-5.6:fast`
- 默认摘要模型:`ChatGPT-5.6:Terra`
- 默认翻译模型:`ChatGPT-5.6:Luna`
- 深度分析模型:`ChatGPT-5.6:Sol`,只在前端手动选择时使用
- Atlas 解释:`ChatGPT-5.6:Terra`
- 主题导读、阅读路径、主题比较:`ChatGPT-5.6:Sol`,只在前端手动确认后调用
- Search Agent 查询理解:`ChatGPT-5.6:Luna`
- Search Agent 结果简报、搜索追问、论文对话:`ChatGPT-5.6:Terra`
- Ollama 请求单并发执行,并缓存结果到 `web/cache/ai/`
- 应用侧不下发 `num_ctx` / `keep_alive`,上下文长度和模型常驻由 Ollama 服务端统一控制
- arXiv 摘要缓存到 `web/cache/arxiv/`
模型 tier 可以覆盖:
```bash
OLLAMA_MODEL_LIGHT=ChatGPT-5.6:Luna \
OLLAMA_MODEL_FAST=ChatGPT-5.6:Terra \
OLLAMA_MODEL_LARGE=ChatGPT-5.6:Sol \
web/manage.sh restart
```
`/api/health` 会返回可用模型、默认模型和缺失的默认标签。维护时先看健康接口,不要假设旧 alias 仍存在。
## Service Management
```bash
web/manage.sh start
web/manage.sh stop
web/manage.sh restart
web/manage.sh status
web/manage.sh logs
```
`manage.sh` 会把仓库中的 `agent-knowledge-atlas.service` 链接到用户级 systemd,并把可覆盖环境写入忽略提交的 `web/cache/service.env`。日志使用 systemd journal。它不替代 TLS、反向代理或鉴权。
## Knowledge Design
先由后端从本地语料轻量计算:
@@ -62,3 +92,7 @@ https://lab.k1412.top/
- 搜索意图理解、关键词扩展、结果简报
- 基于搜索结果继续追问
- 基于单篇论文继续对话式研读
## Product Boundary
当前 Atlas 是资料探索原型,不是已经验证的学习产品。用户对“只浏览论文、图谱和 AI 摘要”的实用性评价很低,因为它没有保存个人理解、主张、反证、应用和复习状态。后续产品方向见 `docs/08-next-work.md`,不要把下一阶段继续收敛为图谱视觉优化。
+22
View File
@@ -0,0 +1,22 @@
[Unit]
Description=Agent Knowledge Atlas
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=%h/Code/agent
Environment=PYTHONUNBUFFERED=1
Environment=OLLAMA_URL=http://192.168.1.10:11434
Environment=OLLAMA_MODEL_LIGHT=ChatGPT-5.6:Luna
Environment=OLLAMA_MODEL_FAST=ChatGPT-5.6:Terra
Environment=OLLAMA_MODEL_LARGE=ChatGPT-5.6:Sol
Environment=HOST=100.114.68.27
Environment=PORT=18080
EnvironmentFile=-%h/Code/agent/web/cache/service.env
ExecStart=/usr/bin/python3 %h/Code/agent/web/app.py --host ${HOST} --port ${PORT}
Restart=on-failure
RestartSec=3
[Install]
WantedBy=default.target
+28 -13
View File
@@ -31,7 +31,7 @@ CACHE_ROOT = WEB_ROOT / "cache"
ARXIV_CACHE = CACHE_ROOT / "arxiv"
AI_CACHE = CACHE_ROOT / "ai"
OLLAMA_URL = os.environ.get("OLLAMA_URL", "http://192.168.1.10:11434").rstrip("/")
ASSET_VERSION = "atlas-20260709-01"
ASSET_VERSION = "atlas-20260712-01"
def detect_app_version() -> str:
@@ -51,18 +51,22 @@ def detect_app_version() -> str:
APP_VERSION = detect_app_version()
MODEL_LIGHT = os.environ.get("OLLAMA_MODEL_LIGHT", "ChatGPT-5.6:Luna")
MODEL_FAST = os.environ.get("OLLAMA_MODEL_FAST", "ChatGPT-5.6:Terra")
MODEL_LARGE = os.environ.get("OLLAMA_MODEL_LARGE", "ChatGPT-5.6:Sol")
DEFAULT_MODELS = {
"translate": "ChatGPT-5.6:light",
"summary": "ChatGPT-5.6:fast",
"deep": "ChatGPT-5.6:large",
"atlas": "ChatGPT-5.6:fast",
"topic": "ChatGPT-5.6:large",
"path": "ChatGPT-5.6:large",
"compare": "ChatGPT-5.6:large",
"search_plan": "ChatGPT-5.6:light",
"search_summary": "ChatGPT-5.6:fast",
"search_followup": "ChatGPT-5.6:fast",
"paper_chat": "ChatGPT-5.6:fast",
"translate": MODEL_LIGHT,
"summary": MODEL_FAST,
"deep": MODEL_LARGE,
"atlas": MODEL_FAST,
"topic": MODEL_LARGE,
"path": MODEL_LARGE,
"compare": MODEL_LARGE,
"search_plan": MODEL_LIGHT,
"search_summary": MODEL_FAST,
"search_followup": MODEL_FAST,
"paper_chat": MODEL_FAST,
}
NS = {
@@ -1376,12 +1380,20 @@ class PaperBrowserHandler(SimpleHTTPRequestHandler):
def handle_health(self) -> None:
papers, _ = load_papers()
ollama_ok = False
available_models: list[str] = []
try:
request = urllib.request.Request(f"{OLLAMA_URL}/api/tags")
with urllib.request.urlopen(request, timeout=3) as response:
ollama_ok = response.status == 200
except (urllib.error.URLError, TimeoutError):
payload = json.loads(response.read().decode("utf-8"))
available_models = sorted(
str(item.get("name"))
for item in payload.get("models", [])
if item.get("name")
)
except (urllib.error.URLError, TimeoutError, json.JSONDecodeError):
ollama_ok = False
missing_default_models = sorted(set(DEFAULT_MODELS.values()) - set(available_models))
write_json(
self,
{
@@ -1391,6 +1403,9 @@ class PaperBrowserHandler(SimpleHTTPRequestHandler):
"asset_version": ASSET_VERSION,
"ollama_url": OLLAMA_URL,
"ollama_ok": ollama_ok,
"ollama_ready": ollama_ok and not missing_default_models,
"available_models": available_models,
"missing_default_models": missing_default_models,
"default_models": DEFAULT_MODELS,
},
)
Executable
+89
View File
@@ -0,0 +1,89 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
UNIT_NAME="agent-knowledge-atlas.service"
UNIT_SOURCE="$ROOT/web/$UNIT_NAME"
UNIT_TARGET="$HOME/.config/systemd/user/$UNIT_NAME"
ENV_FILE="$ROOT/web/cache/service.env"
HOST="${HOST:-100.114.68.27}"
PORT="${PORT:-18080}"
HEALTH_URL="${HEALTH_URL:-http://$HOST:$PORT/api/health}"
write_environment() {
mkdir -p "$(dirname "$ENV_FILE")"
{
printf 'HOST=%s\n' "$HOST"
printf 'PORT=%s\n' "$PORT"
printf 'OLLAMA_URL=%s\n' "${OLLAMA_URL:-http://192.168.1.10:11434}"
printf 'OLLAMA_MODEL_LIGHT=%s\n' "${OLLAMA_MODEL_LIGHT:-ChatGPT-5.6:Luna}"
printf 'OLLAMA_MODEL_FAST=%s\n' "${OLLAMA_MODEL_FAST:-ChatGPT-5.6:Terra}"
printf 'OLLAMA_MODEL_LARGE=%s\n' "${OLLAMA_MODEL_LARGE:-ChatGPT-5.6:Sol}"
} >"$ENV_FILE"
}
install_unit() {
mkdir -p "$(dirname "$UNIT_TARGET")"
ln -sfn "$UNIT_SOURCE" "$UNIT_TARGET"
write_environment
systemctl --user daemon-reload
}
wait_for_health() {
for _ in $(seq 1 30); do
if curl -fsS --max-time 2 "$HEALTH_URL" >/dev/null 2>&1; then
return 0
fi
sleep 0.5
done
return 1
}
start_server() {
install_unit
systemctl --user enable --now "$UNIT_NAME"
if ! wait_for_health; then
echo "Server did not become healthy" >&2
journalctl --user -u "$UNIT_NAME" -n 60 --no-pager >&2 || true
return 1
fi
echo "Agent Knowledge Atlas started"
echo "Health: $HEALTH_URL"
}
stop_server() {
if systemctl --user is-active --quiet "$UNIT_NAME"; then
systemctl --user stop "$UNIT_NAME"
echo "Agent Knowledge Atlas stopped"
else
echo "Agent Knowledge Atlas is not running"
fi
}
status_server() {
systemctl --user is-active "$UNIT_NAME"
curl -fsS --max-time 5 "$HEALTH_URL"
echo
}
case "${1:-status}" in
install)
install_unit
systemctl --user enable "$UNIT_NAME"
echo "Installed $UNIT_NAME"
;;
start) start_server ;;
stop) stop_server ;;
restart)
install_unit
systemctl --user restart "$UNIT_NAME"
wait_for_health
echo "Agent Knowledge Atlas restarted"
;;
status) status_server ;;
logs) journalctl --user -u "$UNIT_NAME" -n "${LINES:-80}" --no-pager ;;
*)
echo "Usage: $0 {install|start|stop|restart|status|logs}" >&2
exit 2
;;
esac
+15 -5
View File
@@ -141,7 +141,12 @@ async function loadHealth() {
try {
const health = await api("/api/health");
state.health = health;
elements.healthLine.textContent = `${health.paper_count} papers · ${health.ollama_ok ? "Ollama online" : "Ollama offline"}`;
const ollamaState = health.ollama_ready
? "Ollama ready"
: health.ollama_ok
? "Ollama model mismatch"
: "Ollama offline";
elements.healthLine.textContent = `${health.paper_count} papers · ${ollamaState}`;
} catch (error) {
elements.healthLine.textContent = error.message;
}
@@ -1103,10 +1108,15 @@ function setAiBusy(isBusy, label = "") {
}
}
function isLargeModel(model) {
const configuredLarge = state.health?.default_models?.deep;
return model === configuredLarge || /:(large|sol)$/i.test(model);
}
async function runPaperAi(mode) {
if (!state.selectedPaper) return;
const model = state.health?.default_models?.[mode] || (mode === "translate" ? "ChatGPT-5.6:light" : "ChatGPT-5.6:fast");
if (model.includes(":large") && !window.confirm("将调用 large 模型,占用更多 GPU。继续?")) return;
const model = state.health?.default_models?.[mode] || (mode === "translate" ? "ChatGPT-5.6:Luna" : "ChatGPT-5.6:Terra");
if (isLargeModel(model) && !window.confirm("将调用 large 模型,占用更多 GPU。继续?")) return;
setAiBusy(true, `${mode} · ${model}`);
try {
const payload = await api("/api/ai", {
@@ -1124,8 +1134,8 @@ async function runPaperAi(mode) {
}
async function runAtlasAi(mode, topic = "", topicB = "") {
const model = state.health?.default_models?.[mode] || "ChatGPT-5.6:fast";
if (model.includes(":large") && !window.confirm("将调用 large 模型做高维综合,占用更多 GPU。继续?")) return;
const model = state.health?.default_models?.[mode] || "ChatGPT-5.6:Terra";
if (isLargeModel(model) && !window.confirm("将调用 large 模型做高维综合,占用更多 GPU。继续?")) return;
setAiBusy(true, `${mode} · ${model}`);
try {
const payload = await api("/api/atlas/ai", {
+2 -2
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Agent Knowledge Atlas</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='12' fill='%23cfe8e3'/%3E%3Ctext x='32' y='40' text-anchor='middle' font-size='24' font-family='Arial' font-weight='700' fill='%23064c47'%3EAK%3C/text%3E%3C/svg%3E" />
<link rel="stylesheet" href="/static/styles.css?v=atlas-20260709-01" />
<link rel="stylesheet" href="/static/styles.css?v=atlas-20260712-01" />
</head>
<body>
<main class="atlas-app">
@@ -79,6 +79,6 @@
</footer>
</main>
<script src="/static/app.js?v=atlas-20260709-01"></script>
<script src="/static/app.js?v=atlas-20260712-01"></script>
</body>
</html>