Skip to content

Conversation

@jennsun
Copy link

@jennsun jennsun commented Dec 9, 2025

Created copy of agent-langgraph template and added thread-scoped/short term memory features

Note: frontend e2e-chatbot-app interface does not support passing in custom input/thread id, only invocation calls on the endpoint. Have filed a ticket to support passing in chatcontext via frontend interface so we can use conversation id as thread id

example app: https://eng-ml-agent-platform.staging.cloud.databricks.com/apps/j-shorttermagent?o=2850744067564480

Example local testing:

curl -X POST http://localhost:8000/invocations \
    -H "Content-Type: application/json" \
    -d '{"input": [{"role": "user", "content": "Hello I live in SF!"}]}'

output from above:

{"object":"response","output":[{"type":"message","id":"lc_run--019b00bc-da08-74b0-a3d3-923b4a4e002f","content":[{"text":"Hello! It's great to meet someone from San Francisco! 🌉 \n\nSF is such a vibrant city with so much to offer - from the Golden Gate Bridge and Alcatraz to the diverse neighborhoods, amazing food scene, and beautiful views. \n\nIs there anything specific you'd like to know or talk about regarding San Francisco, or anything else I can help you with today?","type":"output_text"}],"role":"assistant"}],"custom_outputs":{"thread_id":"16da732c-0bed-4525-a194-6c9759bcdf27"}}

Follow-up asking statefulness:

curl -X POST http://localhost:8000/invocations \
    -H "Content-Type: application/json" \
    -d '{
        "input": [{"role": "user", "content": "What did we discuss?"}],
        "custom_inputs": {"thread_id": "16da732c-0bed-4525-a194-6c9759bcdf27"}
    }'

Output:

{"object":"response","output":[{"type":"message","id":"lc_run--019b00bd-9b08-7193-b678-6d1b77da88be","content":[{"text":"We just started our conversation! So far, you've told me that you live in San Francisco, and I responded with a greeting acknowledging that. \n\nThat's the extent of our discussion - this is only your second message to me. Is there something specific you'd like to talk about or any questions I can help you with?","type":"output_text"}],"role":"assistant"}],"custom_outputs":{"thread_id":"16da732c-0bed-4525-a194-6c9759bcdf27"}}

seeing checkpoint tables are ready in app logs:
image

can retrieve thread id via logs:
image

ensure checkpoints are stored in lakebase:
image

image

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.

1 participant