feat(personalization): Personalization pipeline with Mem0 memory integration and terminal chat mode#540
Merged
aiosfoundation merged 15 commits intoApr 15, 2026
Conversation
…/personalization
fixed dependency issues
Fix/ollama tests
Fix/ollama tests
aiosfoundation
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Personalization pipeline with Mem0 memory integration and terminal chat mode
Summary
This PR adds a personalization pipeline to AIOS that enables context-aware LLM responses based on prior interactions. It includes memory storage/retrieval via Mem0, ChromaDB persistence infrastructure, dynamic Ollama model discovery, and a new terminal chat mode with intelligent intent routing.
Changes
1. Personalization Pipeline (
aios/memory/,aios/syscall/)aios/memory/context_injector.py): Retrieves relevant memories from Mem0 before each chat LLM call and prepends them as a system message. Filters by relevance score and respects a configurable token budget.aios/memory/conversation_extractor.py): After each chat LLM call, stores the user+assistant exchange as a memory via a background daemon thread. Never blocks the LLM response.aios/syscall/syscall.py): Wired intoSyscallExecutor.execute_request()foraction_type="chat"queries. ContextInjector runs before the LLM call, ConversationExtractor runs after. Personalization is only active in chat mode — file operations (action_type="operate_file") bypass the pipeline entirely.runtime/launch.py): Personalization components initialized duringinitialize_components()whenmemory.provideris"mem0".2. Mem0 Provider Enhancements (
aios/memory/providers/mem0.py)chromadb.PersistentClientto bypass Mem0 v1.0.11's deprecatedchromadb.Client(Settings(...))which is always in-memory in ChromaDB 1.5.5. Resolves paths to absolute, creates the persistence directory automatically.pathis configured for ChromaDB, defaults to.mem0/chromarelative to the project root.3. Terminal Chat Mode (
aios/terminal/,scripts/run_terminal.py,runtime/run_terminal.py)aios/terminal/intent_router.py): Two-stage intent classifier — keyword heuristic (zero latency) with LLM fallback for ambiguous inputs. Classifies user input as chat or file operation./auto(default, intelligent routing),/chat(all input →llm_chat()with personalization),/file(all input →llm_operate_file()).[auto],[chat], or[file]to indicate current mode.scripts/run_terminal.pyandruntime/run_terminal.pyupdated with identical routing behavior.4. Kernel Stability (
runtime/launch.py)uvicorn.run("runtime.launch:app")touvicorn.run(app)and added_ensure_initialized()guard. Components now initialize exactly once.5. Configuration & CI
aios/config/config.yaml.example: Addedqwen3:4bmodel,pathoption for ChromaDB, personalization settings documentation.requirements.txt: Addedhypothesisfor property-based testing..github/workflows/test-ollama.yml: CI pulls bothqwen3:1.7bandqwen3:4b..github/workflows/test-qdrant.yml: Minor CI updates..gitignore: Added.mem0/directory.New Files
aios/memory/context_injector.pyaios/memory/conversation_extractor.pyaios/terminal/__init__.pyaios/terminal/intent_router.pytests/modules/llm/ollama/test_dynamic_registration_pbt.pytests/modules/memory/__init__.pyTesting
Known Limitations
Error 61 connecting to localhost:6379) are pre-existing — the LSFS file watcher tries to connect to Redis which isn't running locally.