Skip to content

Add Knowledgebase #1795

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Add Knowledgebase #1795

wants to merge 13 commits into from

Conversation

birdayz
Copy link
Contributor

@birdayz birdayz commented Jun 4, 2025

  • Add KB proto
  • Add KB UI

Copy link

github-actions bot commented Jun 4, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / lint-and-breaking (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 6, 2025, 7:51 AM

Comment on lines 10 to 15
// KnowledgeBase ID.
string id = 1 [
(google.api.field_behavior) = REQUIRED,
(buf.validate.field).required = true,
(buf.validate.field).string.pattern = "^[A-Za-z0-9-_/]+$"
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should autogenerate the id and not have it user-specified I think.

Also this id will likely go into a Kafka topic name (e.g. __redpanda_cloud__rag_<kb-id>_source_confluence-with-id) so we need to limit the character set. Slashes wouldn't be allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah, absolutely. my mistake. should be xid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the resource. so it's required, because it's never an input

@weeco weeco self-requested a review June 4, 2025 10:24
}

oneof vector_database {
Postgres postgres = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we differentiate as db type, since there are many flavours of postgres based DBs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what different fields would we support? in the end, it's a conn via PG protocol. and, i guess, it needs pgvector, we could also call it PGVector

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 call it PGVector - we shouldn't be specific and will want to support different extensions I'm sure

Copy link
Contributor Author

@birdayz birdayz Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh, i did not go for PGVector. In the end, this is just postgres: dsn, table, ...
not suuper important for me though

}

oneof vector_database {
Postgres postgres = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 call it PGVector - we shouldn't be specific and will want to support different extensions I'm sure

Comment on lines 68 to 74
EmbeddingGenerator embedding_generator = 6 [
(google.api.field_behavior) = REQUIRED,
(buf.validate.field).required = true
];

// API url for retrieval API, that allows lookup of documents.
string retrieval_api_url = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funky field number ordering?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i will get it ordered before merging, still iterating a bit

@birdayz birdayz force-pushed the jb/knowledgebase branch 8 times, most recently from c34d0b2 to caedc8c Compare June 6, 2025 07:51
Copy link

github-actions bot commented Jun 26, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 17, 2025, 3:44 PM

@birdayz birdayz force-pushed the jb/knowledgebase branch 6 times, most recently from 8b0116d to 96c0ea1 Compare June 27, 2025 09:39
@birdayz birdayz marked this pull request as draft June 27, 2025 09:40
@birdayz birdayz force-pushed the jb/knowledgebase branch from 96c0ea1 to 9553bf1 Compare June 27, 2025 12:17
@birdayz birdayz force-pushed the jb/knowledgebase branch 2 times, most recently from 8f6c7b3 to cbcdcfd Compare July 7, 2025 17:41
@birdayz birdayz marked this pull request as ready for review July 7, 2025 17:42
@birdayz birdayz force-pushed the jb/knowledgebase branch 2 times, most recently from 247c9a1 to f58a32d Compare July 14, 2025 08:51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting piece of code, could be a beginning of a way to integrate it with auto form component to use grpc for validating the form directly without any intermediate measures.

@@ -188,6 +194,8 @@ const setConfig = ({ fetch, urlOverride, jwt, isServerless, featureFlags, ...arg
transformsClient: transformClient,
rpcnSecretsClient: secretGrpcClient,
clusterStatusClient: clusterStatusGrpcClient,
knowledgebaseClient: knowledgebaseGrpcClient,
userClient: userGrpcClient,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we use userClient for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added it for the "auto create users", but had to stop implementing it, it was a bit too tricky.
i can remove the client - i did keep it because it's reasonable to have this client available

};

@observer
class KnowledgeBaseList extends PageComponent<{}> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an outdated pattern as well.

We should use functional React components (not class-based), and try to do something similar to frontend/src/components/pages/agents/create/create-agent-page.tsx where you do not rely on any MobX state at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, could you check the result is what you expected?

@birdayz birdayz force-pushed the jb/knowledgebase branch from 84ef6f2 to e2b00b3 Compare July 15, 2025 20:16
@birdayz birdayz force-pushed the jb/knowledgebase branch from 1e53e73 to 1cbacde Compare July 16, 2025 12:59
@birdayz
Copy link
Contributor Author

birdayz commented Jul 16, 2025

migrated to v1alpha3

buf.yaml Outdated
@@ -27,3 +27,4 @@ breaking:
ignore:
- redpanda/api/console/v1alpha1
- redpanda/api/dataplane/v1alpha1
- proto/redpanda/api/dataplane/v1alpha1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this can be removed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@birdayz birdayz force-pushed the jb/knowledgebase branch 3 times, most recently from c36056a to d4e982e Compare July 17, 2025 08:50
@birdayz birdayz force-pushed the jb/knowledgebase branch from d4e982e to 4766383 Compare July 17, 2025 09:39
@birdayz birdayz force-pushed the jb/knowledgebase branch from 191aa88 to d454f96 Compare July 17, 2025 10:52
@birdayz birdayz force-pushed the jb/knowledgebase branch 3 times, most recently from 36b2e82 to 91c9283 Compare July 17, 2025 12:29
@birdayz birdayz force-pushed the jb/knowledgebase branch 3 times, most recently from 62e08a0 to e5ae477 Compare July 17, 2025 13:10
@birdayz birdayz force-pushed the jb/knowledgebase branch from e5ae477 to efbfcf0 Compare July 17, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants