Skip to content

Workshop toggle ext memory#3

Merged
nkanu17 merged 42 commits into
mainfrom
workshop-toggle-ext-memory
Mar 26, 2026
Merged

Workshop toggle ext memory#3
nkanu17 merged 42 commits into
mainfrom
workshop-toggle-ext-memory

Conversation

@nkanu17

@nkanu17 nkanu17 commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Broadly moved all content into the ws folder under /materials (where the toggle will occur)

Removed :
- progressive_agents_guide.md
- CONTENT_COVERAGE_GAP_ANALYSIS.md
- Deleted tests folder
- Deleted docker_compose, readme, requirements.txt, and setup.md, UVlock, as they are not necessary in this setup

Note to Nitin:
Do we need the /arch folder in the notebooks directory?
Adding test changes to test toggle in ps portal
@nkanu17 nkanu17 force-pushed the workshop-toggle-ext-memory branch 2 times, most recently from 32ef38f to 5e6eead Compare March 25, 2026 20:32
dpatlut and others added 23 commits March 25, 2026 16:36
update gitignore for node_modules
fix: Update all paths after moving content into materials/ws/ folder

Notebooks - folder check "workshop" → "notebooks":
- notebooks/02_rag_essentials.ipynb
- notebooks/03_data_engineering_theory.ipynb
- notebooks/04_memory_systems.ipynb

Notebooks - removed outdated Colab link:
- notebooks/01_introduction_to_context_engineering.ipynb

progressive_agents - parents[2] → parents[1] (19 files):
- stage1_baseline_rag/cli.py
- stage2_context_engineered/cli.py
- stage3_full_agent_without_memory/cli.py, debug_search.py
- stage4_hybrid_search/cli.py, test_hybrid_search.py, test_react_agent.py
- stage5_working_memory/cli.py, debug_search.py, test_*.py (8 test files)
- stage6_full_memory/cli.py, debug_search.py, test_*.py (5 test files)

progressive_agents/agent - parent.parent → parent.parent.parent:
- stage1_baseline_rag/agent/nodes.py
- stage2_context_engineered/agent/nodes.py
- stage3_full_agent_without_memory/agent/tools.py

debug_search.py - removed erroneous /src/ from .env path:
- stage3_full_agent_without_memory/debug_search.py
- stage5_working_memory/debug_search.py
- stage6_full_memory/debug_search.py

pyproject.toml - demos → progressive_agents:
- Updated 6 CLI entry points
- Updated wheel packages list

Edit to Litellm boot time in start.sh
Increasing timeout for start.sh
Changed connection defaults from localhost to Docker service names:
- Redis: redis://localhost:6379 → redis://redis:6379
- Agent Memory Server: http://localhost:8088 → http://agent-memory-server:8000
…ical_manager

- Replace text-embedding-ada-002 with text-embedding-3-small (3 places)
- Update comment to reflect correct model name
- Fixes embedding model not available error in LiteLLM proxy
- Update HybridQuery to use combination_method='RRF' (industry best practice)
- Add documentation for RRF vs LINEAR combination methods
- Replace deprecated alpha parameter with rrf_window/rrf_constant
- Update code comments to reflect FT.HYBRID command (Redis 8.4+)
- Improve explanation of hybrid search results
- Add HybridQuery import for FT.HYBRID command (Redis 8.4+)
- Implement three search strategies: hybrid, exact_match, semantic_only
- Use RRF combination method as default (industry best practice)
- Add LINEAR combination support with configurable linear_alpha
- Use course_manager.embeddings pattern (matches university code)
- Remove separate _get_embeddings() helper function
- Add department filtering support for hybrid queries
Add Part 3: Hybrid Search to stage_2_data_engineered_rag.ipynb:

- Introduction explaining what hybrid search is and why it matters
- Real-world scenarios showing when semantic/keyword search fail alone
- Industry adoption context (Elasticsearch, Pinecone, Weaviate, Redis)
- Detailed comparison of RRF vs LINEAR combination methods
- RedisVL implementation examples with HybridQuery
- Four code examples: basic RRF, LINEAR weighting, filters, comparison
- Best practices and decision table for search type selection
- Updated wrap-up section with hybrid search takeaways
- Add chat_notebooks directory with stage1_chat, stage4_chat, stage6_chat notebooks
- Add chat_ui.py and chat_interface.py for Stage 1, 4, 6 agents
- Update __init__.py exports to include start_chat functions
- Fix Agent Memory Server port mapping in docker-compose.yml (8000:8000)
- Use Docker service names (redis:6379, agent-memory-server:8000) by default
- Match university materials configuration for seamless Docker execution
nkanu17 added 10 commits March 25, 2026 16:36
Notebook fixes:
- Add nest_asyncio.apply() to 01-1 and 01-2 for async support
- Fix path stage2_data_engineered -> stage2_context_engineered in 01-2
- Fix module import data_engineering -> context_engineering in 01-2
- Add None check to count_tokens() in 02-1
- Fix token efficiency calculation in 02-1

