Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove learning extraction #174

Merged
merged 1 commit into from
Dec 1, 2024
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
9 changes: 3 additions & 6 deletions control-plane/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as serviceDefinitions from "./modules/service-definitions";
import * as events from "./modules/observability/events";
import * as router from "./modules/router";
import * as redis from "./modules/redis";
import * as knowledge from "./modules/knowledge/queues";
import * as toolhouse from "./modules/integrations/toolhouse";
import * as externalCalls from "./modules/jobs/external";
import * as models from "./modules/models/routing";
Expand Down Expand Up @@ -128,16 +127,15 @@ const startTime = Date.now();
jobs.start(),
serviceDefinitions.start(),
workflows.start(),
knowledge.start(),
models.start(),
redis.start(),
customerTelemetry.start(),
toolhouse.start(),
externalCalls.start(),
...(env.EE_DEPLOYMENT
? [
flagsmith?.getEnvironmentFlags(),
customerTelemetry.start(),
analytics.start(),
toolhouse.start(),
externalCalls.start(),
]
: []),
])
Expand Down Expand Up @@ -176,7 +174,6 @@ process.on("SIGTERM", async () => {
flagsmith?.close(),
hdx?.shutdown(),
redis.stop(),
knowledge.stop(),
customerTelemetry.stop(),
externalCalls.stop(),
]);
Expand Down
60 changes: 0 additions & 60 deletions control-plane/src/modules/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,62 +455,6 @@ export const embeddings = pgTable(
}),
);

export const knowledgeLearnings = pgTable(
"knowledge_learnings",
{
id: varchar("id", { length: 1024 }).notNull(),
cluster_id: varchar("cluster_id").notNull(),
summary: text("summary").notNull(),
accepted: boolean("accepted").notNull().default(false),
},
(table) => ({
pk: primaryKey({
columns: [table.cluster_id, table.id],
}),
}),
);

export const knowledgeLearningsRelations = relations(
knowledgeLearnings,
({ many }) => ({
entities: many(knowledgeEntities, {
relationName: "knowledgeLearnings",
}),
}),
);

export const knowledgeEntities = pgTable(
"knowledge_entities",
{
cluster_id: varchar("cluster_id").notNull(),
learning_id: varchar("learning_id", { length: 1024 }),
type: text("type", {
enum: ["tool"],
}),
name: varchar("name", { length: 1024 }),
},
(table) => ({
pk: primaryKey({
columns: [table.cluster_id, table.name, table.learning_id],
}),
learningReference: foreignKey({
columns: [table.cluster_id, table.learning_id],
foreignColumns: [knowledgeLearnings.cluster_id, knowledgeLearnings.id],
}).onDelete("cascade"),
}),
);

export const knowledgeEntitiesRelations = relations(
knowledgeEntities,
({ one }) => ({
learning: one(knowledgeLearnings, {
relationName: "knowledgeLearnings",
fields: [knowledgeEntities.cluster_id, knowledgeEntities.learning_id],
references: [knowledgeLearnings.cluster_id, knowledgeLearnings.id],
}),
}),
);

export const apiKeys = pgTable(
"api_keys",
{
Expand Down Expand Up @@ -704,10 +648,6 @@ export const analyticsSnapshots = pgTable(
export const db = drizzle(pool, {
schema: {
workflows,
knowledgeLearnings,
knowledgeLearningsRelations,
knowledgeEntities,
knowledgeEntitiesRelations,
toolMetadata,
promptTemplates,
events,
Expand Down
190 changes: 0 additions & 190 deletions control-plane/src/modules/knowledge/learnings.ai.test.ts

This file was deleted.

Loading