Skip to content

Commit 4e64368

Browse files
Chat: quickstart and chatbots info for students (#14)
* update quickstart and introduce chatbots info for students * Update LLM model * chatbot docs links * mention of structured tutorial context * update evaldocsloader package * Release 2025/10/03 added * update quickstart and introduce chatbots info for students * page name change * fix terminology * fix for consistency * fix chatbot naming * clarify context of chatbots * clarifications * nav namwe fix --------- Co-authored-by: Jarka <57811074+jarkabaker@users.noreply.github.com>
1 parent 9bd42fe commit 4e64368

File tree

10 files changed

+103
-38
lines changed

10 files changed

+103
-38
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Chat Functions - More information
2+
3+
Chat functions are the microservices that Lambda Feedback calls to provide the underlying functionality of a chatbot. Students can chat with the chatbots and ask for help or further explanations regarding the Question that they are working on. Each chatbot has its own personality and approach to assisting the students.
4+
5+
The chatbots have at their basis a [Large Language Model (LLM)](https://en.wikipedia.org/wiki/Large_language_model) which received information regarding:
6+
7+
- the raw markdown content of the question the student is on currently, including:
8+
- the question name, number and content
9+
- the final answer, structured tutorial, and worked solutions of the question
10+
- the guidance (blurb and time estimate) form the teacher for the question
11+
- the set name, number and description
12+
- all parts with their number, content and done status (current part emphasised)
13+
- all response areas and their respective expected answers
14+
- the progress of the student on all parts of the Question, including:
15+
- the total number of responses and the number of wrong responses the student has made for each response area
16+
- the last responses the student has made for each response area and the received feedback
17+
- the time duration the student has spent on the respective question and current part on that day
18+
19+
---
20+
21+
## Available Chat functions
22+
23+
Currently the students have access to the following chat functions that host their own specific chatbot. Many others are in development.
24+
25+
Click on the links below for information on each chatbot:
26+
27+
[1. Informational Chatbot](https://github.com/lambda-feedback/informationalChatFunction/blob/main/docs/user.md)
28+
29+
30+
[2. Concise Chatbot](https://github.com/lambda-feedback/conciseChatFunction/blob/main/docs/user.md)
31+
32+
33+
[3. Reflective Chatbot](https://github.com/lambda-feedback/reflectiveChatFunction/blob/main/docs/user.md)
34+
35+
36+
## Chat Function Development
37+
38+
Are you interested in developing your own chatbot? Then check out the [Quickstart guide](quickstart.md) to develop and deploy your own AI chat function for Lambda Feedback.

docs/advanced/chat_functions/local.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Running and Testing Agents Locally
1+
# Running and Testing Chat function Locally
22

3-
You can run the Python function for your agent itself by writing a `main()` function, or you can call the [`testbench_prompts.py`](https://github.com/lambda-feedback/lambda-chat/blob/main/src/agents/utils/testbench_prompts.py) script that runs a similar pipeline to the `module.py`.
3+
You can run the Python function for your chat function itself by writing a `main()` function, or you can call the [`testbench_prompts.py`](https://github.com/lambda-feedback/lambda-chat/blob/main/src/agents/utils/testbench_prompts.py) script that runs a similar pipeline to the `module.py`.
44

55
```bash
66
python src/agents/utils/testbench_prompts.py
77
```
88

9-
You can also use the `test_prompts.py` script to test the agents with example inputs from Lambda Feedback questions and synthetic conversations.
9+
You can also use the `test_prompts.py` script to test the chat function with example inputs from Lambda Feedback questions and synthetic conversations.
1010
```bash
1111
python src/agents/utils/test_prompts.py
1212
```
1313

1414
## Testing using the Docker Image [:material-docker:](https://www.docker.com/)
1515

16-
You can also build and run the docker pipeline for the agents. The chatbot agents are deployed onto a AWS Lambda serverless cloud function using the docker image. Hence, for final testing of your chatbots, we recommend completing those steps.
16+
You can also build and run the docker pipeline for the chat function. The chatbot associated with the chat function is deployed onto a AWS Lambda serverless cloud function using the docker image. Hence, for final testing of your chatbot, we recommend completing those steps.
1717

1818
#### Build the Docker Image
1919

@@ -42,7 +42,9 @@ docker run --env-file .env -it --name my-lambda-container -p 8080:8080 llm_chat
4242
This will start the evaluation function and expose it on port `8080` and it will be open to be curl:
4343

4444
```bash
45-
curl --location 'http://localhost:8080/2015-03-31/functions/function/invocations' --header 'Content-Type: application/json' --data '{"message":"hi","params":{"conversation_id":"12345Test","conversation_history": [{"type":"user","content":"hi"}]}}'
45+
curl --location 'http://localhost:8080/2015-03-31/functions/function/invocations' \
46+
--header 'Content-Type: application/json' \
47+
--data '{"body":"{\"message\": \"hi\", \"params\": {\"conversation_id\": \"12345Test\", \"conversation_history\": [{\"type\": \"user\", \"content\": \"hi\"}]}}"}'
4648
```
4749

4850
### Call Docker Container From Postman
@@ -56,13 +58,7 @@ http://localhost:8080/2015-03-31/functions/function/invocations
5658
Body:
5759

5860
```JSON
59-
{
60-
"message":"hi",
61-
"params":{
62-
"conversation_id":"12345Test",
63-
"conversation_history": [{"type":"user","content":"hi"}]
64-
}
65-
}
61+
{"body":"{\"message\": \"hi\", \"params\": {\"conversation_id\": \"12345Test\", \"conversation_history\": [{\"type\": \"user\", \"content\": \"hi\"}]}}"}
6662
```
6763

6864
Body with optional Params:

docs/advanced/chat_functions/quickstart.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# Developing Chat Agents: Getting Started
1+
# Developing Chat Functions: Getting Started
22

3-
## What is a Chat Agent?
3+
## What is a Chat Function?
44

5-
It's a function which calls Large Language Models (LLMs) to respond to the student's messages given contxtual data:
5+
A chat function is a function which calls Large Language Models (LLMs) to respond to the messages of students given contextual data:
66

77
- question data
88
- user data such as past responses to the problem
9-
Chatbot Agents capture and automate the process of assisting students during their learning process when outside of classroom.
9+
10+
Chat functions host a chatbot. Chatbots capture and automate the process of assisting students during their learning process when outside of classroom.
1011

1112
## Getting Setup for Development
1213

1314
1. Get the code on your local machine (Using github desktop or the `git` cli)
1415

15-
- For new functions: clone the main repo for [lambda-chat](https://github.com/lambda-feedback/lambda-chat) and create a new branch. Then go under `scr/agents` and copy the `base_agent` folder.
16-
16+
- For new functions: clone the template repo for [chat-function-boilerplate](https://github.com/lambda-feedback/chat-function-boilerplate). **Make sure the new repository is set to public (it needs access to organisation secrets)**.
1717
- For existing functions: please make your changes on a new separate branch
1818

19-
2. _If you are creating a new chatbot agent_, you'll need to set it's name as the folder name in `scr/agents` and its corresponding files.
20-
3. You are now ready to start making changes and implementing features by editing each of the three main function-logic files:
19+
2. _If you are creating a new chatbot_, you can either edit the `src/agents/base_agent` or copy it and rename it based on the name of your chatbot.
20+
3. You are now ready to start making changes and implementing features by editing each of the main function-logic files:
2121

22-
1. **`scr/agents/{base_agent}/{base}_agent.py`**: This file contains the main LLM pipeline using [LangGraph](https://langchain-ai.github.io/langgraph/) and [LangChain](https://python.langchain.com/docs/introduction/).
22+
1. **`src/agents/{base_agent}/{base}_agent.py`**: This file contains the main LLM pipeline using [LangGraph](https://langchain-ai.github.io/langgraph/) and [LangChain](https://python.langchain.com/docs/introduction/).
2323

24-
- the agent expects the following inputs when it being called:
24+
- the chat function expects the following arguments when it being called:
2525

2626
Body with necessary Params:
2727

@@ -52,19 +52,44 @@ It's a function which calls Large Language Models (LLMs) to respond to the stude
5252
}
5353
```
5454

55-
2. **`scr/agents/{base_agent}/{base}_prompts.py`**: This is where you can write the system prompts that describe how your AI Assistant should behave and respond to the user.
55+
2. **`src/agents/{base_agent}/{base}_prompts.py`**: This is where you can write the system prompts that describe how your AI Assistant should behave and respond to the user.
56+
57+
3. _If you edited the chatbot agent file name_, make sure to add your chatbot `invoke()` function to the `module.py` file.
5658

57-
3. Make sure to add your agent `invoke()` function to the `module.py` file.
59+
4. Update the `config.json` file with the name of the chat function.
5860

59-
4. Please add a `README.md` file to describe the use and behaviour of your agent.
61+
5. Please add a `README.md` file to describe the use and behaviour of your chatbot.
6062

6163
4. Changes can be tested locally by running the pipeline tests using:
6264
```bash
6365
pytest src/module_test.py
6466
```
65-
[Running and Testing Agents Locally](local.md){ .md-button }
67+
[Running and Testing Chat Functions Locally](local.md){ .md-button }
6668

6769

68-
5. Merge commits into any branch (except main) will trigger the `dev.yml` workflow, which will build the docker image, push it to a shared `dev` ECR repository to make the function available from the `dev` and `localhost` client app.
70+
5. Merge commits into dev branch will trigger the `dev.yml` workflow, which will build the docker image, push it to a shared `dev` ECR repository and deploy an AWS Lambda function available to any http requests. In order to make your new chatbot available on the `dev` environment of the Lambda Feedback platform, you will have to get in contact with the ADMINS on the platform.
71+
72+
6. You can now test the deployed chat function using your preferred request client (such as [Insomnia](https://insomnia.rest/) or [Postman](https://www.postman.com/) or simply `curl` from a terminal). `DEV` Functions are made available at:
73+
```url
74+
https://<***>.execute-api.eu-west-2.amazonaws.com/default/chat/<function name as defined in config.json>
75+
```
6976

70-
6. In order to make your new chatbot available on the LambdaFeedback platform, you will have to get in contact with the ADMINS on the platform.
77+
!!! example "Example Request to chatFunctionBoilerplate-dev"
78+
curl --location 'https://<***>.execute-api.eu-west-2.amazonaws.com/default/chat/chatFunctionBoilerplate-dev' \
79+
--header 'Content-Type: application/json' \
80+
--data '{
81+
"message": "hi",
82+
"params": {
83+
"conversation_id": "12345Test",
84+
"conversation_history": [
85+
{
86+
"type": "user",
87+
"content": "hi"
88+
}
89+
]
90+
}
91+
}'
92+
93+
7. Once the `dev` chat function is fully tested, you can merge the code to the default branch (`main`). This will trigger the `main.yml` workflow, which will deploy the `staging` and `prod` versions of your chat function. Please contact the ADMIN to provide you the URLS for the `staging` and `prod` versions of your chat function.
94+
95+
8. In order to make your new chat function available on any of the environments of the Lambda Feedback platform, you will have to get in contact with the ADMINS on the platform.

docs/advanced/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ The fundamental idea of Lambda Feedback is that it calls external microservices
88
Evaluate a student response and provide feedback:
99
[Evaluation functions - Quickstart Guide](evaluation_functions/quickstart.md){ .md-button .md-button--primary style="width: 400px;"}
1010

11-
Dialogic conversations with students:<br>
12-
[Chat functions - Quickstart guide ](chatbot_agents/quickstart.md){ .md-button .md-button--primary style="width: 400px;"}
11+
LLM-driven chatbots to converse with students:<br>
12+
[Chat functions - Quickstart guide ](chat_functions/quickstart.md){ .md-button .md-button--primary style="width: 400px;"}
1313

14-
All microservices are called over http. There is complete freedom in their implementation. Lambda Feedback also provides families of deployed microservices, using open source code available in our public GitHub repositories.
14+
All microservices are called over http. There is complete freedom in their implementation subject to the expected API schema. Lambda Feedback also provides families of deployed microservices, using open source code available in our public GitHub repositories.
1515

1616
This section of documentation is to help developers of microservices. The documentation is written assuming you have basic developer skills.
1717

docs/student/getting_started_student.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ See the [Answering Questions](answering_questions.md) page for more help with an
3535

3636
### Using the Workspace
3737

38-
The Workspace provides you with various functionalities to assist you during your learning process:
39-
#### 1. Canvas:
38+
The Workspace provides you with various functionalities to assist you during your learning process. Your edits and progress in the Workspace are saved per each Question you preview. So, you will be able to view your old edits for the Question you are currently on.
39+
40+
Here are the various functionalities:
41+
42+
#### Canvas:
4043
A pane where you can write down your thought process and notes for the previewed question (handwriting, sticky notes & text).
4144

4245
![Canvas Interface](images/canvas_interface.png)
4346

44-
#### 2. Chat:
45-
A chat interface connecting you with helpful AI Chatbots to discuss any questions you have on the current topic you are working on.
47+
#### Chat:
48+
A chat interface connecting you with helpful Chatbots. The Chatbots are AI Assistants that you can chat with to ask for help or further explanations regarding the Question that you are working on.
4649

4750
![Chat Interface](images/chat_interface.png)
4851

49-
Your edits and progress in the Workspace are saved per each Question you preview. So, you will be able to view your old edits for the Question you are currently on.
52+
For more information on what the chatbot knows about you and how you can use it to its full potential:
53+
54+
[Chatbots - More Info](../advanced/chat_functions/info.md){ .md-button .md-button--primary}
163 KB
Loading
136 KB
Loading

docs/student/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The image above shows an example question, with numbers to indicate:
1919
10. _Response area_, where student responses are entered and feedback is given
2020
11. Feedback to the teacher (currently in flux regarding the design - 02/07/25)
2121
12. Access to content 'below the line' providing extra support.
22-
13. _Workspace_ - Opens tab with canvas and ai chatbot
22+
13. _Workspace_ - Opens tab with canvas and chat
2323
14. Comments
2424

2525
## Below the line

docs/terminology.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ This is an optional section, and so does not have to be included in any question
5656

5757
### Workspace
5858

59-
On the Question page, the students has access to their own workspace tab. Here they can find the "Canvas", for handwriting notes, and the "Chat", for conversing with an AI Chatbot on the question materials.
59+
On the Question page, the students has access to their own workspace tab. Here they can find the "Canvas", for handwriting notes, and the "Chat", for conversing with an LLM-driven Chatbot on the question materials.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ nav:
7676
- Chat functions:
7777
- Quickstart: "advanced/chat_functions/quickstart.md"
7878
- Testing Functions Locally: "advanced/chat_functions/local.md"
79+
- Chat Functions Information: "advanced/chat_functions/info.md"
7980

8081
# Configuration
8182
theme:

0 commit comments

Comments
 (0)