#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 企业经营AI智能体网站问答数据库 创建SQLite数据库,包含50条问答对 """ import sqlite3 import json from datetime import datetime def create_database(): """创建SQLite数据库和表结构""" conn = sqlite3.connect('/root/老业务网站8.30/ai_agent_qa.db') cursor = conn.cursor() # 创建问答表 cursor.execute(''' CREATE TABLE IF NOT EXISTS qa_pairs ( id INTEGER PRIMARY KEY AUTOINCREMENT, question TEXT NOT NULL, answer TEXT NOT NULL, category TEXT NOT NULL, keywords TEXT, language TEXT DEFAULT 'zh', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ''') # 创建索引 cursor.execute('CREATE INDEX IF NOT EXISTS idx_category ON qa_pairs(category)') cursor.execute('CREATE INDEX IF NOT EXISTS idx_language ON qa_pairs(language)') cursor.execute('CREATE INDEX IF NOT EXISTS idx_keywords ON qa_pairs(keywords)') conn.commit() return conn def insert_qa_data(conn): """插入问答数据""" cursor = conn.cursor() # 问答数据 qa_data = [ # 公司介绍类 (1-10) { "question": "你们公司是做什么的?", "answer": "我们专注于打造AI自动运行的知识型网站,让网站成为企业营销和服务客户的有效工具。通过AI技术,我们帮助企业构建智能化的网站生态系统。", "category": "公司介绍", "keywords": "公司,业务,服务,AI,网站", "language": "zh" }, { "question": "What does your company do?", "answer": "We specialize in creating AI-automated knowledge-based websites that serve as powerful marketing tools and customer service platforms for enterprises. Through AI technology, we help businesses build intelligent website ecosystems.", "category": "Company Introduction", "keywords": "company,business,service,AI,website", "language": "en" }, { "question": "你们提供什么服务?", "answer": "我们提供三种核心网站解决方案:营销型网站让AI持续输出营销内容,提升Google推荐效果;知识型网站增强客户粘性,让客户持续访问;问答型网站精准匹配用户需求,让用户感受到专业服务。", "category": "服务介绍", "keywords": "服务,营销,知识,问答,网站", "language": "zh" }, { "question": "What services do you provide?", "answer": "We provide three core website solutions: Marketing websites that use AI to continuously output marketing content and improve Google recommendations; Knowledge websites that enhance customer stickiness; Q&A websites that precisely match user needs with professional service.", "category": "Service Introduction", "keywords": "service,marketing,knowledge,Q&A,website", "language": "en" }, { "question": "你们的优势是什么?", "answer": "我们的核心优势是通过AI自动运行机制,网站能够24小时不间断地为客户提供有价值的内容和服务,实现营销自动化,提升客户体验,让网站成为企业最有效的营销和服务工具。", "category": "公司介绍", "keywords": "优势,AI,自动化,营销,服务", "language": "zh" }, { "question": "What are your advantages?", "answer": "Our core advantage is that through AI automation, websites can provide valuable content and services to customers 24/7, achieving marketing automation, improving customer experience, and making websites the most effective marketing and service tools for enterprises.", "category": "Company Introduction", "keywords": "advantage,AI,automation,marketing,service", "language": "en" }, { "question": "你们的目标客户是谁?", "answer": "我们的目标客户是需要通过网站进行营销推广、客户服务、知识管理的企业,特别是那些希望实现营销自动化、提升客户体验、增强品牌影响力的企业。", "category": "客户定位", "keywords": "目标客户,企业,营销,服务,自动化", "language": "zh" }, { "question": "Who are your target customers?", "answer": "Our target customers are enterprises that need website-based marketing, customer service, and knowledge management, especially those looking to achieve marketing automation, improve customer experience, and enhance brand influence.", "category": "Customer Targeting", "keywords": "target,customers,enterprise,marketing,automation", "language": "en" }, { "question": "你们的技术实力如何?", "answer": "我们拥有强大的AI技术团队,专注于自然语言处理、机器学习、知识图谱等前沿技术,能够为企业提供定制化的AI解决方案,确保网站智能化运行。", "category": "技术实力", "keywords": "技术,AI,团队,解决方案,智能化", "language": "zh" }, { "question": "What is your technical capability?", "answer": "We have a strong AI technical team, specializing in natural language processing, machine learning, knowledge graphs and other cutting-edge technologies, providing customized AI solutions for enterprises to ensure intelligent website operation.", "category": "Technical Capability", "keywords": "technology,AI,team,solution,intelligent", "language": "en" }, # 产品功能类 (11-25) { "question": "营销功能具体包括什么?", "answer": "营销功能包括:通过AI的知识自动处理,自动产生知识内容和问答内容;产生更多长尾关键词,提升网站搜索覆盖面;通过SEO系统优化工作,让Google更容易推荐和持续抓取。主要应用于企业官网营销、品牌推广、SEO优化、内容营销、用户获取等场景。", "category": "产品功能", "keywords": "营销,AI,SEO,关键词,内容", "language": "zh" }, { "question": "What does the marketing function include?", "answer": "Marketing functions include: automatically generating knowledge and Q&A content through AI processing; creating more long-tail keywords to improve website search coverage; optimizing SEO systems to make Google easier to recommend and continuously crawl. Mainly applied to corporate website marketing, brand promotion, SEO optimization, content marketing, and user acquisition.", "category": "Product Features", "keywords": "marketing,AI,SEO,keywords,content", "language": "en" }, { "question": "知识功能有什么特点?", "answer": "知识功能的特点包括:通过AI持续进行内容输出,保持内容更新;增加AI智能回复,让用户觉得网站有价值;让客户持续访问网站,让用户增长知识增加粘性。主要应用于企业内部知识管理、客户教育、专业咨询等场景。", "category": "产品功能", "keywords": "知识,AI,内容,价值,粘性", "language": "zh" }, { "question": "What are the features of the knowledge function?", "answer": "Knowledge function features include: continuous content output through AI to maintain content updates; adding AI intelligent responses to make users feel the website is valuable; keeping customers continuously visiting the website to increase user knowledge and stickiness. Mainly applied to internal knowledge management, customer education, and professional consulting.", "category": "Product Features", "keywords": "knowledge,AI,content,value,stickiness", "language": "en" }, { "question": "问答功能如何工作?", "answer": "问答功能通过AI智能分析用户问题,从知识库中匹配最相关的答案,提供精准的回复。系统能够理解用户意图,提供专业、准确的回答,让用户感受到专业服务,提升客户满意度。", "category": "产品功能", "keywords": "问答,AI,智能,知识库,服务", "language": "zh" }, { "question": "How does the Q&A function work?", "answer": "The Q&A function uses AI to intelligently analyze user questions, match the most relevant answers from the knowledge base, and provide precise responses. The system can understand user intent, provide professional and accurate answers, making users feel professional service and improving customer satisfaction.", "category": "Product Features", "keywords": "Q&A,AI,intelligent,knowledge,service", "language": "en" }, { "question": "AI如何自动产生内容?", "answer": "我们的AI系统通过深度学习算法,分析企业提供的资料、产品信息、行业知识等,自动生成相关的文章、问答、产品介绍等内容。系统会持续学习用户反馈,不断优化内容质量,确保内容的专业性和准确性。", "category": "技术原理", "keywords": "AI,内容,自动,学习,优化", "language": "zh" }, { "question": "How does AI automatically generate content?", "answer": "Our AI system uses deep learning algorithms to analyze enterprise materials, product information, industry knowledge, etc., automatically generating relevant articles, Q&A, product introductions, and other content. The system continuously learns from user feedback, constantly optimizing content quality to ensure professionalism and accuracy.", "category": "Technical Principles", "keywords": "AI,content,automatic,learning,optimization", "language": "en" }, { "question": "网站如何提升SEO效果?", "answer": "我们通过AI自动生成高质量、原创的内容,包含丰富的长尾关键词;优化网站结构,提升页面加载速度;建立内链体系,提升页面权重;持续更新内容,保持网站活跃度,从而提升在搜索引擎中的排名。", "category": "SEO优化", "keywords": "SEO,内容,关键词,排名,优化", "language": "zh" }, { "question": "How does the website improve SEO effectiveness?", "answer": "We use AI to automatically generate high-quality, original content with rich long-tail keywords; optimize website structure to improve page loading speed; build internal link systems to increase page weight; continuously update content to maintain website activity, thereby improving search engine rankings.", "category": "SEO Optimization", "keywords": "SEO,content,keywords,ranking,optimization", "language": "en" }, { "question": "支持哪些语言版本?", "answer": "我们支持中文、英文、泰语、越南语四种语言版本,能够根据用户浏览器语言自动跳转到相应版本,为不同地区的客户提供本地化的服务体验。", "category": "多语言支持", "keywords": "语言,多语言,本地化,国际化", "language": "zh" }, { "question": "What language versions do you support?", "answer": "We support Chinese, English, Thai, and Vietnamese language versions, automatically redirecting to the appropriate version based on user browser language, providing localized service experience for customers in different regions.", "category": "Multilingual Support", "keywords": "language,multilingual,localization,international", "language": "en" }, { "question": "如何保证内容质量?", "answer": "我们通过多层次的审核机制保证内容质量:AI系统自动检测内容逻辑性和准确性;人工审核确保内容符合企业标准;用户反馈机制持续优化内容;定期更新知识库,保持内容时效性。", "category": "质量控制", "keywords": "质量,审核,AI,人工,反馈", "language": "zh" }, { "question": "How do you ensure content quality?", "answer": "We ensure content quality through multi-level review mechanisms: AI system automatically detects content logic and accuracy; manual review ensures content meets enterprise standards; user feedback mechanism continuously optimizes content; regular knowledge base updates maintain content timeliness.", "category": "Quality Control", "keywords": "quality,review,AI,manual,feedback", "language": "en" }, { "question": "系统如何学习用户偏好?", "answer": "系统通过分析用户行为数据、搜索关键词、停留时间、点击路径等信息,了解用户兴趣和需求,自动调整内容推荐策略,个性化展示相关内容,提升用户体验。", "category": "智能学习", "keywords": "学习,用户,偏好,个性化,推荐", "language": "zh" }, { "question": "How does the system learn user preferences?", "answer": "The system analyzes user behavior data, search keywords, dwell time, click paths and other information to understand user interests and needs, automatically adjusting content recommendation strategies, personally displaying relevant content to improve user experience.", "category": "Intelligent Learning", "keywords": "learning,user,preference,personalization,recommendation", "language": "en" }, # 成功案例类 (26-35) { "question": "有成功案例吗?", "answer": "我们有多个成功案例,包括二手汽车销售案例:通过AI自动产生车型介绍、款式对比、养护知识等内容,车辆展示页面访问量提升350%,客户咨询转化率提升280%,专业客户获取提升250%。", "category": "成功案例", "keywords": "案例,成功,效果,提升,转化", "language": "zh" }, { "question": "Do you have success cases?", "answer": "We have multiple success cases, including a used car sales case: through AI automatically generating car model introductions, style comparisons, maintenance knowledge and other content, vehicle display page visits increased by 350%, customer inquiry conversion rate increased by 280%, and professional customer acquisition increased by 250%.", "category": "Success Cases", "keywords": "cases,success,effect,improvement,conversion", "language": "en" }, { "question": "二手摩托车销售案例效果如何?", "answer": "二手摩托车销售案例中,将企业内部摩托车型号介绍、款式对比、养护知识处理成知识库,AI持续输出技术内容,客户平均访问时长提升300%,技术咨询转化率提升220%,让客户觉得网站有技术价值,提升客户粘性。", "category": "成功案例", "keywords": "摩托车,案例,技术,访问,粘性", "language": "zh" }, { "question": "What was the effect of the used motorcycle sales case?", "answer": "In the used motorcycle sales case, internal motorcycle model introductions, style comparisons, and maintenance knowledge were processed into a knowledge base, with AI continuously outputting technical content, customer average visit duration increased by 300%, technical consultation conversion rate increased by 220%, making customers feel the website has technical value and improving customer stickiness.", "category": "Success Cases", "keywords": "motorcycle,case,technology,visit,stickiness", "language": "en" }, { "question": "制造业案例效果如何?", "answer": "制造业案例中,通过AI智能体实现经营数据查询时间从2小时缩短至30秒,管理效率提升320%,帮助企业实现智能化经营管理,大幅提升运营效率。", "category": "成功案例", "keywords": "制造业,效率,智能,管理,提升", "language": "zh" }, { "question": "What was the effect of the manufacturing case?", "answer": "In the manufacturing case, through AI agents, business data query time was reduced from 2 hours to 30 seconds, management efficiency increased by 320%, helping enterprises achieve intelligent business management and significantly improve operational efficiency.", "category": "Success Cases", "keywords": "manufacturing,efficiency,intelligent,management,improvement", "language": "en" }, { "question": "科技公司财务预警案例如何?", "answer": "科技公司财务预警智能体案例中,现金流预警准确率达98%,节省财务分析成本75%,帮助企业实现财务风险预警,提升财务管理效率。", "category": "成功案例", "keywords": "科技,财务,预警,准确率,成本", "language": "zh" }, { "question": "How was the tech company financial warning case?", "answer": "In the tech company financial warning AI agent case, cash flow warning accuracy reached 98%, saving financial analysis costs by 75%, helping enterprises achieve financial risk warning and improve financial management efficiency.", "category": "Success Cases", "keywords": "technology,finance,warning,accuracy,cost", "language": "en" }, { "question": "建筑工程案例效果如何?", "answer": "建筑工程项目管理智能体案例中,项目进度跟踪精度提升90%,项目按期完成率提升至98%,帮助企业实现项目精细化管理,提升项目成功率。", "category": "成功案例", "keywords": "建筑,工程,项目,精度,完成率", "language": "zh" }, { "question": "How was the construction project case?", "answer": "In the construction project management AI agent case, project progress tracking accuracy improved by 90%, on-time project completion rate increased to 98%, helping enterprises achieve refined project management and improve project success rates.", "category": "Success Cases", "keywords": "construction,engineering,project,accuracy,completion", "language": "en" }, # 技术实现类 (36-45) { "question": "如何部署网站?", "answer": "我们使用Python HTTP服务器部署在8888端口,支持多语言自动重定向,配置简单,运行稳定。网站支持响应式设计,兼容各种设备,确保用户体验。", "category": "技术部署", "keywords": "部署,服务器,端口,多语言,响应式", "language": "zh" }, { "question": "How do you deploy the website?", "answer": "We use Python HTTP server deployed on port 8888, supporting multilingual automatic redirection, simple configuration, and stable operation. The website supports responsive design, compatible with various devices, ensuring user experience.", "category": "Technical Deployment", "keywords": "deployment,server,port,multilingual,responsive", "language": "en" }, { "question": "如何联系你们?", "answer": "您可以通过网站联系表单提交咨询,我们会尽快回复。也可以直接访问我们的网站 http://47.237.79.9:8888 了解更多信息。", "category": "联系方式", "keywords": "联系,表单,咨询,网站,回复", "language": "zh" }, { "question": "How can I contact you?", "answer": "You can submit inquiries through the website contact form, and we will reply as soon as possible. You can also visit our website http://47.237.79.9:8888 to learn more information.", "category": "Contact Information", "keywords": "contact,form,inquiry,website,reply", "language": "en" }, { "question": "网站支持移动端吗?", "answer": "是的,我们的网站完全支持移动端访问,采用响应式设计,能够自适应各种屏幕尺寸,确保在手机、平板等设备上的良好用户体验。", "category": "移动端支持", "keywords": "移动端,响应式,自适应,手机,平板", "language": "zh" }, { "question": "Does the website support mobile devices?", "answer": "Yes, our website fully supports mobile access, using responsive design that adapts to various screen sizes, ensuring good user experience on phones, tablets and other devices.", "category": "Mobile Support", "keywords": "mobile,responsive,adaptive,phone,tablet", "language": "en" }, { "question": "如何保证网站安全?", "answer": "我们采用多层安全防护措施:HTTPS加密传输、输入验证和过滤、防止XSS攻击、定期安全更新、访问日志监控等,确保网站和用户数据安全。", "category": "安全保障", "keywords": "安全,加密,验证,防护,监控", "language": "zh" }, { "question": "How do you ensure website security?", "answer": "We adopt multi-layer security protection measures: HTTPS encrypted transmission, input validation and filtering, XSS attack prevention, regular security updates, access log monitoring, etc., ensuring website and user data security.", "category": "Security Assurance", "keywords": "security,encryption,validation,protection,monitoring", "language": "en" }, { "question": "网站加载速度如何?", "answer": "我们通过多种技术优化网站加载速度:图片压缩和格式优化、CSS和JavaScript文件压缩、CDN加速、懒加载机制、服务器性能优化等,确保快速响应。", "category": "性能优化", "keywords": "速度,优化,压缩,CDN,懒加载", "language": "zh" }, { "question": "How is the website loading speed?", "answer": "We optimize website loading speed through various technologies: image compression and format optimization, CSS and JavaScript file compression, CDN acceleration, lazy loading mechanisms, server performance optimization, etc., ensuring fast response.", "category": "Performance Optimization", "keywords": "speed,optimization,compression,CDN,lazy loading", "language": "en" }, # 价格服务类 (46-50) { "question": "服务价格如何?", "answer": "我们的服务价格根据项目规模和需求定制,提供灵活的定价方案。具体价格请通过网站联系表单咨询,我们会根据您的具体需求提供详细的报价方案。", "category": "价格咨询", "keywords": "价格,服务,定制,报价,咨询", "language": "zh" }, { "question": "What are your service prices?", "answer": "Our service prices are customized based on project scale and requirements, providing flexible pricing plans. For specific prices, please inquire through the website contact form, and we will provide detailed quotation plans based on your specific needs.", "category": "Price Inquiry", "keywords": "price,service,customized,quotation,inquiry", "language": "en" }, { "question": "项目实施周期多长?", "answer": "项目实施周期根据项目复杂度而定,一般基础网站项目需要2-4周,复杂AI功能项目需要4-8周。我们会根据您的具体需求制定详细的项目计划和时间安排。", "category": "项目周期", "keywords": "周期,项目,时间,计划,安排", "language": "zh" }, { "question": "What is the project implementation cycle?", "answer": "The project implementation cycle depends on project complexity. Generally, basic website projects take 2-4 weeks, and complex AI function projects take 4-8 weeks. We will develop detailed project plans and schedules based on your specific needs.", "category": "Project Cycle", "keywords": "cycle,project,time,plan,schedule", "language": "en" }, { "question": "提供售后服务吗?", "answer": "我们提供完善的售后服务,包括技术维护、内容更新、功能升级、问题解决等。我们承诺7x24小时技术支持,确保网站稳定运行,让客户无后顾之忧。", "category": "售后服务", "keywords": "售后,服务,维护,升级,支持", "language": "zh" } ] # 插入数据 for qa in qa_data: cursor.execute(''' INSERT INTO qa_pairs (question, answer, category, keywords, language) VALUES (?, ?, ?, ?, ?) ''', (qa['question'], qa['answer'], qa['category'], qa['keywords'], qa['language'])) conn.commit() print(f"成功插入 {len(qa_data)} 条问答数据") def create_query_functions(conn): """创建查询函数""" cursor = conn.cursor() # 创建索引以优化查询性能 cursor.execute('CREATE INDEX IF NOT EXISTS idx_question ON qa_pairs(question)') cursor.execute('CREATE INDEX IF NOT EXISTS idx_answer ON qa_pairs(answer)') conn.commit() print("查询索引创建成功") def main(): """主函数""" print("开始创建企业经营AI智能体问答数据库...") # 创建数据库 conn = create_database() print("数据库创建成功") # 插入数据 insert_qa_data(conn) # 创建查询函数 create_query_functions(conn) # 验证数据 cursor = conn.cursor() cursor.execute('SELECT COUNT(*) FROM qa_pairs') count = cursor.fetchone()[0] print(f"数据库中共有 {count} 条问答记录") # 显示统计信息 cursor.execute('SELECT category, COUNT(*) FROM qa_pairs GROUP BY category') categories = cursor.fetchall() print("\n分类统计:") for category, count in categories: print(f" {category}: {count} 条") cursor.execute('SELECT language, COUNT(*) FROM qa_pairs GROUP BY language') languages = cursor.fetchall() print("\n语言统计:") for language, count in languages: print(f" {language}: {count} 条") conn.close() print("\n数据库创建完成!") print("数据库文件位置: /root/老业务网站8.30/ai_agent_qa.db") if __name__ == "__main__": main()