# Cognita MCP MCP

> Cognita (RAG Framework) lets you manage complex knowledge retrieval systems without writing Python code. Inspect data sources, ingest files from SQL or cloud storage, and run automated questions against your private knowledge base directly from any AI client.

## Overview
- **Category:** friends-mcp
- **Price:** Free
- **Tags:** rag-framework, vector-search, embedding-models, data-ingestion, ai-pipeline, knowledge-retrieval

## Description

Building a good AI agent means more than just asking it questions; you have to control the entire flow of information. This MCP lets you take full command of that process. You can inspect exactly what data is in your system, see which external sources are connected, and audit the structure of your knowledge collections. Need to update the base? Use this MCP's tools to push fresh files from SQL or cloud storage into your vector space. Once the data is clean and ready, you can run targeted questions against that stored context and get synthesized answers without leaving your chat window. If you're working with multiple AI clients, Vinkius hosts this MCP, giving your agent access to all its retrieval tools in one place.

## Tools

### rag_query
Identifies precise, active arrays by querying the vector store with a user-defined prompt.

### list_models
Inspects deep internal arrays to enumerate all available LLMs and embedding models registered in the system.

### list_collections
Identifies and lists all bounded routing spaces available within your Headless Cognita RAG setup.

### get_collection
Retrieves detailed logging and tracing information for a specified knowledge collection.

### list_data_sources
Performs structural extraction to list properties driving active external data buckets.

### ingest_data
Pushes new data or updates into the vector space by creating resources from JSON payloads.

### search_chunks
Enumerates and retrieves explicitly attached structured rules containing raw document chunks for review.

## Prompt Examples

**Prompt:** 
```
List all RAG collections in Cognita
```

**Response:** 
```
I found 3 collections: 'technical-docs', 'legal-kb', and 'customer-support'. Which one would you like to inspect for metadata?
```

**Prompt:** 
```
Query collection 'technical-docs' for: 'How do I configure OAuth in our API?'
```

**Response:** 
```
Based on your technical docs, you need to navigate to the /auth/settings endpoint and register a new client ID. [Detailed answer synthesized from 3 context chunks].
```

**Prompt:** 
```
Ingest data from source 'gh-repo-vinkius' into collection 'technical-docs'
```

**Response:** 
```
Ingestion pipeline triggered! Cognita is now syncing 'gh-repo-vinkius' into the 'technical-docs' collection. I will let you know once the knowledge base is updated.
```

## Capabilities

### Audit Knowledge Collections
List and inspect the metadata of different knowledge collections to check embedding configurations and token limits.

### Update Data Sources
Force synchronization of remote files from various sources like SQL or Cloud Storage into your vector store.

### Query Stored Knowledge
Run automated, deep-dive questions that query the stored vectors and synthesize accurate answers from the retrieved context.

### Inspect Raw Data Chunks
Perform targeted searches to pull raw document chunks, allowing you to verify specific text segments for auditing purposes.

### Monitor Available Models
List and check the metadata of all LLMs and embedding models registered in your Cognita installation.

## Use Cases

### Troubleshooting a bad answer
An agent gives an incorrect answer, and you can't tell why. Instead of guessing, run `search_chunks` to manually pull the raw document chunks used in the response. Then use `list_collections` to confirm which knowledge base that data came from. This pinpoints if the issue is the source or the query.

### Onboarding a new manual
A team writes a huge, complex technical guide stored in an API bucket. You need the agent to know it immediately. Use `list_data_sources` to confirm the connection exists, then use `ingest_data` to push the files into your knowledge base.

### Validating model capabilities
The AI team needs to switch from Model A to Model B for cost reasons. Before switching, they run `list_models` to check which other LLMs are registered and available within the Cognita setup.

### Auditing data sprawl
The product team is unsure if all necessary documentation has been fed into the agent. They start by calling `list_collections` to map out every existing knowledge silo, ensuring nothing crucial was missed before launch.

## Benefits

- You don't have to write code just to test a query. Use `rag_query` to ask questions directly against your live data and get answers synthesized by the agent.
- Debugging context is easy. If you suspect stale information, run `list_data_sources` first to verify which external buckets are mapped into the AI workflow.
- Need to see what's in a specific knowledge base? Use `get_collection` or `list_collections` to audit metadata for token lengths and parser details before asking questions.
- Data updates shouldn't require a DevOps ticket. Triggering an ingestion run with `ingest_data` pushes fresh files from SQL or Cloud Storage instantly.
- You can check the whole stack at once. Running `list_models` ensures that every required LLM and embedding model endpoint is active and reachable.

## How It Works

The bottom line is that you manage complex RAG pipelines right through your conversational interface.

1. Subscribe to this MCP, then enter your Cognita Base URL and API Key into your preferred AI client.
2. Use the tools within your agent to list available data sources and collections, verifying everything is mapped correctly.
3. Call `ingest_data` to push new files or updated content from external systems into the vector space, making it ready for queries.

## Frequently Asked Questions

**Can my agent perform semantic RAG queries against my collections?**
Yes. The 'rag_query' tool allows you to ask questions in natural language. The agent queries your vector store via Cognita and uses an LLM to synthesize a final answer based explicitly on the retrieved context.

**How can I trigger a data ingestion pipeline through the agent?**
Provide the collection name and the data source FQN (Fully Qualified Name). The 'ingest_data' tool will command the Cognita backend to start a sync, updating your RAG vector space with the latest remote documents.

**Can I audit the raw document chunks before LLM generation?**
Absolutely. Use the 'search_chunks' tool to perform vector searches that return raw text segments and metadata without LLM synthesis. This is the perfect way to verify that your retrieval logic is pulling the correct data boundaries.

**When I use the `list_data_sources` tool, how do I verify which external systems are connected to Cognita?**
It lists all active data sources and properties. You can audit exactly which buckets or APIs feed into your knowledge base, ensuring you only rely on approved data.

**After running `list_models`, how do I check which LLMs and embedding models Cognita recognizes?**
The tool enumerates every registered model endpoint. This lets you verify compatibility or switch to a different vector size without writing any code.

**If my RAG query fails, how do I use `get_collection` to retrieve payload IDs for debugging?**
It retrieves explicit cloud logging tracing and specific Payload IDs. This lets you pinpoint exactly where the data processing broke down in your knowledge pipeline.

**When I run a complex `rag_query`, does Cognita tell me what context it used to answer?**
Yes, it synthesizes accurate answers while detailing the source context. You see precisely how many chunks were pulled from your vector store, confirming depth of knowledge.

**If I use `list_collections`, what specific metadata can I audit for each knowledge collection?**
It provides configuration details like embedding setups and token lengths. This confirms that every collection is properly sized and structured before you start querying it.