Skip to content

[OMEGA-503] feat(rag): add opt-in background knowledge indexing - #393

Open
amxson wants to merge 5 commits into
singnet:mainfrom
amxson:codex/background-knowledge-indexing
Open

amxson wants to merge 5 commits into
singnet:mainfrom
amxson:codex/background-knowledge-indexing

Conversation

@amxson

@amxson amxson commented Oct 12, 2026 •

Copy link
Copy Markdown

Description

Knowledge indexing currently blocks startup until changed files are embedded. This adds opt-in knowledgeIndexingBackground so plugins and channels can start while knowledge becomes available progressively.

Indexing uses the runtime Chroma collection. The setting defaults to false, preserving the existing synchronous behavior.

Closes #384.

How Has This Been Tested?

  • Added coverage for synchronous/background indexing, duplicate workers, and failure logging.
  • Verified progressive retrieval and runtime memory with persistent Chroma.
  • Python, PeTTa, and mandatory autotests pass.

Checklist

  • PR contains autogenerated code
  • Self-review completed
  • Test scenarios above are passed with the version of the code from PR

@aquashade aquashade changed the title feat(rag): add opt-in background knowledge indexing [OMEGA-503] feat(rag): add opt-in background knowledge indexing Oct 14, 2026
Comment thread src/rag.py
"CHROMA_DB_PATH",
"/PeTTa/chroma_db" if os.path.isdir("/PeTTa/chroma_db") else
os.path.join(_PROJECT_ROOT, "..", "..","chroma_db")
)

@timur-ashkenov timur-ashkenov Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@amxson Is dropping CHROMA_DB_PATH here intentional? Import/export still use it, while lib_chromadb uses ./chroma_db. Could that make them point to different databases when a custom path is set?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch. I restored CHROMA_DB_PATH handling while keeping RAG and runtime on the same shared collection. I also resolve the paths before comparing them so equivalent paths don’t open another client.

Comment thread src/rag.py Outdated
if background:
try:
_knowledge_worker = threading.Thread(
target=_index_knowledge,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The thread drops the result returned by _index_knowledge(), so we never see the final summary or “no files found” message. Could we log it when the worker finishes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, fixed. The background worker now logs the result from _index_knowledge(), including the normal summary and the no-files case.

@timur-ashkenov timur-ashkenov left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@amxson Both fixes look good, thanks! Could you update the branch with the latest main so we can run CI before merging?

@amxson

amxson commented Oct 16, 2026

Copy link
Copy Markdown
Author

Updated with latest main. Local tests pass, including the mandatory suite.

@amxson
amxson force-pushed the codex/background-knowledge-indexing branch from b2ff437 to 085d423 Compare October 16, 2026 20:02
@aquashade aquashade added the new-feature New feature or request label Oct 16, 2026
@aquashade
aquashade requested a review from paul-v-snet October 19, 2026 10:47

This branch has not been deployed

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

Labels

new-feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OMEGA-503] Index knowledge priors in the background so the agent is available immediately at startup

3 participants