Setup help: Pydantic AI Docs Chunks 0

Wow somehow I was missing an import once I committed. Just fixed that now - thanks for pointing it out! Rested everything too

still not able to store the embeddings in the table … anyone got any luck ?

What error are you getting?

Hey everyone, I had installed archon v4, I executed the setup on docker and created the supabase database following the instructions, but when I got to the crawling of the pydantic files it repeatedly reported 0 doc chuncks. Today I installed teh v5 hoping it would work correctly but the error keeps persisting. I am pretty much an analphabet when it comes to this stuff so any tip will be helpful and really appreciated.

1 Like

Looks like you are getting a 401 unauthorized error for your calls to OpenAI. Make sure you have a valid API key set for OpenAI for both the LLM and embedding model in the environments tab for Archon!

Solution for “Pydantic AI Docs Chunks 0” Issue

I was also struggling with the “Chunks 0” problem but managed to solve it. I’d like to share my solution in case it helps others facing similar issues.

There were two main problems in my case:

1. OpenAI API Configuration Issues

First, check your container logs:

$ docker logs archon-container | less

In my logs, I found this error:

Error getting title and summary: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

This showed that my OpenAI API wasn’t functioning properly.

To fix this, verify your OpenAI platform settings at: https://platform.openai.com/settings/organization/usage (Note: This is different from your ChatGPT subscription)

My specific fixes were:

  • Updating my expired credit card with a new one
  • Adding $10 credit to my account to use the API

A quick way to check if your API is working: if the API calls are failing, you won’t see any changes in your OpenAI API Usage graphs.

2. Incorrect Supabase Key Configuration

After fixing the OpenAI API issue, I ran the crawler again but still encountered problems. Checking the logs again revealed:

Error inserting chunk: {'code': '42501', 'details': None, 'hint': None, 'message': 'new row violates row-level security policy for table "site_pages"'}

Being new to Supabase, I didn’t understand the difference between the ANON KEY and SERVICE KEY. I had been using the ANON KEY, but Archon requires the SERVICE KEY.

Check your API Settings in Supabase - the key labeled as “secret” is what Archon needs.

Results

After correctly configuring both the OpenAI API and Supabase SERVICE KEY, I ran the document crawler again and successfully processed 391 chunks! (There were 2 failed URLs, but these were unrelated to the main issue).

Hope this helps anyone facing similar problems!

1 Like

Thank you very much! I think i found why it is impossible for me to make calls to openai, I am inside an opeenai organization and when I generated my APIs to use in the archon enviroment they were of the sk-proj… kind insted of the standard personal one. After some research I found out that this may be the cause of the issue, is archon made to function just with personal APIs? If so would it be duable to try modifying the code to accept the kind of specific API that I’m using?

I’m having the same problem. I had it working with v4 but something is different about v5. I even created new supabase project with new API key. The error I’m getting in the Supabase log is 401 and when I dig in, it says I’m using anom and there is no key. Where can I find the key to verify it’s being saved correctly? Here is my docker log and my Supabase log


I can add a little more context. I deleted everything and started over. Deleted the docker images and downloaded them fresh. One of the first messages I saw was a missing .env file.

Here is an image showing the supabase credentials were saved

I got the same result with the new instance

I fixed my problem. It was using the ANON KEY vs. SERVICE KEY. v5 is working, can’t wait to get started creating agents.

1 Like

Okay sweet I’m glad it’s working, got worried there for a sec haha. Thanks for circling back on this!

Hmm I don’t think this difference should cause an issue… what in your research made you think this could be it?

It wan’t that in fact the cause of the issue, it was a stupid mistake made by me on the specification of the embedding model in the enveiroment tab.
I have now crawled succesfully the docs.
Thanks for the help.

2 Likes

Glad you figured it out! You bet!