Hey everyone,
I'm building an agentic data analyst and I need to have knowledge base associated with it. Using AWs Bedrock as source for
models and DynamoDB and Postgresql as storage.
I have been trying the examples from the Agno Cookbook, but recurring getting into errors for loading the data into the
knowledge base.
The error have been repeated about the `Unexpected error calling Bedrock API: An error occurred
(ValidationException) when calling the InvokeModel operation: Malformed
input request: #: required key [prompt] not found#: extraneous key
[texts] is not permitted#: extraneous key [input_type] is not
permitted, please reformat your input and try again.` when calling to load the data into the knowledge.
`Error during vector search: {'Error': {'Message': 'Malformed input
request: #: required key [prompt] not found#: extraneous key [texts] is
not permitted#: extraneous key [input_type] is not permitted, please
reformat your input and try again.', 'Code': 'ValidationException'},
'ResponseMetadata': {'RequestId':
'05a126c9-d01b-4300-9af6-xxxxxxxxxxx', 'HTTPStatusCode': 400,
'HTTPHeaders': {'date': 'Mon, 24 Nov 2025 01:56:45 GMT',
'content-type': 'application/json', 'content-length': '205',
'connection': 'keep-alive', 'x-amzn-requestid':
'05a126c9-d01b-4300-9af6-xxxxxxxxxxx', 'x-amzn-errortype':
'ValidationException:http://internal.amazon.com/coral/com.amazon.bedroc
k/'}, 'RetryAttempts': 0}, 'message': 'Malformed input request: #:
required key [prompt] not found#: extraneous key [texts] is not
permitted#: extraneous key [input_type] is not permitted, please
reformat your input and try again.'}`
It is possible to have some help about it? Because seems to be an error in the embedder and model calling.
The code snippet bellow.
Thanks
import asyncio
import boto3
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
from agno.models.aws import AwsBedrock
from agno.knowledge.embedder.aws_bedrock import AwsBedrockEmbedder
boto3_session = boto3.Session(aws_access_key_id="key_id",
aws_secret_access_key="key_secret")
# Create Knowledge Instance
knowledge = Knowledge(
name="Basic SDK Knowledge Base",
description="Agno 2.0 Knowledge Implementation",
vector_db=PgVector(
table_name="vectors", db_url="postgresql+psycopg://ai:ai@localhost:5532/ai",
embedder=AwsBedrockEmbedder(aws_region="us-east-2",
aws_access_key_id="key_id",
aws_secret_access_key="key_secret",
session=boto3_session,
id="us.meta.llama4-maverick-17b-instruct-v1:0"),
),
)
# As a list
asyncio.run(
knowledge.add_contents_async(
[
{
"name": "CV's",
"path": "testing_resources/cv_1.pdf",
"metadata": {"user_tag": "Engineering candidates"},
},
{
"name": "Docs",
"url": "https://docs.agno.com/introduction",
"metadata": {"user_tag": "Documents"},
},
]
)
)
# Using specifc fields
asyncio.run(
knowledge.add_contents_async(
urls=[
"https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf",
"https://docs.agno.com/introduction",
],
)
)
agent = Agent(model=AwsBedrock(id="us.meta.llama4-maverick-17b-instruct-v1:0",
aws_region="us-east-2",
aws_access_key_id="key_id",
aws_secret_access_key="key_secret"),
knowledge=knowledge)
agent.print_response("What can you tell me about my documents?", markdown=True)