Dependency updates (requirements.txt):
- Add langchain-experimental>=0.3.0 (SemanticChunker)
- Add langchain-text-splitters>=0.3.0 (RecursiveCharacterTextSplitter)
- Add langchain-huggingface>=0.1.0 (HuggingFaceEmbeddings)
- Add sentence-transformers>=2.0.0 (semantic chunking backend)
- Add nest-asyncio>=1.5.0 (Jupyter async support)
- Add jupyter>=1.0.0 and ipykernel>=6.0.0
- Add pypdf>=3.0.0 (PDF parsing)

Dependency updates (pyproject.toml):
- Add nest-asyncio>=1.5.0
- Add version constraint to pypdf>=3.0.0

All notebooks now execute successfully:
- 01-1_baseline_rag.ipynb
- 01-2_data_engineered_rag.ipynb
- 02-1_data_engineering_theory.ipynb
- 03-1_memory_systems.ipynb
Removed old notebooks (replaced with new naming convention):
- 01_introduction_to_context_engineering.ipynb
- 02_rag_essentials.ipynb
- 03_data_engineering_theory.ipynb
- 04_memory_systems.ipynb
- stage6_chat.ipynb (duplicate, kept chat_notebooks/stage6_chat.ipynb)

Updated chat notebooks with collapsible cells and fixes:
- chat_notebooks/stage0_chat.ipynb
- chat_notebooks/stage1_chat.ipynb
- chat_notebooks/stage6_chat.ipynb

Other updates:
- arch/03_progressive_agents_demo.ipynb
- stage1_baseline_rag/agent/nodes.py
Workshop notebooks (materials/ws/):
- Remove LOCAL_DEV environment variable detection and conditional logic
- Use Docker service names directly (redis:6379, litellm:4000, agent-memory-server:8000)
- Clear stale notebook outputs containing localhost URLs

University materials (materials/university/):
- Update Agent Memory Server URL from localhost:8088 to agent-memory-server:8000
- Fix CLI files and notebooks to use correct Docker service names

Files updated:
- 11 workshop notebooks
- 4 university files (stage5/stage6 CLI, query_long_term_memory.py, stage_5_working_memory.ipynb)
Change Path('') to Path('..') to correctly resolve project root from notebooks directory
…dency

- Move notebooks to numbered subdirectories (00/, 01/, 02/, 03/)
- Add university memory notebooks (stage_5_working_memory, stage_6_full_memory)
- Copy missing test files to progressive_agents
- Update all path references for new directory structure
- Replace HuggingFaceEmbeddings with OpenAIEmbeddings in semantic chunking
- Remove sentence-transformers and langchain-huggingface dependencies
@nkanu17 nkanu17 force-pushed the workshop-toggle-ext-memory branch from 5e6eead to 19d0daa Compare March 25, 2026 20:54
nkanu17 added 2 commits March 25, 2026 17:00
…ming

## Standalone Notebook Setup
- All notebooks now run locally without any manual environment wiring
- Environment loading moved into agent package __init__.py files so
  importing the agent is sufficient to bootstrap all config
- Added LOCAL=true flag to root .env as the single switch for local
  overrides; portal environments are completely unaffected

## Hidden Environment Configuration
- stage1_baseline_rag/agent/__init__.py: added load_dotenv + LOCAL key mapping
- stage2_context_engineered/agent/__init__.py: same pattern
- stage3_full_agent_without_memory/agent/__init__.py: same pattern
- stage4_hybrid_search/agent/__init__.py: same pattern
- stage5_working_memory/agent/__init__.py: added load_dotenv + RAMS/Redis URL mapping
- stage6_full_memory/agent/__init__.py: added load_dotenv + RAMS/Redis URL mapping
- src/redis_context_course/__init__.py: load_dotenv runs before redis_config
  singleton is created, fixing import-order race condition

## Topic-Based Rebranding (Stage N -> Descriptive Names)
Removed all 'Stage 0-6' labels from notebook titles, headings, and
narrative. Replaced with consistent topic names throughout:
  Stage 0 -> System Prompts
  Stage 1 -> Baseline RAG
  Stage 2 -> Data-Engineered RAG
  Stage 3 -> Hierarchical Retrieval
  Stage 4 -> Hybrid Search
  Stage 5 -> Working Memory
  Stage 6 -> Long-Term Memory

Cross-notebook transitions updated to reference topic names rather than
stage numbers (e.g. 'In Stage 2 you will...' -> 'In the next notebook,
Data-Engineered RAG, you will...').

## Notebook Restructuring
- Renamed rag_deepdive.ipynb -> workshop_rag_deepdive.ipynb
- Replaced stage_5_working_memory.ipynb and stage_6_full_memory.ipynb
  with 03/01_working_memory.ipynb and 03/02_working_and_longterm_memory.ipynb
- Removed old memory_systems.ipynb
- chat_notebooks/stage0_chat and stage6_chat titles and print statements updated

## README
- Added full local setup and testing instructions to materials/ws/README.md
- Documents .env config, venv setup, and how to run/test each notebook
@nkanu17 nkanu17 force-pushed the workshop-toggle-ext-memory branch from 19d0daa to 4c273d6 Compare March 25, 2026 21:08
@jit-ci

jit-ci Bot commented Mar 25, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

🚨 Summary

• Two critical vulnerabilities found in Python dependencies

• LangChain Text Splitters vulnerable to XXE attacks

• LangChain Experimental allows arbitrary code execution

🔍 Findings

CRITICAL - 1 finding CRITICAL
1. LangChain Experimental Arbitrary Code Execution
ID Type Finding File Severity
2916931f43 GHSA-p2qj-r53j-h3xj LangChain Experimental Arbitrary Code Execution - LangChain Experimental allows attackers to execute arbitrary code through sympy.sympify in LLMSymbolicMathChain. This is a critical severity vulnerability with no fix available yet. requirements.txt (lines 19-19) CRITICAL

🔍 AI Analysis: This is a critical severity vulnerability that allows arbitrary code execution. It poses a significant security risk to the application and its users, especially since there's no fix available yet.

HIGH - 1 finding HIGH
1. LangChain Text Splitters XXE Vulnerability
ID Type Finding File Severity
65ee141caa GHSA-m42m-m8cr-8m58 LangChain Text Splitters XXE Vulnerability - LangChain Text Splitters is vulnerable to XML External Entity (XXE) attacks due to unsafe XSLT parsing. This allows attackers to read arbitrary local files or perform outbound HTTP(S) fetches. requirements.txt (lines 20-20) HIGH

🔍 AI Analysis: This is a high severity vulnerability in a dependency that could lead to unauthorized access to sensitive files. It affects a user-facing component and could be exploited without authentication.

Remediation:

- langchain-text-splitters>=0.3.0
+ langchain-text-splitters==0.3.9

▶️ Advanced Options

Help section with supported ignore actions and syntax.

Need to ignore a finding? Use commands like:

@sera ignore <finding_id> reason:accepted (reason is optional)

@sera ignore all reason:other - this is a test PR (reason is optional)

@sera ignore type:GHSA-p2qj-r53j-h3xj

@sera ignore type:GHSA-m42m-m8cr-8m58


Security scan by Jit

@jit-ci

jit-ci Bot commented Mar 26, 2026

Copy link
Copy Markdown

❌ Jit Scanner failed - Our team is investigating

Jit Scanner failed - Our team has been notified and is working to resolve the issue. Please contact support if you have any questions.


💡 Need to bypass this check? Comment @sera bypass to override.

PS Portal's Jupyter runs on ipykernel which starts its own event loop. asyncio.get_event_loop() returns that running loop, and then loop.run_until_complete() throws RuntimeError: This event loop is already running because you can't call run_until_complete on an already-running loop.
@nkanu17 nkanu17 merged commit 932a4ef into main Mar 26, 2026
1 of 2 checks passed
@jit-ci

jit-ci Bot commented Mar 26, 2026

Copy link
Copy Markdown

❌ Jit Scanner failed - Our team is investigating

Jit Scanner failed - Our team has been notified and is working to resolve the issue. Please contact support if you have any questions.


💡 Need to bypass this check? Comment @sera bypass to override.

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.

2 participants