Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/context aware agent #1235

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

erik-balfe
Copy link
Contributor

Context-Aware Agent Implementation

This PR introduces context-awareness functionality for agents, inspired by the discussion in #1224.

Implementation:

  • Added withContextAwareness mixin in contextAwareMixin.ts
  • Created OpenAIContextAwareAgent and AnthropicContextAwareAgent
  • Updated relevant documentation and examples

Motivation:

The goal is to allow agents to access indexed data without explicitly calling retriever tools, reducing latency in real-time scenarios especially with not so fast LMs. This approach is analogous to the ContextChatEngine, which automatically incorporates retriever data into the chat context.

Approach:

The implementation uses a mixin pattern to add context retrieval and injection capabilities to existing agent classes. This method allows for flexibility and easy extension to different agent types.

Feedback on the implementation approach and any potential improvements is welcome.

Add ContextAwareAgent mixin to enhance agents with retrieval capabilities
Copy link

changeset-bot bot commented Sep 19, 2024

🦋 Changeset detected

Latest commit: 7b9d7b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
llamaindex Minor
docs Minor
@llamaindex/autotool Major
@llamaindex/experimental Patch
@llamaindex/cloudflare-worker-agent-test Patch
@llamaindex/next-agent-test Patch
@llamaindex/nextjs-edge-runtime-test Patch
@llamaindex/next-node-runtime-test Patch
@llamaindex/waku-query-engine-test Patch
@llamaindex/autotool-01-node-example Patch
@llamaindex/autotool-02-next-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
llama-index-ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 9:29pm

Copy link

pkg-pr-new bot commented Sep 19, 2024

Open in Stackblitz

@llamaindex/autotool

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/autotool@1235

@llamaindex/cloud

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/cloud@1235

@llamaindex/community

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/community@1235

@llamaindex/core

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/core@1235

@llamaindex/env

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/env@1235

@llamaindex/experimental

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/experimental@1235

llamaindex

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/llamaindex@1235

@llamaindex/wasm-tools

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/wasm-tools@1235

commit: 7b9d7b2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants