Skip to main content

Testing Guide - RAG Knowledge Base

πŸ§ͺ How to Test the RAG Tools​

Now that the RAG tools are integrated into the Ask and Architect modes, you can test them by following these steps:

1. Install the Updated Version​

  1. Close VS Code
  2. Uninstall the previous version of Reasoning (if any)
  3. Install the new version: ai-cockpit-reasoning-3.0.0-pre.1.vsix
  4. Open VS Code

2. Check if RAG is Initialized​

  1. Open the VS Code developer console (F12)
  2. Look for this message in the console:
    RAG Knowledge Base Manager started

3. Test in Ask Mode​

  1. Open Reasoning
  2. Switch to "Ask" mode (important!)
  3. Test the following commands:

Test 1: Add Knowledge​

Add to the knowledge base: "React is a JavaScript library for building user interfaces. It was developed by Facebook and allows creating reusable components."

Expected result: Reasoning should use the add_rag_knowledge tool and confirm that the item was added.

Test 2: Search Knowledge​

Search the knowledge base for information about React

Expected result: Reasoning should use the search_rag_knowledge tool and return the item that was added.

Test 3: List Knowledge​

List all items from the knowledge base

Expected result: Reasoning should use the list_rag_knowledge tool and show all items.

Test 4: Get Statistics​

Show the knowledge base statistics

Expected result: Reasoning should use the get_rag_stats tool and display statistics.

4. Test in Architect Mode​

  1. Switch to "Architect" mode
  2. Test the same command:
    Add to the knowledge base: "TypeScript is a superset of JavaScript that adds static typing. It was developed by Microsoft."

5. Verify it doesn't work in other modes​

  1. Switch to "Code" mode
  2. Try the same command:
    Add to the knowledge base: "Test"

Expected result: Reasoning should create an MD file in the project (old behavior), as the "Code" mode does not have access to RAG tools.

6. Check the Saved Data​

The data is saved in:

  • macOS: ~/Library/Application Support/Code/User/globalStorage/roo-code.ai-cockpit-reasoning/knowledge-base/knowledge-base.json

Check if the file was created and contains the added data.

7. Troubleshooting​

If the tools do not appear:​

  1. Make sure you are in "Ask" or "Architect" mode
  2. Check the console for errors
  3. Restart VS Code

If RAG does not initialize:​

  1. Check the console for the "RAG Knowledge Base Manager started" message
  2. If it doesn't appear, there might be an initialization error

If data does not persist:​

  1. Check the permissions of the data directory
  2. Check for available disk space

8. Real-World Usage Examples​

Add Project Documentation:​

Add to the knowledge base: "This project uses React 18 with TypeScript. The folder structure follows the src/components, src/hooks, src/utils pattern. Global state is managed with Zustand."

Add Code Snippets:​

Add to the knowledge base: "To create a custom hook in React: const useCustomHook = () => { const [state, setState] = useState(); return { state, setState }; };"

Search for Solutions:​

Search the knowledge base for solutions to state issues in React