Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.0",
"info": {
"title": "Archestra",
"version": "1.1.3"
"version": "1.1.4"
},
"components": {
"schemas": {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/platform-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ The [Knowledge Base](/docs/platform-knowledge-bases) enterprise feature requires

**Cloud-managed databases:**

- **AWS RDS** — pgvector is available as a [trusted extension](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.Extensions). Enable it via `CREATE EXTENSION vector` without superuser.
- **AWS RDS** — pgvector is available but is [not a trusted extension](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.FeatureSupport.Extensions.html#PostgreSQL.Concepts.General.Extensions.Trusted), so it must be installed by a user with the `rds_superuser` role. Connect as the RDS master user and run `CREATE EXTENSION vector`.
- **Google Cloud SQL** — pgvector is [supported natively](https://cloud.google.com/sql/docs/postgres/extensions#pgvector). Enable it via the Cloud SQL console or `CREATE EXTENSION vector`.
- **Azure Database for PostgreSQL** — pgvector is [available as an extension](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-extensions). Allow-list it in server parameters, then run `CREATE EXTENSION vector`.

Expand Down
6 changes: 3 additions & 3 deletions docs/pages/platform-knowledge-bases.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Check ../docs_writer_prompt.md before changing this file.
-->

Knowledge bases provide built-in retrieval augmented generation (RAG) powered by PostgreSQL and pgvector. Connectors sync data from external tools into knowledge bases, where documents are chunked, embedded, and indexed for hybrid search. Agents query their assigned knowledge bases at runtime via the `query_knowledge_base` tool.
Knowledge bases provide built-in retrieval augmented generation (RAG) powered by PostgreSQL and pgvector. Connectors sync data from external tools into knowledge bases, where documents are chunked, embedded, and indexed for hybrid search. Agents automatically query their assigned knowledge sources at runtime.

> **Enterprise feature.** Knowledge bases require an enterprise license. Contact sales@archestra.ai for licensing information.
Expand All @@ -33,11 +33,11 @@ flowchart LR

### Querying

At runtime, the `query_knowledge_base` tool embeds the query, runs vector and optional full-text search in parallel, then fuses, reranks, and filters results.
At runtime, the agent's query is embedded, then vector and optional full-text search run in parallel. Results are fused, reranked, and filtered before being returned.

```mermaid
flowchart LR
Q[query_knowledge_base] -->|OpenAI API| QE[Query Embedding]
Q[Agent Query] -->|OpenAI API| QE[Query Embedding]
QE --> VS[Vector Search]
QE --> FTS["Full-Text Search (configurable)"]
VS --> RRF[Reciprocal Rank Fusion]
Expand Down
6 changes: 6 additions & 0 deletions platform/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ drizzle-kit check # Check consistency of generated SQL migrations history
# IMPORTANT: Never create manually-named migration files - Drizzle tracks migrations
# via the meta/_journal.json file which references the generated file names.

# Custom Data-Only Migrations (no schema changes)
# For pure data migrations (UPDATE, INSERT) with no schema changes, use:
# cd backend && npx drizzle-kit generate --custom --name=<descriptive-name>
# This creates an empty SQL file tracked by Drizzle's journal. Add your SQL, then run:
# npx drizzle-kit check

# Database Connection
# PostgreSQL is running in Kubernetes (managed by Tilt)
# Connect to database:
Expand Down
18 changes: 6 additions & 12 deletions platform/backend/src/archestra-mcp-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,19 @@ describe("getArchestraMcpTools", () => {
expect(tool?.title).toBe("Get LLM Proxy Token Usage");
});

test("should have query_knowledge_base tool", () => {
test("should have query_knowledge_sources tool", () => {
const tools = getArchestraMcpTools();
const tool = tools.find((t) => t.name.endsWith("query_knowledge_base"));
const tool = tools.find((t) => t.name.endsWith("query_knowledge_sources"));

expect(tool).toBeDefined();
expect(tool?.title).toBe("Query Knowledge Base");
expect(tool?.title).toBe("Query Knowledge Sources");
expect(tool?.inputSchema).toEqual({
type: "object",
properties: {
query: {
type: "string",
description:
"A natural language query about the content stored in the knowledge base. Ask about topics, concepts, or information — not about source systems (e.g. ask 'what tasks are in progress' rather than 'get jira data').",
},
mode: {
type: "string",
enum: ["local", "global", "hybrid", "naive"],
description:
"Query mode: 'local' uses only local context, 'global' uses global context across all documents, 'hybrid' combines both (recommended), 'naive' uses simple RAG without graph-based retrieval. Defaults to 'hybrid'.",
"A natural language query about the content you are looking for. Ask about topics, concepts, or information rather than about source systems.",
},
},
required: ["query"],
Expand Down Expand Up @@ -720,8 +714,8 @@ describe("executeArchestraTool", () => {
});
});

describe("query_knowledge_base tool", () => {
const toolName = `${ARCHESTRA_MCP_SERVER_NAME}${MCP_SERVER_TOOL_NAME_SEPARATOR}query_knowledge_base`;
describe("query_knowledge_sources tool", () => {
const toolName = `${ARCHESTRA_MCP_SERVER_NAME}${MCP_SERVER_TOOL_NAME_SEPARATOR}query_knowledge_sources`;

test("should return error when query param is missing", async () => {
const result = await executeArchestraTool(toolName, {}, mockContext);
Expand Down
22 changes: 8 additions & 14 deletions platform/backend/src/archestra-mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MCP_SERVER_TOOL_NAME_SEPARATOR,
TOOL_ARTIFACT_WRITE_FULL_NAME,
TOOL_CREATE_MCP_SERVER_INSTALLATION_REQUEST_FULL_NAME,
TOOL_QUERY_KNOWLEDGE_BASE_FULL_NAME,
TOOL_QUERY_KNOWLEDGE_SOURCES_FULL_NAME,
TOOL_TODO_WRITE_FULL_NAME,
} from "@shared";
import { executeA2AMessage } from "@/agents/a2a-executor";
Expand Down Expand Up @@ -1782,10 +1782,10 @@ export async function executeArchestraTool(
}
}

if (toolName === TOOL_QUERY_KNOWLEDGE_BASE_FULL_NAME) {
if (toolName === TOOL_QUERY_KNOWLEDGE_SOURCES_FULL_NAME) {
logger.info(
{ agentId: contextAgent.id, queryArgs: args },
"query_knowledge_base tool called",
"query_knowledge_sources tool called",
);

try {
Expand Down Expand Up @@ -1910,7 +1910,7 @@ export async function executeArchestraTool(
agentId: contextAgent.id,
error: error instanceof Error ? error.message : String(error),
},
"query_knowledge_base failed",
"query_knowledge_sources failed",
);
return {
content: [
Expand Down Expand Up @@ -2946,23 +2946,17 @@ export function getArchestraMcpTools(): Tool[] {
_meta: {},
},
{
name: TOOL_QUERY_KNOWLEDGE_BASE_FULL_NAME,
title: "Query Knowledge Base",
name: TOOL_QUERY_KNOWLEDGE_SOURCES_FULL_NAME,
title: "Query Knowledge Sources",
description:
"Query the organization's knowledge base to retrieve information from ingested documents (uploaded files, Jira issues, Confluence pages, etc.). Uses graph-based retrieval augmented generation (GraphRAG) for accurate and contextual results. IMPORTANT: formulate queries about the actual content you are looking for, not about the source system. For example, instead of 'get information from jira', ask 'what tasks or issues are being tracked' or 'what are the open bugs'.",
"Query the organization's knowledge sources to retrieve relevant information. Use this tool when the user asks a question you cannot answer from your training data alone, or when they explicitly ask you to search internal documents and data sources. Formulate queries about the actual content you are looking for — ask about topics, concepts, or information rather than about source systems.",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description:
"A natural language query about the content stored in the knowledge base. Ask about topics, concepts, or information — not about source systems (e.g. ask 'what tasks are in progress' rather than 'get jira data').",
},
mode: {
type: "string",
enum: ["local", "global", "hybrid", "naive"],
description:
"Query mode: 'local' uses only local context, 'global' uses global context across all documents, 'hybrid' combines both (recommended), 'naive' uses simple RAG without graph-based retrieval. Defaults to 'hybrid'.",
"A natural language query about the content you are looking for. Ask about topics, concepts, or information rather than about source systems.",
},
},
required: ["query"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Rename legacy tool: query_knowledge_base → query_knowledge_sources
UPDATE "tools"
SET "name" = 'archestra__query_knowledge_sources'
WHERE "name" = 'archestra__query_knowledge_base';
Loading
Loading