Citations

Track sources in agent responses

Citations let agents cite sources in their responses.

Diagram

Citations

📚 Knowledge

🤖 Agent

📝 Response

📖 Citations

Quick Start

  1. Enable Citations
    rust
    use praisonai::{Agent, KnowledgeConfig};
    
    let config = KnowledgeConfig::new()
        .source("docs/")
        .citations(true);
    
    let agent = Agent::new()
        .name("Researcher")
        .knowledge(config)
        .build()?;
    
    let response = agent.chat("What does the policy say?").await?;
    // Response includes [1], [2] citations with sources

Citation Format

The policy states that refunds are available within 30 days [1].
Premium members receive expedited processing [2].

Sources:
[1] policy.pdf, page 5
[2] membership.txt, line 23

Related