KS
Killer-Skills

rag — how to use RAG how to use RAG, RAG query guide, FAISS vector database tutorial, RAG alternative, RAG vs AutoRegMonkey, RAG install, RAG setup guide, econometrics AI agent, Bruce Hansen RAG

v1.0.0
GitHub

About this Skill

Perfect for Econometrics Agents needing advanced FAISS vector database querying capabilities. RAG is a query skill that allows AI agents to access a FAISS vector database, providing econometric knowledge and insights based on Bruce Hansen's teachings.

Features

Utilizes FAISS vector database for efficient querying
Executes Python scripts using the user's Python environment
Returns formatted query results for easy interpretation
Supports UTF-8 encoding for robust character handling
Leverages Bruce Hansen's econometrics textbook as its knowledge base

# Core Topics

rukikotoo rukikotoo
[6]
[1]
Updated: 12/10/2025

Quality Score

Top 5%
36
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add rukikotoo/AutoRegMonkey

Agent Capability Analysis

The rag MCP Server by rukikotoo is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use RAG, RAG query guide, FAISS vector database tutorial.

Ideal Agent Persona

Perfect for Econometrics Agents needing advanced FAISS vector database querying capabilities.

Core Value

Empowers agents to query the FAISS vector database built on Bruce Hansen's econometrics textbook, utilizing Python scripts and UTF-8 encoded I/O for precise econometric model analysis and development.

Capabilities Granted for rag MCP Server

Querying econometric models
Analyzing RAG knowledge base
Executing Python scripts for data analysis

! Prerequisites & Limits

  • Requires Python environment
  • FAISS vector database dependency
  • Database location fixed to D:\\AutoRegMonkey\\database\\rag_db\\
Project
SKILL.md
4.5 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

RAG 查询技能

此技能允许代理查询计量经济学RAG知识库,该知识库基于Bruce Hansen的计量经济学教材构建。

概述

  • 数据库类型: FAISS 向量数据库
  • 数据库位置: D:\AutoRegMonkey\database\rag_db\

使用方法

当用户输入以"rag:"开头时,执行以下步骤:

  1. 提取查询问题: 识别"rag:"后面的查询文本
  2. 调用Python脚本: 使用用户的Python环境执行RAG查询
  3. 返回结果: 将查询结果格式化后呈现给用户

Python 脚本模板

强制Python I/O用UTF-8:sys.stdout.reconfigure(encoding='utf-8') 和 sys.stderr.reconfigure(encoding='utf-8') 使用以下Python代码进行查询:

python
1import sys 2sys.path.append(r"D:\AutoRegMonkey\database") 3from rag_query import EconometricsRAG 4sys.stdout.reconfigure(encoding='utf-8') 5sys.stderr.reconfigure(encoding='utf-8') 6 7# 初始化RAG 8rag = EconometricsRAG() 9 10# 执行查询(从用户输入中提取的问题) 11results = rag.query("用户的问题", n_results=5) 12 13# 处理并输出结果 14output_lines = [] 15for i, r in enumerate(results): 16 chunk = r['chunk'] 17 score = r['score'] 18 output_lines.append(f"【结果 {i+1}】 - 来源: 第{chunk['page']}页, 相似度: {score:.4f}") 19 output_lines.append(f"{chunk['text'][:500]}{'...' if len(chunk['text']) > 500 else ''}") 20 output_lines.append("---") 21 22print("\n".join(output_lines))

通过Bash执行

在Bash工具中使用以下命令:

bash
1"C:\Users\29165\anaconda3\python.exe" -c " 2import sys 3sys.path.append(r'D:\AutoRegMonkey\database') 4from rag_query import EconometricsRAG 5 6rag = EconometricsRAG() 7results = rag.query('用户的问题', n_results=5) 8 9for i, r in enumerate(results): 10 chunk = r['chunk'] 11 score = r['score'] 12 print(f'【结果 {i+1}】 - 来源: 第{chunk[\"page\"]}页, 相似度: {score:.4f}') 13 print(f'{chunk[\"text\"][:500]}{\"...\" if len(chunk[\"text\"]) > 500 else \"\"}') 14 print('---') 15"

注意:将'用户的问题'替换为实际查询文本。

查询示例

示例1: 基础查询

用户输入: rag:什么是OLS回归?

执行代码:

bash
1"C:\Users\29165\anaconda3\python.exe" -c " 2import sys 3sys.path.append(r'D:\AutoRegMonkey\database') 4from rag_query import EconometricsRAG 5 6rag = EconometricsRAG() 7results = rag.query('什么是OLS回归?', n_results=5) 8 9for i, r in enumerate(results): 10 chunk = r['chunk'] 11 score = r['score'] 12 print(f'【结果 {i+1}】 - 来源: 第{chunk[\"page\"]}页, 相似度: {score:.4f}') 13 print(f'{chunk[\"text\"][:500]}{\"...\" if len(chunk[\"text\"]) > 500 else \"\"}') 14 print('---') 15"

示例2: 获取LLM上下文

如果需要在其他分析中使用RAG上下文,可以使用get_context()方法:

python
1context = rag.get_context("heteroskedasticity robust standard errors", n_results=3) 2print(context)

示例3: 按页码搜索

python
1chunks = rag.search_by_page(page_number=100) 2for chunk in chunks: 3 print(f"第{chunk['page']}页: {chunk['text'][:200]}")

文件组织

  • 原始数据: D:\AutoRegMonkey\database\rag_db\ (FAISS索引和文档块)
  • 查询接口: D:\AutoRegMonkey\database\rag_query.py
  • API文档: D:\AutoRegMonkey\database\RAG_API_说明.md

注意事项

  1. Python环境: 使用用户的Anaconda Python环境 (C:\Users\29165\anaconda3\python.exe)
  2. 路径引用: 确保正确引用包含空格或特殊字符的路径
  3. 结果数量: 默认返回5个最相关结果,可根据需要调整n_results参数
  4. 输出格式: 保持输出整洁,限制文本长度以便阅读
  5. 错误处理: 如果查询失败,检查数据库路径和Python模块导入

高级用法

与其他技能结合

此技能可与autoregmonkey技能结合使用,在计量经济学分析过程中实时查询相关知识:

  1. 用户输入以"autoregmonkey:"开头的计量任务
  2. 在分析过程中,使用RAG技能查询相关计量理论
  3. 将查询结果融入分析报告

批量查询

对于复杂问题,可执行多次查询以获取全面信息:

python
1queries = ["OLS regression", "heteroskedasticity", "instrumental variables"] 2for q in queries: 3 results = rag.query(q, n_results=2) 4 # 处理结果...

故障排除

  • 导入错误: 确保sys.path.append(r'D:\AutoRegMonkey\database')已添加
  • 模块未找到: 检查rag_query.py文件是否存在
  • 数据库错误: 确认D:\AutoRegMonkey\database\rag_db\目录包含必要文件
  • 编码问题: 使用encoding='utf-8'处理中英文文本

Related Skills

Looking for an alternative to rag or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication