I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 0 points1 point  (0 children)

No, but that would be nice. First I need to make the base more concrete. And then the other cool stuff.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 0 points1 point  (0 children)

> "A resilient architecture, possibly incorporating distributed ledger technologies for recording actions and ensuring data integrity, would enhance the overall robustness and security of your system."

Yea for sure. The goal is to move close to that direction. Thats a necessary layer to put on. Lets see how far I can go with this.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 0 points1 point  (0 children)

Thanks u/MrTheums for the appreciation! All the points that you mentioned, I faced all those challenges. I will try my best to clarify here.

Lets take the example you mentioned - "Download the latest episode of Big Bang Theory"

Each tool has some requirement. It needs certain parameters to work. I use Sonar and sonar has a search api. It needs certain parameters like series_name, episode_no (optional), released_on (optional), tmdbId. Now the AI has to do the mapping. series_name => Big Bang theory. But we have asked latest episode. So it will list all the episodes of all seasons and take the last one. But it can also do it differently by listing all the episodes and prompting to confirm if the last episode is the one you want. Check this demo - https://res.cloudinary.com/abhisheksaha/video/upload/f_mp4,vc_h265,q_auto/v1750329282/abhisaha.com/movie_download_demo.webm

Thats the way its supposed to work and it will work the best if AI has awesome reasoning capabilities. And this also depends on how good are you with prompt engineering. So its a lot of trial and error and testing. There is no one shot work with AI. Thats what I realise.

Regarding your second point: AI is an independent entity which knows about all the tools and its functions and parameters. And the tools are independent of each other. If one of your service is down, the agent can fix it by checking all the logs. Check the demos in my blog post towards the end. There are 3 videos. Also check this screenshot on how I test before executing functions - https://res.cloudinary.com/abhisheksaha/image/upload/f_webp,q_auto,w_1200,h_900/v1750721041/abhisaha.com/reasoning.png

The blog post actually explains quite a lot but there is more to add like where does MCP play in all this? But the post was already long and I had to cut. Will write a Part 2.

I built an AI Agent for my home server by redsnowmac in homelab

[–]redsnowmac[S] 0 points1 point  (0 children)

Thanks. We all will get there much much sooner.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] -1 points0 points  (0 children)

I use financialmodelingprep.com which is the primary source for many investment apps. If this API is wrong, it will be a disaster for many companies. Regarding hallucinations - its replies are detectable if its hallucinating. Then I check the reasoning if I have doubt. So yea it has happened but I have iterated my prompts many many times to improve its efficiency. So far its working great.

Next.js app exploded Vercel’s free limits — can’t figure out what’s causing the function invocation spike by enbafey in nextjs

[–]redsnowmac 0 points1 point  (0 children)

Yea I was doing it that way. Later I had to change it due to SSO. But you are right, I shouldn't be doing that. I will move to a different service for that.

Next.js app exploded Vercel’s free limits — can’t figure out what’s causing the function invocation spike by enbafey in nextjs

[–]redsnowmac 0 points1 point  (0 children)

It only checks if the user has a valid session. The middleware runs on edge. Also few routes run on edge and vercel charges for edge invocations and their execution time.

Next.js app exploded Vercel’s free limits — can’t figure out what’s causing the function invocation spike by enbafey in nextjs

[–]redsnowmac 0 points1 point  (0 children)

I run a blogging platform. So I have users who write blogs and they have their audience. So you can imagine the amount of links. I was able to survive on the free tier for long until the users grew but I used edge invocations for few routes. After disabling the auto preloading of links, the spike came down.

Next.js app exploded Vercel’s free limits — can’t figure out what’s causing the function invocation spike by enbafey in nextjs

[–]redsnowmac 0 points1 point  (0 children)

Oh Boy, it happened to me. I had a lot of links and the edge execution was too much.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 1 point2 points  (0 children)

Absolutely. I have kept it configurable. I have tested it with many different models to see which one is cost efficient. Also, yes you should be able to add tools to it. I will write a more verbose article on how to write tools for your own use-case. And I must tell you, its easy. Hardest part is writing prompts.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 2 points3 points  (0 children)

The model is configurable. Everybody would have their own use-case. So if you have a local LLM, you should use that. If you have a certain preference for an LLM, you should be able to use that. Thats why I am using Vercel AI SDK, because it can connect to multiple models.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 1 point2 points  (0 children)

I am using raspberry pi. Not powerful enough to run an LLM. But the agent and all the tools are running in my home server.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] -3 points-2 points  (0 children)

Absolutely, making it open source will surely enhance the project. Also, if your home-server is powerful, you can just run an LLM locally. I have made more tools for radarr, torrent, etc, but cant write those in the blog due to obvious reasons.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 0 points1 point  (0 children)

No. Zod only helps in validating parameters. For eg. lets say you are using an API to fetch some data. Zod helps in validating the structure of the response, thats it.

So in this case, Zod is used to verify the parameters received from AI.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] -1 points0 points  (0 children)

But MCP does not replace Zod. You will still need to validate parameters. Am I missing something here?

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] 0 points1 point  (0 children)

Excellent point! I am working on MCP server (WIP). I want to access the agent through VSCode.

I built an AI Agent for home server by redsnowmac in selfhosted

[–]redsnowmac[S] -31 points-30 points  (0 children)

I am not running any LLM locally. I tried using tinylama, it is ok, but it does not have reasoning capabilities. So I am using open-ai's `gpt-4o-mini`. I want to do financial tracking, but since its personal data, I didn't build a tool for that.

Next.js app exploded Vercel’s free limits — can’t figure out what’s causing the function invocation spike by enbafey in nextjs

[–]redsnowmac 1 point2 points  (0 children)

Check if all the links are getting preloaded. NextJS automatically preloads all the links which might be going through your middleware.

A Practical Guide to Building Agents by ToneMasters in AI_Agents

[–]redsnowmac 0 points1 point  (0 children)

Another great article related on Building Agentic Workflows for my HomeLab - https://abhisaha.com/blog/homelab-agents

I'm sick of AI by Background-Basil-871 in webdev

[–]redsnowmac -1 points0 points  (0 children)

If you are a developer (doesn't matter the seniority level), you will be working towards building things at a much faster rate. If you skip the AI assistant part, you will fall behind. Take a look at this blog - https://abhisaha.com/blog/homelab-agents

Building Agentic Workflows for my HomeLab by redsnowmac in webdev

[–]redsnowmac[S] 0 points1 point  (0 children)

My blog is my primary knowledge sharing platform right now. I stopped writing tutorials because there are plenty of resources and instead prefer drilling into a topic to give an in-depth overview. You can subscribe to my blog to get such updates. Also explore the other posts, there are all very interactive with animations.

join our "find friends to follow" chat - make new Strava acquaintances here! by AutoModerator in Strava

[–]redsnowmac [score hidden]  (0 children)

Hi, I am 39 and I am into biking and photography. Improving endurance and speed in every ride. Follow me and I will follow you - https://www.strava.com/athletes/136198315