[PR #642] [MERGED] feat: Support citation for agentic template #656

Closed
opened 2026-02-15 20:15:45 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/create-llama/pull/642
Author: @leehuwuj
Created: 5/22/2025
Status: Merged
Merged: 5/28/2025
Merged by: @marcusschiesser

Base: mainHead: lee/citation-agentic


📝 Commits (10+)

  • ec06a12 feat: add citation processing and prompts for query engine
  • ff9acac add example and improve tool description
  • a46d655 better cond
  • ad0c2f3 Improve citation instructions in prompts and enhance logging in query engine creation
  • 0960b14 Merge remote-tracking branch 'origin/main' into lee/citation-agentic
  • 491dd8e Enhance citation instructions in prompts, improve error handling in source node transformation, and update response synthesizer in query engine creation
  • 22ca4ba Update @llamaindex/chat-ui to version 0.4.6 in package.json and pnpm-lock.yaml; enhance citation instructions in prompts for clarity and correctness.
  • eedffb0 Enhance system prompt and tool description for improved clarity on knowledge base access and citation format in query responses.
  • 13a1454 introduce preconfigured agent for citation answering
  • 8799669 Refactor workflow creation to utilize query tool with citation support; enhance system prompt for clarity in knowledge base responses.

📊 Changes

25 files changed (+3224 additions, -2820 deletions)

View changed files

.changeset/few-news-marry.md (+5 -0)
.changeset/rich-nights-hug.md (+5 -0)
.changeset/small-insects-hug.md (+5 -0)
.changeset/stale-things-beg.md (+5 -0)
📝 .github/workflows/e2e.yml (+10 -0)
📝 packages/create-llama/helpers/python.ts (+14 -0)
📝 packages/create-llama/templates/components/use-cases/python/agentic_rag/workflow.py (+14 -4)
📝 packages/create-llama/templates/types/llamaindexserver/fastapi/app/settings.py (+2 -2)
📝 packages/create-llama/templates/types/llamaindexserver/fastapi/pyproject.toml (+4 -1)
📝 packages/server/package.json (+1 -1)
📝 pnpm-lock.yaml (+5 -5)
python/llama-index-server/examples/llamacloud/main.py (+113 -0)
📝 python/llama-index-server/llama_index/server/api/callbacks/__init__.py (+2 -0)
python/llama-index-server/llama_index/server/api/callbacks/agent_call_tool.py (+26 -0)
📝 python/llama-index-server/llama_index/server/api/callbacks/source_nodes.py (+34 -14)
📝 python/llama-index-server/llama_index/server/api/models.py (+3 -5)
📝 python/llama-index-server/llama_index/server/api/routers/chat.py (+2 -1)
📝 python/llama-index-server/llama_index/server/prompts.py (+39 -2)
📝 python/llama-index-server/llama_index/server/services/llamacloud/file.py (+7 -7)
📝 python/llama-index-server/llama_index/server/tools/index/__init__.py (+2 -1)

...and 5 more files

📄 Description

Summary by CodeRabbit

  • New Features

    • Added citation support to query engine tools and agent workflows, enabling responses with source references formatted as citations.
    • Introduced a new FastAPI app integrating LlamaCloud with environment-based configuration.
    • Enabled agent widget display in the UI during tool calls for enhanced interactivity.
    • Updated OpenAI model defaults to "gpt-4.1" and improved embedding model selection.
  • Improvements

    • Enhanced file naming and citation handling for LlamaCloud integrations with sanitized filenames.
    • Expanded callback and tool processing for better agent and citation event tracking.
    • Added detailed citation prompts to improve response quality and traceability.
    • Refined event handling to better capture source nodes and agent tool calls.
  • Bug Fixes

    • Improved handling of tool name matching and citation metadata for more robust processing.
  • Chores

    • Updated dependencies, including a version bump for @llamaindex/chat-ui to 0.4.6.
    • Enhanced CI workflow to build and provide server package for testing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/create-llama/pull/642 **Author:** [@leehuwuj](https://github.com/leehuwuj) **Created:** 5/22/2025 **Status:** ✅ Merged **Merged:** 5/28/2025 **Merged by:** [@marcusschiesser](https://github.com/marcusschiesser) **Base:** `main` ← **Head:** `lee/citation-agentic` --- ### 📝 Commits (10+) - [`ec06a12`](https://github.com/run-llama/create-llama/commit/ec06a1264357b676c343be49135689691e7fe9ec) feat: add citation processing and prompts for query engine - [`ff9acac`](https://github.com/run-llama/create-llama/commit/ff9acac67ac42f75479e0bfbfaaea5164c9c99e1) add example and improve tool description - [`a46d655`](https://github.com/run-llama/create-llama/commit/a46d6555be5675e1ca11bfe2907751a8f695420e) better cond - [`ad0c2f3`](https://github.com/run-llama/create-llama/commit/ad0c2f3dc90b7eb66db20965a445b180fc9894c2) Improve citation instructions in prompts and enhance logging in query engine creation - [`0960b14`](https://github.com/run-llama/create-llama/commit/0960b14393014536a9839a8b9653f328ae6a7c64) Merge remote-tracking branch 'origin/main' into lee/citation-agentic - [`491dd8e`](https://github.com/run-llama/create-llama/commit/491dd8e26c1e04a7c0f970ce100eaf700e23df91) Enhance citation instructions in prompts, improve error handling in source node transformation, and update response synthesizer in query engine creation - [`22ca4ba`](https://github.com/run-llama/create-llama/commit/22ca4ba7ff91d22b92ffe98eb8d356c7e261c7cb) Update @llamaindex/chat-ui to version 0.4.6 in package.json and pnpm-lock.yaml; enhance citation instructions in prompts for clarity and correctness. - [`eedffb0`](https://github.com/run-llama/create-llama/commit/eedffb0f655bfd5ad64f4bcd5d1da4dab2aa35fe) Enhance system prompt and tool description for improved clarity on knowledge base access and citation format in query responses. - [`13a1454`](https://github.com/run-llama/create-llama/commit/13a14545b90c2a4334bca12c5da21867ffb478e6) introduce preconfigured agent for citation answering - [`8799669`](https://github.com/run-llama/create-llama/commit/8799669722a9353c69292de72a5d6b532b4daf1d) Refactor workflow creation to utilize query tool with citation support; enhance system prompt for clarity in knowledge base responses. ### 📊 Changes **25 files changed** (+3224 additions, -2820 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/few-news-marry.md` (+5 -0) ➕ `.changeset/rich-nights-hug.md` (+5 -0) ➕ `.changeset/small-insects-hug.md` (+5 -0) ➕ `.changeset/stale-things-beg.md` (+5 -0) 📝 `.github/workflows/e2e.yml` (+10 -0) 📝 `packages/create-llama/helpers/python.ts` (+14 -0) 📝 `packages/create-llama/templates/components/use-cases/python/agentic_rag/workflow.py` (+14 -4) 📝 `packages/create-llama/templates/types/llamaindexserver/fastapi/app/settings.py` (+2 -2) 📝 `packages/create-llama/templates/types/llamaindexserver/fastapi/pyproject.toml` (+4 -1) 📝 `packages/server/package.json` (+1 -1) 📝 `pnpm-lock.yaml` (+5 -5) ➕ `python/llama-index-server/examples/llamacloud/main.py` (+113 -0) 📝 `python/llama-index-server/llama_index/server/api/callbacks/__init__.py` (+2 -0) ➕ `python/llama-index-server/llama_index/server/api/callbacks/agent_call_tool.py` (+26 -0) 📝 `python/llama-index-server/llama_index/server/api/callbacks/source_nodes.py` (+34 -14) 📝 `python/llama-index-server/llama_index/server/api/models.py` (+3 -5) 📝 `python/llama-index-server/llama_index/server/api/routers/chat.py` (+2 -1) 📝 `python/llama-index-server/llama_index/server/prompts.py` (+39 -2) 📝 `python/llama-index-server/llama_index/server/services/llamacloud/file.py` (+7 -7) 📝 `python/llama-index-server/llama_index/server/tools/index/__init__.py` (+2 -1) _...and 5 more files_ </details> ### 📄 Description <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added citation support to query engine tools and agent workflows, enabling responses with source references formatted as citations. - Introduced a new FastAPI app integrating LlamaCloud with environment-based configuration. - Enabled agent widget display in the UI during tool calls for enhanced interactivity. - Updated OpenAI model defaults to "gpt-4.1" and improved embedding model selection. - **Improvements** - Enhanced file naming and citation handling for LlamaCloud integrations with sanitized filenames. - Expanded callback and tool processing for better agent and citation event tracking. - Added detailed citation prompts to improve response quality and traceability. - Refined event handling to better capture source nodes and agent tool calls. - **Bug Fixes** - Improved handling of tool name matching and citation metadata for more robust processing. - **Chores** - Updated dependencies, including a version bump for `@llamaindex/chat-ui` to 0.4.6. - Enhanced CI workflow to build and provide server package for testing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:15:45 -05:00
yindo closed this issue 2026-02-15 20:15:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#656