Skip to content
Discussion options

You must be logged in to vote

The RAG component injects the retreived document into the system prompt along with its souce type and source name: https://github.com/inspector-apm/neuron-ai/blob/main/src/RAG/RAG.php#L125

Be sure to have the latest version 1.15.14

With a bit of good prompting I think you can get what you want asking the agent for a structured output.

The structured output class should ask for the "citations". Somthing like:

namespace App\Output;

class CitedAnswer
{
    #[SchemaProperty(description: 'The answer to the user question', required: true)]
    public string $answer;

    /**
     * @var \App\Output\Citations[]
     */
    #[ArrayOf(Citations::class)]
    public array $citations:
}
namespace App\

Replies: 1 comment 14 replies

Comment options

You must be logged in to vote
14 replies
@bilogic
Comment options

@ilvalerione
Comment options

@bilogic
Comment options

@ilvalerione
Comment options

@bilogic
Comment options

Answer selected by bilogic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants