top of page
Search

How to Build a Knowledge Base Like McKinsey in Cognigy.AI Using OpenAI

  • Writer: Dr. Franco Arda
    Dr. Franco Arda
  • 2 days ago
  • 3 min read

Updated: 48 minutes ago


A Knowledge Based in Cognigy AI Using Open AI
A Knowledge Based in Cognigy AI Using Open AI

Empowering Employees with AI Knowledge Bases

Leading companies like McKinsey, Deloitte, and KPMG are revolutionizing internal knowledge management by empowering their employees with AI-driven assistants. These assistants allow staff to:

  • Instantly access company-specific insights and documentation.

  • Reduce the time spent searching for information.

  • Make faster, more informed decisions based on verified internal knowledge.

Rather than relying on traditional intranets or complex file repositories, these companies leverage large language models (LLMs) combined with dynamic, searchable knowledge bases.


Example Use Cases

Here are a few ways AI-powered knowledge bases are being used inside enterprises:

  • Consultant Assistant: Quickly retrieve the best case studies, frameworks, or data points to prepare client pitches.

  • Onboarding Helper: New employees can ask natural language questions about internal processes, benefits, or best practices.

  • Compliance Advisor: Surface regulatory requirements and firm-specific guidelines for specific industries or client situations.

    Sample prompt for an internal knowledge base
    Sample prompt for an internal knowledge base

Why Direct Uploading to Cognigy Isn’t Enough

While Cognigy offers built-in Knowledge Bases, uploading data manually has several major limitations:

  • Manual Maintenance: Every document update requires manual re-uploading.

  • Scalability Issues: Large or dynamic knowledge sources become difficult to manage.

  • Limited Retrieval: Cognigy's built-in retrieval is basic compared to dynamic Retrieval-Augmented Generation (RAG) systems.

For a real McKinsey-style assistant, you need a solution that automatically connects to an evolving knowledge base with powerful search capabilities.

Why HTTP Nodes in Cognigy Are Not an Option

Although Cognigy offers HTTP Request Nodes, they come with a 1-second timeout limit (unless changed via platform settings, which may not always be possible in hosted versions).

Fetching and embedding documents, querying external knowledge bases, and conducting semantic searches often take several seconds. Relying on HTTP nodes would cause unreliable experiences and frequent timeouts.

Why Extensions Are the Solution

Cognigy Extensions (custom code modules) overcome this challenge by:

  • Allowing significantly longer execution times (30-60+ seconds if needed).

  • Offering full flexibility with Node.js to call any external APIs.

  • Handling complex, multi-step tasks like embedding user queries, querying vector databases, and formatting responses.

Extensions effectively act as your "smart backend" inside Cognigy flows.


Why Connecting Extensions Directly to S3 Buckets Isn't Practical

At first glance, connecting an Extension directly to S3 might seem logical: just grab PDFs and extract data, right?

However, real-world problems arise:

  • Scanning S3 every time a user asks a question would be slow and expensive.

  • Re-embedding documents live would waste significant compute resources.

  • Scaling issues would cripple the system at even moderate usage.

Thus, a more sophisticated solution is needed.

Using a Vector Database: The Smart Approach

Instead of fetching raw documents in real time, you precompute embeddings for all your documents (using OpenAI's text-embedding-3-large or similar) and store them in a vector database like Pinecone.

During runtime:

  • You only embed the user's question (very fast).

  • You search the vector database for similar documents (very fast).

  • You feed the relevant context into OpenAI's GPT-4 or GPT-4o to generate an answer.

Benefits:

  • Extremely fast responses.

  • Much lower OpenAI costs.

  • More accurate context retrieval.


The Final System Flow

Here is how your McKinsey-style knowledge system would work:

  1. Preprocessing Phase:

    • Upload PDFs manually into an S3 bucket.

    • Extract text from PDFs.

    • Generate embeddings using OpenAI.

    • Store embeddings + document metadata into Pinecone.

  2. Runtime (User Query Phase):

    • Cognigy Extension receives user's question.

    • Extension calls OpenAI to embed the question.

    • Extension queries Pinecone with the question vector.

    • Pinecone returns top matching documents/snippets.

    • Extension sends the snippets + user question to GPT-4o.

    • GPT-4o crafts a complete answer.

    • Cognigy displays the answer to the user.

Final Thoughts

With just a few smart architectural choices, you can build a dynamic, scalable knowledge assistant inside Cognigy that rivals the internal tools used by leading global consulting firms.

By combining Cognigy Extensions, Amazon S3, OpenAI embeddings, and a vector database like Pinecone, you can empower your employees with instant, intelligent access to your organization's knowledge — at a fraction of the cost and complexity it once required.

Comentários


Dr. Franco Arda
Cognigy AI Certified Specialist | AI Agents (Text & Voice) | Conversational AI Expert

Contact:

© 2025 by Dr. Franco Arda

bottom of page