Skip to content

Commit

Permalink
chore: Remove learning extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjcsmith committed Dec 1, 2024
1 parent f339c48 commit 3d581b2
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 594 deletions.
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

0 comments on commit 3d581b2

Please sign in to comment.