Skip to content

Conversation

anyxling
Copy link
Member

@anyxling anyxling commented Aug 6, 2025

Description

This new feature enables context-aware query generation by integrating chat history with the LLM.

from langchain_arangodb import ArangoGraphQAChain
from arango import ArangoClient

# Connect to ArangoDB
db = ArangoClient().db(...)

# Initialize components
graph = ArangoGraph()
llm = ChatOpenAI(model="gpt-4o", temperature=0)  # Replace with your LLM

# Create chat message history
history = ArangoChatMessageHistory(
    session_id="user_123",
    db=db,
    collection_name="chat_sessions"
)

# Create the chain
chain = ArangoGraphQAChain.from_llm(
    llm=llm, 
    graph=graph, 
    allow_dangerous_requests=True, 
    verbose=True,
    include_history=True,
    chat_history_store=history,
    max_history_messages=10,
)
Screenshot 2025-08-05 at 20 03 52 Screenshot 2025-08-05 at 20 04 50

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Project configuration change

Complexity

Note

Please provide an estimated complexity of this PR of either Low, Medium or High

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual tests

Checklist

  • Unit tests updated
  • Integration tests updated
  • CHANGELOG.md updated

@anyxling anyxling requested a review from aMahanna August 6, 2025 03:07
@anyxling anyxling self-assigned this Aug 6, 2025
@anyxling anyxling force-pushed the monika-querycache-chat-history branch from a83c298 to 7fa7f4a Compare August 11, 2025 20:38
anyxling and others added 8 commits August 12, 2025 11:22
Co-authored-by: Anthony Mahanna <43019056+aMahanna@users.noreply.github.com>
Co-authored-by: Anthony Mahanna <43019056+aMahanna@users.noreply.github.com>
Co-authored-by: Anthony Mahanna <43019056+aMahanna@users.noreply.github.com>
Copy link
Member

@aMahanna aMahanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anyxling anyxling merged commit b10a1f9 into main Aug 15, 2025
9 checks passed
@anyxling anyxling deleted the monika-querycache-chat-history branch August 15, 2025 19:17
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