Skip to content

Add agentic local knowledge and API service foundation#14

Merged
2002yy merged 1 commit into
mainfrom
codex/agentic-local-knowledge
Jun 5, 2026
Merged

Add agentic local knowledge and API service foundation#14
2002yy merged 1 commit into
mainfrom
codex/agentic-local-knowledge

Conversation

@2002yy
Copy link
Copy Markdown
Owner

@2002yy 2002yy commented Jun 5, 2026

Summary

  • add a controlled local-knowledge retrieval tool with deterministic intent gating, rewrite retry, explicit not-found behavior, and FastAPI exposure
  • reuse that retrieval boundary in Streamlit single chat and WeChat interactive replies
  • expand FastAPI with RAG status/upload, non-streaming chat, memory preview/commit, and session list/flush endpoints
  • update README and docs to record P7/P8 status, 290-test baseline, and P9 React + Vite + TypeScript direction

Verification

  • python -m pytest -q -> 290 passed
  • python -m ruff check .
  • python -m mypy --explicit-package-bases src
  • detect-secrets scan --disable-plugin KeywordDetector --exclude-files '.*\.(pyc|jpg|png|zip)$' .github README.md docs src tests tools config templates roles changelog assets .env.example -> results {}
  • python tools\package_project_helper.py . NUL 0 -> OK: 374 files, forward-slash verified
  • git diff --check

@2002yy 2002yy merged commit f38da26 into main Jun 5, 2026
2 checks passed
@2002yy 2002yy deleted the codex/agentic-local-knowledge branch June 5, 2026 15:54
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 552dd97687

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/api.py
Comment on lines +275 to +278
filename = Path(uploaded.filename or "document").name
target = RAG_UPLOAD_DIR / filename
target.write_bytes(await uploaded.read())
saved_paths.append(target)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make uploaded filenames unique before indexing

When a multipart request includes two files with the same basename, this loop writes both to logs/rag_uploads/<name> and appends the same Path twice, so the later upload overwrites the earlier one and index_documents indexes duplicate copies of the last file while silently dropping the first. This can happen when users upload files with the same name from different folders; reject duplicate basenames or assign unique destinations before indexing.

Useful? React with 👍 / 👎.

Comment thread src/api.py
Comment on lines +472 to +476
if update.target == "current_focus" and not update.append:
path = memory_writer.write_current_focus(update.content.strip())
action = "replace"
else:
path = memory_writer.append_memory(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor append=false outside current_focus

When a client sends append=false for any target other than current_focus, /memory/preview reports action="replace", but /memory/commit falls through to append_memory and returns action="append". That makes the preview/commit contract misleading and causes a requested replacement of targets like progress or summary to append a new section instead; either implement replacement for those targets or reject/normalize append=false during preview.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant