Skip to content

Feat : Implement RAG System with HippoRAG & Milvus Integration, Fix Module Resolution and Test Mocks#20

Open
BingqingLyu wants to merge 5 commits into
mainfrom
fork-pr-469-main
Open

Feat : Implement RAG System with HippoRAG & Milvus Integration, Fix Module Resolution and Test Mocks#20
BingqingLyu wants to merge 5 commits into
mainfrom
fork-pr-469-main

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

TLDR

Complete RAG (Retrieval-Augmented Generation) system implementation with HippoRAG, Milvus vector database integration, and automated file watching capabilities. Fixes TypeScript module resolution issues and adds comprehensive test coverage.

Dive Deeper

This PR introduces a full-featured RAG system that enables intelligent code retrieval and context-aware responses. The implementation includes:

Core Components Added:

  • MilvusCodeStorage: Vector database integration for storing code chunks with embeddings
  • HippoRAG: High-level API wrapper for RAG operations
  • RAGService: Service layer for application integration
  • FileWatcherService: Automatic RAG updates when files change
  • retrieve-code & update-rag: CLI tools for manual RAG operations

Technical Improvements:

  • Fixed ECMAScript module resolution by adding .js extensions to all TypeScript imports
  • Resolved test mocking issues in MilvusCodeStorage tests
  • Added proper error handling for undefined values in collection operations
  • Updated system prompt to include RAG integration instructions

Architecture:

  • Uses Milvus as the vector database for semantic code search
  • Implements chunked code storage with metadata
  • Provides both programmatic API and CLI tools
  • Includes automated file watching for real-time updates

Reviewer Test Plan

To validate this change works correctly:

  1. Run the test suite:

    npm run test --workspace=packages/core --if-present -- --testNamePattern="MilvusCodeStorage"
    npm run test --workspace=packages/core --if-present -- --testNamePattern="HippoRAG"
    npm run test --workspace=packages/core --if-present -- --testNamePattern="RAGService"
  2. Test the RAG tools:

    # Test retrieve functionality
    node -e "import('./packages/core/src/rag/index.js').then(async ({ retrieveCode }) => { console.log(await retrieveCode('function declaration', 3)); })"
    
    # Test update functionality
    node -e "import('./packages/core/src/rag/index.js').then(async ({ updateRag }) => { await updateRag('test.ts', 'const test = () => console.log(\"hello\");'); console.log('Updated'); })"
  3. Integration test:

    • Create a test file with some TypeScript code
    • Use the file watcher to verify automatic updates
    • Query for relevant code snippets

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

  • Resolves TypeScript module resolution issues with .js extensions
  • Fixes undefined value handling in Milvus collection operations
  • Addresses missing RAG components in the codebase
  • Closes potential runtime errors in vector database interactions

- Fixed ECMAScript import path extensions by adding .js extensions to all relative imports
- Added missing RAG components: FileWatcherService, retrieve-code, and update-rag
- Fixed MilvusCodeStorage test mocks to properly handle undefined values
- Updated system prompt to include RAG integration instructions
- All RAG tests now passing: MilvusCodeStorage (5/5), HippoRAG (4/4), RAGService (4/4)
- Resolved TypeScript module resolution issues
@BingqingLyu BingqingLyu added conflicting-group-1 conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs and removed conflicting-pr labels May 7, 2026
@BingqingLyu

BingqingLyu commented May 7, 2026

Copy link
Copy Markdown
Owner Author

Conflict Group 1

This PR shares modified functions with 6 other PR(s): #114, #117, #14, #17, #65, #94.

These PRs should be reviewed as a batch — merging one may affect the others.

Function File Also modified by
getCoreSystemPrompt prompts.ts #65
main gemini.tsx #14, #17, #94
main esbuild.js #114, #117
graph LR
    PR20["PR #20"]
    FgetCoreSystemPrompt_4267["getCoreSystemPrompt<br>prompts.ts"]
    PR20 -->|modifies| FgetCoreSystemPrompt_4267
    PR65["PR #65"]
    PR65 -->|modifies| FgetCoreSystemPrompt_4267
    Fmain_4875["main<br>gemini.tsx"]
    PR20 -->|modifies| Fmain_4875
    PR14["PR #14"]
    PR14 -->|modifies| Fmain_4875
    PR17["PR #17"]
    PR17 -->|modifies| Fmain_4875
    PR94["PR #94"]
    PR94 -->|modifies| Fmain_4875
    Fmain_9588["main<br>esbuild.js"]
    PR20 -->|modifies| Fmain_9588
    PR114["PR #114"]
    PR114 -->|modifies| Fmain_9588
    PR117["PR #117"]
    PR117 -->|modifies| Fmain_9588
Loading

Posted by codegraph-ai conflict detection.

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

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants