Implement deep_researcher with Kitaru instead of LangGraph. - #2
Implement deep_researcher with Kitaru instead of LangGraph. #2GabrielAndrus wants to merge 4 commits into
Conversation
…are declared in checkpoints.py, models in models.py. The file deep_research_flow.py contains the flow of each checkpoint.
| LMSTUDIO_BASE_URL = "http://192.168.1.79:8080/v1" | ||
| LMSTUDIO_API_KEY = "local" | ||
| MODEL = "openai:gpt-oss-120b" | ||
| SEARXNG_HOST = "http://192.168.1.36:4000" |
There was a problem hiding this comment.
I understand that this is coming directly from my coursework, so it's not that big of a deal, but it is important to generally put stuff like this in a .env file that doesn't get committed, and have an .env.sample that can be copied with all of the empty fields.
|
|
||
| # %% | ||
| def reward_100_rule(response, user_profile): | ||
| max_stock = 100 - user_profile["age"] |
There was a problem hiding this comment.
The max stock is 100 - the age of the user? I don't understand what this is giving us.
There was a problem hiding this comment.
This is following the 100 rule -- subtract your age from 100 to get the percentage of your portfolio that should be in stocks, rest goes in bonds. The reasoning is that younger people can take more risks on stocks and older people cannot (and should have more of their portfolio in safer assets).
| return 0.5 | ||
|
|
||
| def reward_disclaimer(response): | ||
| return 1.0 if "not financial advice" in response.lower() else 0.0 |
There was a problem hiding this comment.
Feels like a LARGE reward for the disclaimer being present, I like it, and hope it holds up mathematically
There was a problem hiding this comment.
I'll keep this comment open in case it doesn't hold up mathematically.
| return outputs | ||
|
|
||
| # %% | ||
| responses = generate("What should I invest in at age 60?") |
There was a problem hiding this comment.
Maybe we could show some good context engineering practice here for building this prompt both better and automatically?
There was a problem hiding this comment.
I'm not too familiar with context engineering. What kind of prompts are you thinking of?
…for the RLVR assignment
Implemented deep_researcher.py using Kitaru. The checkpoints are declared in checkpoints.py, models in models.py.
The file deep_research_flow.py contains the flow of each checkpoint.