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

DOC: <A long term memory agent 'DOC: ' prefix> #29193

Open
2 tasks done
simpliatanu opened this issue Jan 14, 2025 · 1 comment
Open
2 tasks done

DOC: <A long term memory agent 'DOC: ' prefix> #29193

simpliatanu opened this issue Jan 14, 2025 · 1 comment
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder

Comments

@simpliatanu
Copy link

URL

https://python.langchain.com/docs/versions/migrating_memory/long_term_memory_agent/

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

Something is wrong with this example, when I run exactly same as in the documentation I keep get 429 error. Although I have a commercial license of OpenAI and there is enough dollars left. comes load_memories, not sure what is wrong

error --
raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
During task with name 'load_memories' and id '0852441c-bcd1-ee97-f431-c3b9d0a980f2'

Idea or request for content:

kindly correct the doc

@dosubot dosubot bot added the 🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder label Jan 14, 2025
@simpliatanu
Copy link
Author

can be closed, found the problem in the sample code given in docs
corrected code below, first time documents will be [], no check was there, which results in weird error

def search_recall_memories(query: str, config: RunnableConfig) -> List[str]:
"""Search for relevant memories."""
# Extract the user ID from the config
user_id = get_user_id(config)

print (f"User ID: {user_id}")
# Perform a similarity search with a predefined filter
documents = recall_vector_store.similarity_search(
    query,
    k=3,
    filter=lambda doc: doc.metadata.get("user_id") == user_id,
)


# Check if any documents were found
if not documents:
    return []
else:
# Extract and return the content of the documents
    return [doc.page_content for doc in documents]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant